2020-08-18 11:57:53 +02:00
|
|
|
---
|
|
|
|
- name: create directories
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.file:
|
2020-08-18 11:57:53 +02:00
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
loop:
|
|
|
|
- '/tmp/cv4pve'
|
|
|
|
- '/usr/local/bin/cv4pve'
|
|
|
|
|
|
|
|
- name: download archives
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.get_url: ## hier variable für version
|
2020-12-14 15:05:12 +01:00
|
|
|
url: "{{ cv4pve_dl_link }}"
|
2020-08-18 11:57:53 +02:00
|
|
|
dest: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
|
|
|
|
mode: '0775'
|
|
|
|
|
|
|
|
- name: Extract archives
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.unarchive:
|
2020-08-18 11:57:53 +02:00
|
|
|
src: /tmp/cv4pve/cv4pve-autosnap-linux-x64.zip
|
|
|
|
dest: /usr/local/bin/cv4pve
|
|
|
|
remote_src: yes
|
|
|
|
mode: a+x
|
|
|
|
|
|
|
|
- name: copy bash-script
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
src: "cv4pve-script.sh"
|
|
|
|
dest: "/usr/local/bin/cv4pve/cv4pve-script.sh"
|
|
|
|
mode: a+x
|
|
|
|
|
|
|
|
- name: create cronjob
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.cron:
|
2020-08-18 11:57:53 +02:00
|
|
|
name: cv4pve-autosnap
|
|
|
|
state: present
|
|
|
|
job: "/usr/local/bin/cv4pve/cv4pve-script.sh"
|
|
|
|
minute: "{{ cv4pve_cron_minute }}"
|
|
|
|
hour: "{{ cv4pve_cron_hour }}"
|
|
|
|
|
|
|
|
- name: Create log
|
|
|
|
become: true
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.file:
|
2020-08-18 11:57:53 +02:00
|
|
|
path: /var/log/cv4pve-autosnap.log
|
|
|
|
state: touch
|
|
|
|
owner: root
|
|
|
|
group: root
|
2021-05-02 14:20:16 +02:00
|
|
|
mode: 0640
|
2020-08-18 11:57:53 +02:00
|
|
|
access_time: preserve
|
|
|
|
modification_time: preserve
|
|
|
|
|
2021-03-13 22:11:57 +01:00
|
|
|
- name: copy logrotate config
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: logrotate_cv4pve
|
|
|
|
dest: /etc/logrotate.d/cv4pve-autosnap
|
2020-08-18 11:57:53 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|