summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/bootstrap-host
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-03-28 21:04:22 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-28 21:04:22 +0000
commit14228ae572f272b03b535271414772f2206208c8 (patch)
tree2b627ac69373bc29aa9e20d61ed31ced7a0c72fb /xci/playbooks/roles/bootstrap-host
parent311efd295d83590d766b8972ebe1e18df1b74bc2 (diff)
parent9e1d3d6e62abf5d0da26a296bcd235f37a54d9c6 (diff)
Merge "xci: playbooks: Fixes various ansible-lint warnings"
Diffstat (limited to 'xci/playbooks/roles/bootstrap-host')
-rw-r--r--xci/playbooks/roles/bootstrap-host/tasks/network.yml10
-rw-r--r--xci/playbooks/roles/bootstrap-host/tasks/time.yml5
2 files changed, 12 insertions, 3 deletions
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