Browse Source

Allow more tasks to be run in check mode

When running Ansible in check mode (aka dry run), some tasks need some
changes, specially around variables and make sure they are actually
defined.

Change-Id: I337aa287f1c88a0e2707b441fc6b19b997d52385
(cherry picked from commit 4eb121a36e)
changes/80/735180/4
Emilien Macchi 1 month ago
parent
commit
0ed634442c
7 changed files with 20 additions and 3 deletions
  1. +3
    -0
      common/deploy-steps-tasks.yaml
  2. +4
    -0
      deployment/cinder/cinder-common-container-puppet.yaml
  3. +2
    -0
      deployment/haproxy/haproxy-pacemaker-puppet.yaml
  4. +2
    -0
      deployment/haproxy/haproxy-public-tls-inject.yaml
  5. +3
    -1
      deployment/neutron/neutron-dhcp-container-puppet.yaml
  6. +3
    -1
      deployment/neutron/neutron-l3-container-puppet.yaml
  7. +3
    -1
      deployment/ovn/ovn-metadata-container-puppet.yaml

+ 3
- 0
common/deploy-steps-tasks.yaml View File

@@ -43,6 +43,9 @@
delay: 3
failed_when:
- (not puppet_host_outputs.finished) or (puppet_host_outputs.rc is defined and puppet_host_outputs.rc not in [0, 2])
when:
- not (ansible_check_mode | bool)
- enable_puppet|bool
tags:
- host_config



+ 4
- 0
deployment/cinder/cinder-common-container-puppet.yaml View File

@@ -166,6 +166,8 @@ outputs:
vg: "cinder-volumes"
pvs: "{{ _loopback_device.stdout }}"
state: present
when:
- not (ansible_check_mode | bool)
- name: cinder create service to run losetup for LVM on startup
copy:
dest: /etc/systemd/system/cinder-lvm-losetup.service
@@ -186,6 +188,8 @@ outputs:

[Install]
WantedBy=local-fs-pre.target
when:
- not (ansible_check_mode | bool)
- name: cinder enable the LVM losetup service
systemd:
name: cinder-lvm-losetup


+ 2
- 0
deployment/haproxy/haproxy-pacemaker-puppet.yaml View File

@@ -373,6 +373,8 @@ outputs:
- name: set is_haproxy_bootstrap_node fact
tags: common
set_fact: is_haproxy_bootstrap_node={{haproxy_short_bootstrap_node_name|lower == ansible_hostname|lower}}
when:
- haproxy_short_bootstrap_node_name|default(false)
- name: Mount TLS cert if needed
when:
- step|int == 1


+ 2
- 0
deployment/haproxy/haproxy-public-tls-inject.yaml View File

@@ -86,6 +86,8 @@ outputs:

- name: set is_haproxy_bootstrap_node fact
set_fact: is_haproxy_bootstrap_node={{haproxy_short_bootstrap_node_name | lower == ansible_hostname | lower}}
when:
- haproxy_short_bootstrap_node_name|default(false)

- name: get haproxy status
register: haproxy_state


+ 3
- 1
deployment/neutron/neutron-dhcp-container-puppet.yaml View File

@@ -428,7 +428,9 @@ outputs:
- - name: remove temp namespace
command: ip netns delete ns_temp
failed_when: false
when: ipnetns_add_result.rc == 0
when:
- ipnetns_add_result.rc is defined
- ipnetns_add_result.rc == 0
- - name: create /var/lib/neutron
file:
path: /var/lib/neutron


+ 3
- 1
deployment/neutron/neutron-l3-container-puppet.yaml View File

@@ -383,7 +383,9 @@ outputs:
- - name: remove temp namespace
command: ip netns delete ns_temp
failed_when: false
when: ipnetns_add_result.rc == 0
when:
- ipnetns_add_result.rc is defined
- ipnetns_add_result.rc == 0
- - name: create /var/lib/neutron
file:
path: /var/lib/neutron


+ 3
- 1
deployment/ovn/ovn-metadata-container-puppet.yaml View File

@@ -374,7 +374,9 @@ outputs:
- - name: remove temp namespace
command: ip netns delete ns_temp
failed_when: false
when: ipnetns_add_result.rc == 0
when:
- ipnetns_add_result.rc is defined
- ipnetns_add_result.rc == 0
- - name: create /var/lib/neutron
file:
path: /var/lib/neutron


Loading…
Cancel
Save