Skip to content

Commit 0440589

Browse files
wasnioyjian118
authored andcommitted
Fail playbook execution if config failed to apply
This commit updates the Ansible playbook to fail if the deployment configuration failed to apply. Additionally, it resolves a playbook replay issue by attempting to unlock only when the host is in a locked state. Test Plan: - PASS: deploy a SX subcloud - PASS: replay the deployment configuration Failure Path: - PASS: playbook fails with invalid config file Signed-off-by: Wallysson Silva <wallysson.silva@windriver.com>
1 parent 6c2147b commit 0440589

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

docs/playbooks/roles/common/tasks/apply-config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,11 @@
1818
retries: 5
1919
delay: 10
2020
until: apply_deploy_config.rc == 0
21-
ignore_errors: true
21+
failed_when: false
22+
23+
- name: Fail if deploy configuration failed to apply
24+
fail:
25+
msg: >
26+
stderr is: {{ apply_deploy_config.stderr }}
27+
stdout is: {{ apply_deploy_config.stdout }}
28+
when: apply_deploy_config.rc != 0

docs/playbooks/roles/initial-config/tasks/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
block:
2828
- include_tasks:
2929
file: lock-unlock.yaml
30+
when: current_administrative_state == "locked"
3031

3132
- include_tasks:
3233
file: monitor-deployment.yaml

docs/playbooks/wind-river-cloud-platform-deployment-manager.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
- include_role:
1313
name: initial-config
14-
when: not initial_configuration_done
14+
when:
15+
- not subcloud_enrollment
16+
- not scope_principal
1517

1618
- include_role:
1719
name: reconfig

0 commit comments

Comments
 (0)