diff --git a/playbooks/switches_config.yml b/playbooks/switches_config.yml new file mode 100644 index 0000000000..816b144e23 --- /dev/null +++ b/playbooks/switches_config.yml @@ -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 diff --git a/reproducer.yml b/reproducer.yml index 2ca9310f32..a680375020 100644 --- a/reproducer.yml +++ b/reproducer.yml @@ -1,6 +1,5 @@ --- - -- name: Reproducer Play +- name: Reproducer prepare play hosts: "{{ cifmw_target_host | default('localhost') }}" gather_facts: true pre_tasks: @@ -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 diff --git a/roles/ci_setup/vars/main.yml b/roles/ci_setup/vars/main.yml index 3c6c758eb7..b439d587de 100644 --- a/roles/ci_setup/vars/main.yml +++ b/roles/ci_setup/vars/main.yml @@ -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" diff --git a/roles/ci_setup/vars/redhat.yml b/roles/ci_setup/vars/redhat.yml index 077a9950a3..c251d42152 100644 --- a/roles/ci_setup/vars/redhat.yml +++ b/roles/ci_setup/vars/redhat.yml @@ -6,6 +6,7 @@ cifmw_ci_setup_packages: - make - tar - tmux + - python3-pip cifmw_ci_setup_rhel_rhsm_default_repos: - 'rhel-*-baseos-rpms' diff --git a/roles/switch_config/tasks/junos_config.yml b/roles/switch_config/tasks/junos_config.yml index 41a55c8e3d..4c266695ec 100644 --- a/roles/switch_config/tasks/junos_config.yml +++ b/roles/switch_config/tasks/junos_config.yml @@ -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) }}"