Skip to content

Commit

Permalink
Mitigate impact of failing block+recover on ansible_play_hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeygorbunov authored and sugetha24 committed Oct 9, 2024
1 parent 8e9f806 commit f556e9e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
that:
# Change control
- cv_deploy_results.change_control.requested_state == "pending approval"
- cv_deploy_results.change_control.requested_state == cv_deploy_results.change_control.state

- name: Cleanup orphan CC
run_once: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
- name: Test Provisions with Workspace Pending
import_playbook: workspace_pending.yml

- name: Test Change Control False
import_playbook: cc_false.yml

- name: Test Workspace Force True
import_playbook: workspace_force_true.yml

- name: Test Workspace Force False
import_playbook: workspace_force_false.yml

- name: Test Change Control False
import_playbook: cc_false.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
ansible.builtin.import_role:
name: arista.avd.cv_deploy
vars:
cv_devices: [ avd-ci-core1 ]
cv_devices: [ avd-ci-leaf1, avd-ci-core1 ]
cv_submit_workspace_force: false
rescue:
- name: Check CVP returns
Expand Down Expand Up @@ -85,15 +85,21 @@
retries: 3
delay: 3
ignore_errors: True
when: cv_deploy_results.workspace.id is not none and cv_deploy_results.workspace.id | length > 0

- name: Cleanup
run_once: true
delegate_to: localhost
ansible.builtin.import_role:
name: arista.avd.cv_deploy
vars:
cv_devices: "{{ ansible_play_hosts_all }}"
eos_config_dir: "{{ playbook_dir }}/intended/configs/base_configs"
structured_dir: "{{ playbook_dir }}/intended/structured_configs/base_configs"
cv_submit_workspace: true
cv_submit_workspace_force: true
cv_run_change_control: true

# Clear failed state of failed hosts for next engaged playbook (no impact within running playbook)
- name: Reset ansible_play_hosts for next playbook (no impact within running playbook)
ansible.builtin.meta: clear_host_errors
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
retries: 3
delay: 3
ignore_errors: True
when: cv_deploy_results.workspace.id is not none and cv_deploy_results.workspace.id | length > 0

- name: Cleanup
run_once: true
Expand Down

0 comments on commit f556e9e

Please sign in to comment.