2020-08-18 11:57:53 +02:00
|
|
|
---
|
2021-11-23 21:26:18 +01:00
|
|
|
- name: include user tasks
|
|
|
|
include_tasks: user.yml
|
|
|
|
|
2022-03-28 14:48:31 +02:00
|
|
|
|
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
|
2021-11-23 21:26:18 +01:00
|
|
|
owner: "{{ cv4pve_user }}"
|
|
|
|
group: "{{ cv4pve_user_group }}"
|
2020-08-18 11:57:53 +02:00
|
|
|
loop:
|
|
|
|
- '/tmp/cv4pve'
|
|
|
|
- '/usr/local/bin/cv4pve'
|
|
|
|
|
|
|
|
- name: download archives
|
|
|
|
become: yes
|
2021-11-23 21:26:18 +01:00
|
|
|
ansible.builtin.get_url:
|
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'
|
|
|
|
|
2021-11-23 21:26:18 +01:00
|
|
|
- name: extract archives
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
2021-11-23 21:26:18 +01:00
|
|
|
owner: "{{ cv4pve_user }}"
|
|
|
|
group: "{{ cv4pve_user_group }}"
|
2020-08-18 11:57:53 +02:00
|
|
|
|
2022-03-28 14:48:31 +02:00
|
|
|
- name: template cv4pve.service
|
2020-08-18 11:57:53 +02:00
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2022-03-28 14:48:31 +02:00
|
|
|
src: cv4pve.service.j2
|
|
|
|
dest: /etc/systemd/system/cv4pve.service
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify:
|
|
|
|
- systemctl daemon-reload
|
2020-08-18 11:57:53 +02:00
|
|
|
|
2022-03-28 14:48:31 +02:00
|
|
|
- name: template cv4pve_mail.service
|
2020-08-18 11:57:53 +02:00
|
|
|
become: yes
|
2022-03-28 14:48:31 +02:00
|
|
|
ansible.builtin.template:
|
|
|
|
src: cv4pve_mail.service.j2
|
|
|
|
dest: /etc/systemd/system/cv4pve_mail.service
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
notify:
|
|
|
|
- systemctl daemon-reload
|
2020-08-18 11:57:53 +02:00
|
|
|
|
|
|
|
|
2022-03-28 14:48:31 +02:00
|
|
|
- name: template cv4pve.timer
|
2021-03-13 22:11:57 +01:00
|
|
|
become: yes
|
|
|
|
ansible.builtin.template:
|
2022-03-28 14:48:31 +02:00
|
|
|
src: cv4pve.timer.j2
|
|
|
|
dest: /etc/systemd/system/cv4pve.timer
|
2022-01-24 07:53:01 +01:00
|
|
|
owner: root
|
2022-03-28 14:48:31 +02:00
|
|
|
group: root
|
2020-08-18 11:57:53 +02:00
|
|
|
mode: 0644
|
2022-03-28 14:48:31 +02:00
|
|
|
notify:
|
|
|
|
- systemctl daemon-reload
|
|
|
|
|
|
|
|
- name: systemctl start cv4pve.timer
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.systemd:
|
|
|
|
name: cv4pve.timer
|
|
|
|
state: started
|
|
|
|
enabled: yes
|