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.

Note: the backport is not clean, and we also fixed the tasks when paunch
is enabled, which wasn't the case anymore in the initial patch on
master. Also the tasks which check healthcheck aren't needed in check
mdoe, they take too much time for nothing.

Change-Id: I337aa287f1c88a0e2707b441fc6b19b997d52385
(cherry picked from commit a199da6a08)
(cherry picked from commit ebbad0d542)
changes/84/735184/5
Emilien Macchi 1 month ago
parent
commit
ab3548f23a
17 changed files with 34 additions and 3 deletions
  1. +3
    -0
      common/deploy-steps-tasks.yaml
  2. +2
    -0
      common/generate-config-tasks.yaml
  3. +4
    -0
      common/host-container-puppet-tasks.yaml
  4. +4
    -0
      deployment/cinder/cinder-common-container-puppet.yaml
  5. +2
    -0
      deployment/haproxy/haproxy-pacemaker-puppet.yaml
  6. +2
    -0
      deployment/haproxy/haproxy-public-tls-inject.yaml
  7. +3
    -1
      deployment/neutron/neutron-dhcp-container-puppet.yaml
  8. +3
    -1
      deployment/neutron/neutron-l3-container-puppet.yaml
  9. +1
    -0
      deployment/nova/nova-api-container-puppet.yaml
  10. +1
    -0
      deployment/nova/nova-compute-container-puppet.yaml
  11. +1
    -0
      deployment/nova/nova-conductor-container-puppet.yaml
  12. +1
    -0
      deployment/nova/nova-libvirt-container-puppet.yaml
  13. +1
    -0
      deployment/nova/nova-metadata-container-puppet.yaml
  14. +1
    -0
      deployment/nova/nova-migration-target-container-puppet.yaml
  15. +1
    -0
      deployment/nova/nova-scheduler-container-puppet.yaml
  16. +1
    -0
      deployment/nova/nova-vnc-proxy-container-puppet.yaml
  17. +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



+ 2
- 0
common/generate-config-tasks.yaml View File

@@ -31,6 +31,8 @@
until: generate_config_outputs.finished
retries: 1200
delay: 3
when:
- not (ansible_check_mode | bool)

- name: "Debug output for task: Run container-puppet tasks (generate config) during step 1"
debug:


+ 4
- 0
common/host-container-puppet-tasks.yaml View File

@@ -31,6 +31,8 @@
PROCESS_COUNT: "{{ docker_puppet_process_count }}"
register: bootstrap_tasks_async_result
no_log: true
when:
- not (ansible_check_mode | bool)

- name: Wait for container-puppet tasks (bootstrap tasks) for step {{ step }} to finish
async_status:
@@ -39,6 +41,8 @@
until: bootstrap_tasks_outputs.finished
retries: 1200
delay: 3
when:
- not (ansible_check_mode | bool)

- name: "Debug output for task: Run container-puppet tasks (bootstrap tasks) for step {{ step }}"
debug:


+ 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

@@ -371,6 +371,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


+ 1
- 0
deployment/nova/nova-api-container-puppet.yaml View File

@@ -506,6 +506,7 @@ outputs:
deploy_steps_tasks:
- name: validate nova api container state
when:
- not (ansible_check_mode | bool)
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 5


+ 1
- 0
deployment/nova/nova-compute-container-puppet.yaml View File

@@ -1048,6 +1048,7 @@ outputs:
deploy_steps_tasks:
- name: validate nova compute container state
when:
- not (ansible_check_mode | bool)
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 6 #FIXME: there is no step6


+ 1
- 0
deployment/nova/nova-conductor-container-puppet.yaml View File

@@ -224,6 +224,7 @@ outputs:
deploy_steps_tasks:
- name: validate nova conductor container state
when:
- not (ansible_check_mode | bool)
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 5


+ 1
- 0
deployment/nova/nova-libvirt-container-puppet.yaml View File

@@ -812,6 +812,7 @@ outputs:
deploy_steps_tasks:
- name: validate nova-libvirt container state
when:
- not (ansible_check_mode | bool)
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 4


+ 1
- 0
deployment/nova/nova-metadata-container-puppet.yaml View File

@@ -240,6 +240,7 @@ outputs:
deploy_steps_tasks:
- name: validate nova metadata container state
when:
- not (ansible_check_mode | bool)
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 5


+ 1
- 0
deployment/nova/nova-migration-target-container-puppet.yaml View File

@@ -168,6 +168,7 @@ outputs:
deploy_steps_tasks:
- name: validate nova migration target container state
when:
- not (ansible_check_mode | bool)
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 5


+ 1
- 0
deployment/nova/nova-scheduler-container-puppet.yaml View File

@@ -218,6 +218,7 @@ outputs:
deploy_steps_tasks:
- name: validate nova scheduler container state
when:
- not (ansible_check_mode | bool)
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 5


+ 1
- 0
deployment/nova/nova-vnc-proxy-container-puppet.yaml View File

@@ -285,6 +285,7 @@ outputs:
deploy_steps_tasks:
- name: validate nova-vnc-proxy container state
when:
- not (ansible_check_mode | bool)
- container_cli == 'podman'
- not container_healthcheck_disabled
- step|int == 5


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

@@ -361,7 +361,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