Fix the prechecks role idempotent
the prechecks role should be idempotent and should changed nothing when running. TrivialFix Change-Id: Ib5063d879e0f5f414d607bd9b6493a7499fc5652
This commit is contained in:
parent
e9b9a84157
commit
d7495b1d39
@ -2,10 +2,12 @@
|
||||
- name: Checking docker-py version
|
||||
command: python -c "import docker; print docker.__version__"
|
||||
register: result
|
||||
changed_when: false
|
||||
failed_when: result | failed or
|
||||
result.stdout | version_compare(docker_py_version_min, '<')
|
||||
|
||||
- name: Checking Ansible version
|
||||
local_action: command ansible --version
|
||||
register: result
|
||||
changed_when: false
|
||||
failed_when: result.stdout | regex_replace('ansible (\\d+\\.\\d+\\.\\d+)', '\\1') | version_compare(ansible_version_max, '>=')
|
||||
|
@ -8,12 +8,14 @@
|
||||
- name: Checking Docker version
|
||||
command: docker version
|
||||
register: result
|
||||
changed_when: false
|
||||
failed_when: result | failed
|
||||
or (result.stdout | from_yaml).Server.Version | regex_replace('(\\d+\\.\\d+\\.\\d+).*', '\\1') | version_compare(docker_version_min, '<')
|
||||
|
||||
- name: Checking if 'MountFlags' in /lib/systemd/system/docker.service is set to 'shared'
|
||||
command: cat /lib/systemd/system/docker.service
|
||||
register: result
|
||||
changed_when: false
|
||||
failed_when: result.stdout.find('MountFlags=shared') == -1
|
||||
when:
|
||||
- (inventory_hostname in groups['neutron-dhcp-agent']
|
||||
@ -25,6 +27,7 @@
|
||||
- name: Checking if '/run' mount flag is set to 'shared'
|
||||
command: awk '$5 == "/run" {print $7}' /proc/self/mountinfo
|
||||
register: result
|
||||
changed_when: false
|
||||
failed_when: result.stdout.find('shared') == -1
|
||||
when:
|
||||
- (inventory_hostname in groups['neutron-dhcp-agent']
|
||||
|
Loading…
Reference in New Issue
Block a user