update cv4pve autosnap role #20
1 changed files with 17 additions and 9 deletions
|
@ -3,7 +3,6 @@
|
||||||
ansible.builtin.include_tasks: user.yml
|
ansible.builtin.include_tasks: user.yml
|
||||||
|
|
||||||
- name: create directories
|
- name: create directories
|
||||||
become: true
|
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -11,21 +10,24 @@
|
||||||
group: "{{ cv4pve_user_group }}"
|
group: "{{ cv4pve_user_group }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
loop:
|
loop:
|
||||||
- '/tmp/cv4pve'
|
- '/usr/local/bin/cv4pve-{{ cv4pve_version }}/'
|
||||||
- '/usr/local/bin/cv4pve'
|
|
||||||
|
|
||||||
- name: download archives
|
- name: download archives
|
||||||
become: true
|
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: "{{ cv4pve_dl_link }}"
|
src: "{{ cv4pve_dl_link }}"
|
||||||
dest: /tmp/cv4pve/cv4pve-autosnap-linux-x64-{{ cv4pve_version }}
|
dest: /usr/local/bin/cv4pve/
|
||||||
mode: '0775'
|
mode: '0775'
|
||||||
owner: "{{ cv4pve_user }}"
|
owner: "{{ cv4pve_user }}"
|
||||||
group: "{{ cv4pve_user_group }}"
|
group: "{{ cv4pve_user_group }}"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
creates: /usr/local/bin/cv4pve/cv4pve-autosnap-{{ cv4pve_version }}
|
||||||
|
list_files: true
|
||||||
|
|
||||||
|
- name: move
|
||||||
|
ansible.builtin.command: |
|
||||||
|
mv /usr/local/bin/cv4pve/cv4pve-autosnap /usr/local/bin/cv4pve/cv4pve-autosnap-{{ cv4pve_version }}
|
||||||
|
|
||||||
- name: template cv4pve.service
|
- name: template cv4pve.service
|
||||||
become: true
|
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: cv4pve.service.j2
|
src: cv4pve.service.j2
|
||||||
dest: /etc/systemd/system/cv4pve.service
|
dest: /etc/systemd/system/cv4pve.service
|
||||||
|
@ -36,7 +38,6 @@
|
||||||
- systemctl daemon-reload
|
- systemctl daemon-reload
|
||||||
|
|
||||||
- name: template cv4pve_mail.service
|
- name: template cv4pve_mail.service
|
||||||
become: true
|
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: cv4pve_mail.service.j2
|
src: cv4pve_mail.service.j2
|
||||||
dest: /etc/systemd/system/cv4pve_mail.service
|
dest: /etc/systemd/system/cv4pve_mail.service
|
||||||
|
@ -47,7 +48,6 @@
|
||||||
- systemctl daemon-reload
|
- systemctl daemon-reload
|
||||||
|
|
||||||
- name: template cv4pve.timer
|
- name: template cv4pve.timer
|
||||||
become: true
|
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: cv4pve.timer.j2
|
src: cv4pve.timer.j2
|
||||||
dest: /etc/systemd/system/cv4pve.timer
|
dest: /etc/systemd/system/cv4pve.timer
|
||||||
|
@ -58,8 +58,16 @@
|
||||||
- systemctl daemon-reload
|
- systemctl daemon-reload
|
||||||
|
|
||||||
- name: systemctl start cv4pve.timer
|
- name: systemctl start cv4pve.timer
|
||||||
become: true
|
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: cv4pve.timer
|
name: cv4pve.timer
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
|
||||||
|
- name: remove old cv4pve versions
|
||||||
|
ansible.builtin.command: |
|
||||||
|
rm -rf /tmp/cv4pve/cv4pve-autosnap-linux-x64-{{ cv4pve_version }}
|
||||||
|
path: "{{ item['path'] }}"
|
||||||
|
state: absent
|
||||||
|
with_items: "{{ find_results['files'] }}"
|
||||||
|
...
|
||||||
|
|
Loading…
Reference in a new issue