Commit 3ea9f0d9 authored by Alain Takoudjou's avatar Alain Takoudjou

playbook vm-bootstrap: fix warning messages on deprecated bare vars and shell usage in some tasks

parent d2a2521b
...@@ -2,6 +2,18 @@ ...@@ -2,6 +2,18 @@
hosts: 127.0.0.1 hosts: 127.0.0.1
connection: local connection: local
vars:
logrotate_args:
- name: vm-bootstrap
path: /var/log/vm-bootstrap.log
options:
- weekly
- compress
- rotate 5
- notifempty
- create
- dateext
roles: roles:
- { role: vm-bootstrap, startup_playbook_id: imt-vm-bootstrap.yml } - { role: vm-bootstrap, startup_playbook_id: imt-vm-bootstrap.yml }
- ntp - ntp
...@@ -26,14 +38,5 @@ ...@@ -26,14 +38,5 @@
- { role: vm-disks, vd_disk: t, data_n: 12 } - { role: vm-disks, vd_disk: t, data_n: 12 }
- { role: vm-disks, vd_disk: u, data_n: 12 } - { role: vm-disks, vd_disk: u, data_n: 12 }
- role: logrotate - role: logrotate
logrotate_scripts: logrotate_scripts: "{{logrotate_args}}"
- name: vm-bootstrap
path: /var/log/vm-bootstrap.log
options:
- weekly
- compress
- rotate 5
- notifempty
- create
- dateext
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
template: template:
src: logrotate.d.j2 src: logrotate.d.j2
dest: /etc/logrotate.d/{{ item.name }} dest: /etc/logrotate.d/{{ item.name }}
with_items: logrotate_scripts with_items: "{{logrotate_scripts}}"
when: logrotate_scripts is defined when: logrotate_scripts is defined
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
when: hostname_file.stat.exists == True when: hostname_file.stat.exists == True
- name: setting cluster - name: setting cluster
shell: wget --no-check-certificate "{{ lookup('file', '/etc/opt/cluster.hash') }}/hosts" -O /tmp/hosts get_url: url={{ lookup('file', '/etc/opt/cluster.hash') }}/hosts dest=/tmp/hosts validate_certs=no
when: cluster_hash.stat.exists == True when: cluster_hash.stat.exists == True
- name: stat /tmp/hosts - name: stat /tmp/hosts
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
- include: sudo.yml - include: sudo.yml
- include: ssh.yml - include: ssh.yml
- shell: mkdir -p /opt/upgrader - file: path=/opt/upgrader state=directory
- stat: path=/opt/upgrader/last-upgrade - stat: path=/opt/upgrader/last-upgrade
register: last_upgrade register: last_upgrade
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment