diff options
author | Markos Chandras <mchandras@suse.de> | 2018-03-28 21:04:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-03-28 21:04:22 +0000 |
commit | 14228ae572f272b03b535271414772f2206208c8 (patch) | |
tree | 2b627ac69373bc29aa9e20d61ed31ced7a0c72fb /xci/playbooks | |
parent | 311efd295d83590d766b8972ebe1e18df1b74bc2 (diff) | |
parent | 9e1d3d6e62abf5d0da26a296bcd235f37a54d9c6 (diff) |
Merge "xci: playbooks: Fixes various ansible-lint warnings"
Diffstat (limited to 'xci/playbooks')
-rw-r--r-- | xci/playbooks/configure-localhost.yml | 1 | ||||
-rw-r--r-- | xci/playbooks/get-opnfv-scenario-requirements.yml | 9 | ||||
-rw-r--r-- | xci/playbooks/roles/bootstrap-host/tasks/network.yml | 10 | ||||
-rw-r--r-- | xci/playbooks/roles/bootstrap-host/tasks/time.yml | 5 | ||||
-rw-r--r-- | xci/playbooks/roles/configure-nfs/tasks/main.yml | 2 | ||||
-rw-r--r-- | xci/playbooks/roles/prepare-functest/tasks/main.yml | 2 |
6 files changed, 22 insertions, 7 deletions
diff --git a/xci/playbooks/configure-localhost.yml b/xci/playbooks/configure-localhost.yml index c8a9840c..f64400e3 100644 --- a/xci/playbooks/configure-localhost.yml +++ b/xci/playbooks/configure-localhost.yml @@ -103,3 +103,4 @@ shell: env > "{{ xci_path }}/.cache/xci.env" args: executable: /bin/bash + creates: "{{ xci_path }}/.cache/xci.env" diff --git a/xci/playbooks/get-opnfv-scenario-requirements.yml b/xci/playbooks/get-opnfv-scenario-requirements.yml index e99c47b2..f37de61a 100644 --- a/xci/playbooks/get-opnfv-scenario-requirements.yml +++ b/xci/playbooks/get-opnfv-scenario-requirements.yml @@ -113,18 +113,21 @@ - name: Determine if the selected {{ deploy_scenario }} scenario can be deployed block: - - set_fact: + - name: Set scenario installer fact + set_fact: deploy_scenario_installer: "{{ item }}" with_items: "{{ deploy_scenario.installers }}" loop_control: label: "{{ item.installer }}" when: item.installer == installer_type - - set_fact: + - name: Set scenario flavor fact + set_fact: deploy_scenario_flavor: "{{ (xci_flavor in deploy_scenario_installer.flavors) | bool }}" when: - deploy_scenario_installer is defined - deploy_scenario_installer - - set_fact: + - name: Set scenario distro flavor fact + set_fact: deploy_scenario_distro: "{{ (xci_distro in deploy_scenario_installer.distros) | bool }}" when: - deploy_scenario_flavor is defined diff --git a/xci/playbooks/roles/bootstrap-host/tasks/network.yml b/xci/playbooks/roles/bootstrap-host/tasks/network.yml index 01edf459..ea9060e6 100644 --- a/xci/playbooks/roles/bootstrap-host/tasks/network.yml +++ b/xci/playbooks/roles/bootstrap-host/tasks/network.yml @@ -37,7 +37,12 @@ name: 8021q state: present - name: ensure interfaces.d folder is empty - shell: "/bin/rm -rf /etc/network/interfaces.d/*" + file: + state: "{{ item }}" + path: "/etc/network/interfaces.d" + with_items: + - absent + - directory - name: ensure interfaces file is updated template: src: "{{ ansible_os_family | lower }}/{{ ansible_hostname }}.interface.j2" @@ -122,7 +127,8 @@ poll: 0 when: ansible_os_family | lower == "redhat" -- local_action: +- name: Wait for host to come back to life + local_action: module: wait_for host: "{{ ansible_host }}" delay: 15 diff --git a/xci/playbooks/roles/bootstrap-host/tasks/time.yml b/xci/playbooks/roles/bootstrap-host/tasks/time.yml index 4b3bf95a..9eca769d 100644 --- a/xci/playbooks/roles/bootstrap-host/tasks/time.yml +++ b/xci/playbooks/roles/bootstrap-host/tasks/time.yml @@ -10,13 +10,16 @@ - name: install chrony package: name: "chrony" - state: latest + state: present - name: restart chrony service: name: "{{ (ansible_pkg_mgr == 'apt') | ternary('chrony', 'chronyd') }}" state: restarted - name: synchronize time shell: "chronyc -a 'burst 4/4' && chronyc -a makestep" + args: + executable: /bin/bash + changed_when: True register: chrony_got_time until: chrony_got_time.rc == 0 retries: 5 diff --git a/xci/playbooks/roles/configure-nfs/tasks/main.yml b/xci/playbooks/roles/configure-nfs/tasks/main.yml index 25e81496..3b349ad6 100644 --- a/xci/playbooks/roles/configure-nfs/tasks/main.yml +++ b/xci/playbooks/roles/configure-nfs/tasks/main.yml @@ -47,7 +47,7 @@ - name: Install the NFS server package package: name: "{{ nfs_server_package }}" - state: latest + state: present - name: restart NFS service service: diff --git a/xci/playbooks/roles/prepare-functest/tasks/main.yml b/xci/playbooks/roles/prepare-functest/tasks/main.yml index 2797ce43..ad578bfd 100644 --- a/xci/playbooks/roles/prepare-functest/tasks/main.yml +++ b/xci/playbooks/roles/prepare-functest/tasks/main.yml @@ -30,9 +30,11 @@ shell: "ip a | grep {{ gateway_ip }}" register: gateway_ip_result ignore_errors: True + changed_when: False - name: add public network gateway command: "ip addr add {{ gateway_ip_mask }} brd {{ broadcast_ip }} dev {{ gateway_interface }}" + changed_when: False when: gateway_ip_result|failed - name: prepare environment file for functest |