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
|
- name: Checking docker-py version
|
||||||
command: python -c "import docker; print docker.__version__"
|
command: python -c "import docker; print docker.__version__"
|
||||||
register: result
|
register: result
|
||||||
|
changed_when: false
|
||||||
failed_when: result | failed or
|
failed_when: result | failed or
|
||||||
result.stdout | version_compare(docker_py_version_min, '<')
|
result.stdout | version_compare(docker_py_version_min, '<')
|
||||||
|
|
||||||
- name: Checking Ansible version
|
- name: Checking Ansible version
|
||||||
local_action: command ansible --version
|
local_action: command ansible --version
|
||||||
register: result
|
register: result
|
||||||
|
changed_when: false
|
||||||
failed_when: result.stdout | regex_replace('ansible (\\d+\\.\\d+\\.\\d+)', '\\1') | version_compare(ansible_version_max, '>=')
|
failed_when: result.stdout | regex_replace('ansible (\\d+\\.\\d+\\.\\d+)', '\\1') | version_compare(ansible_version_max, '>=')
|
||||||
|
@ -8,12 +8,14 @@
|
|||||||
- name: Checking Docker version
|
- name: Checking Docker version
|
||||||
command: docker version
|
command: docker version
|
||||||
register: result
|
register: result
|
||||||
|
changed_when: false
|
||||||
failed_when: result | failed
|
failed_when: result | failed
|
||||||
or (result.stdout | from_yaml).Server.Version | regex_replace('(\\d+\\.\\d+\\.\\d+).*', '\\1') | version_compare(docker_version_min, '<')
|
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'
|
- name: Checking if 'MountFlags' in /lib/systemd/system/docker.service is set to 'shared'
|
||||||
command: cat /lib/systemd/system/docker.service
|
command: cat /lib/systemd/system/docker.service
|
||||||
register: result
|
register: result
|
||||||
|
changed_when: false
|
||||||
failed_when: result.stdout.find('MountFlags=shared') == -1
|
failed_when: result.stdout.find('MountFlags=shared') == -1
|
||||||
when:
|
when:
|
||||||
- (inventory_hostname in groups['neutron-dhcp-agent']
|
- (inventory_hostname in groups['neutron-dhcp-agent']
|
||||||
@ -25,6 +27,7 @@
|
|||||||
- name: Checking if '/run' mount flag is set to 'shared'
|
- name: Checking if '/run' mount flag is set to 'shared'
|
||||||
command: awk '$5 == "/run" {print $7}' /proc/self/mountinfo
|
command: awk '$5 == "/run" {print $7}' /proc/self/mountinfo
|
||||||
register: result
|
register: result
|
||||||
|
changed_when: false
|
||||||
failed_when: result.stdout.find('shared') == -1
|
failed_when: result.stdout.find('shared') == -1
|
||||||
when:
|
when:
|
||||||
- (inventory_hostname in groups['neutron-dhcp-agent']
|
- (inventory_hostname in groups['neutron-dhcp-agent']
|
||||||
|
Loading…
Reference in New Issue
Block a user