diff --git a/playbook/imt-vm-bootstrap.yml b/playbook/imt-vm-bootstrap.yml index db1b1d9bc2d233df53eb08434a951823c51fa7cb..9bc1ec54999f9205143efaac56cdea32009cec01 100644 --- a/playbook/imt-vm-bootstrap.yml +++ b/playbook/imt-vm-bootstrap.yml @@ -2,6 +2,18 @@ hosts: 127.0.0.1 connection: local + vars: + logrotate_args: + - name: vm-bootstrap + path: /var/log/vm-bootstrap.log + options: + - weekly + - compress + - rotate 5 + - notifempty + - create + - dateext + roles: - { role: vm-bootstrap, startup_playbook_id: imt-vm-bootstrap.yml } - ntp @@ -26,14 +38,5 @@ - { role: vm-disks, vd_disk: t, data_n: 12 } - { role: vm-disks, vd_disk: u, data_n: 12 } - role: logrotate - logrotate_scripts: - - name: vm-bootstrap - path: /var/log/vm-bootstrap.log - options: - - weekly - - compress - - rotate 5 - - notifempty - - create - - dateext + logrotate_scripts: "{{logrotate_args}}" diff --git a/playbook/roles/logrotate/tasks/main.yml b/playbook/roles/logrotate/tasks/main.yml index 409851999e75374b62b75d8e32c8e624e0a3208f..9b080cc3d9b268f1c620e9afc7af194186edbbd1 100644 --- a/playbook/roles/logrotate/tasks/main.yml +++ b/playbook/roles/logrotate/tasks/main.yml @@ -6,5 +6,5 @@ template: src: logrotate.d.j2 dest: /etc/logrotate.d/{{ item.name }} - with_items: logrotate_scripts + with_items: "{{logrotate_scripts}}" when: logrotate_scripts is defined diff --git a/playbook/roles/vm-bootstrap/tasks/hostname.yml b/playbook/roles/vm-bootstrap/tasks/hostname.yml index b01ce7a8dedb59ff0ed5c23d91eb5ce7ec018e32..8fb6a8f7595932b55e6490780e47fe9b7954ee6a 100644 --- a/playbook/roles/vm-bootstrap/tasks/hostname.yml +++ b/playbook/roles/vm-bootstrap/tasks/hostname.yml @@ -37,7 +37,7 @@ when: hostname_file.stat.exists == True - 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 - name: stat /tmp/hosts diff --git a/playbook/roles/vm-bootstrap/tasks/main.yml b/playbook/roles/vm-bootstrap/tasks/main.yml index 82aaae884c53fbb73bc339393140bb5285c98394..988d9c6eee8f72676796bd5d5dd4d60a02602676 100644 --- a/playbook/roles/vm-bootstrap/tasks/main.yml +++ b/playbook/roles/vm-bootstrap/tasks/main.yml @@ -51,7 +51,7 @@ - include: sudo.yml - include: ssh.yml - - shell: mkdir -p /opt/upgrader + - file: path=/opt/upgrader state=directory - stat: path=/opt/upgrader/last-upgrade register: last_upgrade