Bugfix: sanoid (#258)
Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#258 Co-authored-by: mg <michael.grote@posteo.de> Co-committed-by: mg <michael.grote@posteo.de>
This commit is contained in:
parent
2a5d9a8dea
commit
90ff3cab79
1 changed files with 95 additions and 96 deletions
|
@ -1,96 +1,95 @@
|
|||
---
|
||||
- name: include user tasks
|
||||
include_tasks: user.yml
|
||||
|
||||
- name: Install Required Packages
|
||||
become: true
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- ca-certificates
|
||||
- apt-transport-https
|
||||
- software-properties-common
|
||||
- curl
|
||||
- wget
|
||||
- logrotate
|
||||
- libcapture-tiny-perl
|
||||
- libconfig-inifiles-perl
|
||||
- moreutils
|
||||
state: present
|
||||
|
||||
- name: Create Sanoid Directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
recurse: true
|
||||
with_items:
|
||||
- /usr/local/bin
|
||||
- /etc/sanoid
|
||||
|
||||
- name: Install Sanoid Binary
|
||||
become: true
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ sanoid_dl_url }}"
|
||||
dest: /usr/local/bin/sanoid
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0755
|
||||
|
||||
- name: Install Sanoid Defaults Configuration
|
||||
become: true
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ sanoid_dl_conf_url }}"
|
||||
dest: /etc/sanoid/sanoid.defaults.conf
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0644
|
||||
|
||||
- name: Generate Sanoid Configuration
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: sanoid.conf.j2
|
||||
dest: /etc/sanoid/sanoid.conf
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0644
|
||||
|
||||
- name: Create Sanoid Log
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ sanoid_log_file }}"
|
||||
state: touch
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0644
|
||||
access_time: preserve
|
||||
modification_time: preserve
|
||||
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_sanoid
|
||||
dest: /etc/logrotate.d/sanoid
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0644
|
||||
|
||||
- name: Generate Sanoid Cron Scripts
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: sanoid-cron.sh
|
||||
dest: /usr/local/bin/sanoid-cron.sh
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0755
|
||||
|
||||
- name: Configure Sanoid Cron Job
|
||||
become: true
|
||||
ansible.builtin.cron:
|
||||
name: sanoid-cron
|
||||
job: /usr/local/bin/sanoid-cron.sh
|
||||
minute: "{{ sanoid_cron_minutes }}"
|
||||
hour: "{{ sanoid_cron_hours }}"
|
||||
user: "{{ sanoid_user }}"
|
||||
state: present
|
||||
---
|
||||
- name: include user tasks
|
||||
include_tasks: user.yml
|
||||
|
||||
- name: Install Required Packages
|
||||
become: true
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- ca-certificates
|
||||
- apt-transport-https
|
||||
- software-properties-common
|
||||
- curl
|
||||
- wget
|
||||
- logrotate
|
||||
- libcapture-tiny-perl
|
||||
- libconfig-inifiles-perl
|
||||
- moreutils
|
||||
state: present
|
||||
|
||||
- name: Create Sanoid Directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
recurse: true
|
||||
with_items:
|
||||
- /etc/sanoid
|
||||
|
||||
- name: Install Sanoid Binary
|
||||
become: true
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ sanoid_dl_url }}"
|
||||
dest: /usr/local/bin/sanoid
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0755
|
||||
|
||||
- name: Install Sanoid Defaults Configuration
|
||||
become: true
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ sanoid_dl_conf_url }}"
|
||||
dest: /etc/sanoid/sanoid.defaults.conf
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0644
|
||||
|
||||
- name: Generate Sanoid Configuration
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: sanoid.conf.j2
|
||||
dest: /etc/sanoid/sanoid.conf
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0644
|
||||
|
||||
- name: Create Sanoid Log
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{ sanoid_log_file }}"
|
||||
state: touch
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0644
|
||||
access_time: preserve
|
||||
modification_time: preserve
|
||||
|
||||
- name: copy logrotate config
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: logrotate_sanoid
|
||||
dest: /etc/logrotate.d/sanoid
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0644
|
||||
|
||||
- name: Generate Sanoid Cron Scripts
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: sanoid-cron.sh
|
||||
dest: /usr/local/bin/sanoid-cron.sh
|
||||
owner: "{{ sanoid_user }}"
|
||||
group: "{{ sanoid_user_group }}"
|
||||
mode: 0755
|
||||
|
||||
- name: Configure Sanoid Cron Job
|
||||
become: true
|
||||
ansible.builtin.cron:
|
||||
name: sanoid-cron
|
||||
job: /usr/local/bin/sanoid-cron.sh
|
||||
minute: "{{ sanoid_cron_minutes }}"
|
||||
hour: "{{ sanoid_cron_hours }}"
|
||||
user: "{{ sanoid_user }}"
|
||||
state: present
|
||||
|
|
Loading…
Reference in a new issue