Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions roles/configuration/switches_config/tasks/junos_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

# Workaround since Ansible modules lock the database similar to `configure exclusive`
- name: "Random Duraion Pause"
ansible.builtin.pause:
pause:
seconds: "{{ 90 | random(step=6) }}"

- name: "Check If Junos Database Is Open"
ansible.builtin.junos_config:
lines:
- set system license keys
raw: echo "show configuration" | ssh -o StrictHostKeyChecking=no {{ ansible_host }} cli
register: junos_config_db_check
retries: "{{ task_retries }}"
delay: "{{ task_retry_delay }}"
# Not filtering specific database issue or taking into account other errors
until: (junos_config_db_check['msg'] is not defined)
failed_when: false
changed_when: false
until: junos_config_db_check.rc == 0
delegate_to: localhost

- name: Junos configuration block
block:
Expand Down Expand Up @@ -158,5 +158,5 @@
rollback: 1

- name: Fail Play
ansible.builtin.fail:
fail:
msg: "Configuration was rollbacked, failing play."