Skip to content

Commit

Permalink
[reproducer] Call switches config if available
Browse files Browse the repository at this point in the history
  • Loading branch information
pablintino committed Aug 5, 2024
1 parent a382a3c commit 8aa3494
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
25 changes: 25 additions & 0 deletions playbooks/switches_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- name: Switches configuration requirements
hosts: "{{ cifmw_target_host | default('localhost') }}"
gather_facts: false
tasks:
# end_play will end this current playbook and go the the next
# imported play.
- name: Early stop ceph related work
when:
- not cifmw_configure_switches | default(true)
ansible.builtin.meta: end_play

- name: Install required packages
delegate_to: localhost
ansible.builtin.pip:
name:
- paramiko
- ncclient
extra_args: --user

- name: Switches configuration
hosts: switches
gather_facts: false
roles:
- switch_config
15 changes: 11 additions & 4 deletions reproducer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---

- name: Reproducer Play
- name: Reproducer prepare play
hosts: "{{ cifmw_target_host | default('localhost') }}"
gather_facts: true
pre_tasks:
Expand Down Expand Up @@ -57,11 +56,19 @@
ansible.builtin.import_role:
name: repo_setup
tasks_from: rhos_release.yml

roles:
- role: ci_setup
- role: reproducer

- name: Prepare switches
vars:
cifmw_configure_switches: "{{ 'switches' in groups }}"
ansible.builtin.import_playbook: playbooks/switches_config.yml

- name: Reproducer run
hosts: "{{ cifmw_target_host | default('localhost') }}"
gather_facts: false
roles:
- role: reproducer
post_tasks:
- name: Allow traffic from OSP VMs to OSP API (needed for shiftstack)
become: true
Expand Down
1 change: 1 addition & 0 deletions roles/ci_setup/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cifmw_ci_setup_packages:
- bash-completion
- make
- tmux
- python3-pip

# openshift client
cifmw_ci_setup_openshift_client_download_uri: "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp"
Expand Down
1 change: 1 addition & 0 deletions roles/ci_setup/vars/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cifmw_ci_setup_packages:
- make
- tar
- tmux
- python3-pip

cifmw_ci_setup_rhel_rhsm_default_repos:
- 'rhel-*-baseos-rpms'
Expand Down
3 changes: 2 additions & 1 deletion roles/switch_config/tasks/junos_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---

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

Expand Down

0 comments on commit 8aa3494

Please sign in to comment.