Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion roles/reproducer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ None

## Parameters

* `cifmw_reproducer_user`: (String) User used for reproducer role. Defaults to `zuul`
* `cifmw_reproducer_basedir`: (String) Base directory. Defaults to `cifmw_basedir`, which defaults to `~/ci-framework-data`.
* `cifmw_reproducer_controller_user`: (String) User on controller-0. Defaults to `ansible_ssh_user` from controller-0's `hostvars` if available, otherwise defaults to `zuul`.
* `cifmw_reproducer_controller_user_dir`: (String) Controller-0 user's home dir. Defaults to `/home/{{ cifmw_reproducer_controller_user }}`
* `cifmw_reproducer_controller_basedir`: (String) Path to the `ci-framework-data` dir on controller-0. Defaults to `"{{ cifmw_reproducer_controller_user_dir }}/ci-framework-data"`
* `cifmw_reproducer_compute_repos`: (List[mapping]) List of yum repository that must be deployed on the compute nodes during their creation. Defaults to `[]`.
* `cifmw_reproducer_compute_set_repositories`: (Bool) Deploy repositories (rhos-release) on Compute nodes. Defaults to `true`.
* `cifmw_reproducer_play_extravars`: (List[string]) List of extra-vars you want to pass down to the EDPM deployment playbooks. Defaults to `[]`.
Expand Down
11 changes: 3 additions & 8 deletions roles/reproducer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

# All variables intended for modification should be placed in this file.
# All variables within this role should have a prefix of "cifmw_reproducer"
cifmw_reproducer_user: "{{ ansible_user | default('zuul') }}"
cifmw_reproducer_controller_user: "{{ hostvars['controller-0']['ansible_ssh_user'] | default('zuul') }}"
cifmw_reproducer_controller_user_dir: "/home/{{ cifmw_reproducer_controller_user }}"
cifmw_reproducer_controller_basedir: "{{ cifmw_reproducer_controller_user_dir }}/ci-framework-data"
cifmw_reproducer_basedir: "{{ cifmw_basedir | default( ansible_user_dir ~ '/ci-framework-data') }}"
cifmw_reproducer_src_dir: "{{ cifmw_ci_src_dir | default( ansible_user_dir ~ '/src') }}"
cifmw_reproducer_kubecfg: "{{ cifmw_libvirt_manager_configuration.vms.crc.image_local_dir }}/kubeconfig"
Expand All @@ -40,13 +42,6 @@ cifmw_reproducer_supported_hypervisor_os:
minimum_version: 9
RedHat:
minimum_version: 9.3
cifmw_reproducer_controller_basedir: >-
{{
(
'/home/zuul',
'ci-framework-data',
) | path_join
}}

# Allow to disable validations - user toggle this at their
# own risks!
Expand Down
24 changes: 12 additions & 12 deletions roles/reproducer/tasks/ci_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@
block:
- name: Ensure directory exists
ansible.builtin.file:
path: "/home/zuul/{{ job_id }}-params"
path: "{{ cifmw_reproducer_controller_user_dir }}/{{ job_id }}-params"
mode: "0755"
state: directory
owner: "{{ cifmw_reproducer_user }}"
group: "{{ cifmw_reproducer_user }}"
owner: "{{ cifmw_reproducer_controller_user }}"
group: "{{ cifmw_reproducer_controller_user }}"

- name: Copy environment files to controller node
tags:
- bootstrap
ansible.builtin.copy:
src: "{{ _reproducer_basedir }}/parameters/"
dest: "/home/zuul/{{ job_id }}-params"
dest: "{{ cifmw_reproducer_controller_user_dir }}/{{ job_id }}-params"
mode: "0644"

- name: Inject reproducer dedicated parameter file
tags:
- bootstrap
ansible.builtin.template:
src: "reproducer_params.yml.j2"
dest: "/home/zuul/{{ job_id }}-params/reproducer_params.yml"
dest: "{{ cifmw_reproducer_controller_user_dir }}/{{ job_id }}-params/reproducer_params.yml"
mode: "0644"

- name: Generate CI job playbook
Expand Down Expand Up @@ -70,7 +70,7 @@
tags:
- bootstrap
ansible.builtin.copy:
dest: /home/zuul/zuul-network-data.yml
dest: "{{ cifmw_reproducer_controller_user_dir }}/zuul-network-data.yml"
content: "{{ {'job_network': ci_job_networking} | to_nice_yaml}}"
mode: "0644"

Expand All @@ -96,7 +96,7 @@
items2dict
}}
ansible.builtin.copy:
dest: "/home/zuul/ci-framework-data/artifacts/parameters/zuul-params.yml"
dest: "{{ cifmw_reproducer_controller_basedir }}/artifacts/parameters/zuul-params.yml"
content: "{{ {'zuul': zuul_params_filtered} | to_nice_yaml }}"
mode: "0644"

Expand All @@ -105,14 +105,14 @@
- always
ansible.builtin.include_tasks: rotate_log.yml
loop:
- "/home/zuul/ansible.log"
- "/home/zuul/ansible-pre-ci.log"
- "/home/zuul/ansible-{{ job_id }}.log"
- "/home/zuul/ansible-content-provider-bootstrap.log"
- "{{ cifmw_reproducer_controller_user_dir }}/ansible.log"
- "{{ cifmw_reproducer_controller_user_dir }}/ansible-pre-ci.log"
- "{{ cifmw_reproducer_controller_user_dir }}/ansible-{{ job_id }}.log"
- "{{ cifmw_reproducer_controller_user_dir }}/ansible-content-provider-bootstrap.log"

- name: Generate and run scripts
vars:
_home: "/home/zuul"
_home: "{{ cifmw_reproducer_controller_user_dir }}"
run_directory: "{{ _cifmw_reproducer_framework_location }}"
block:
- name: Generate pre-ci-play script
Expand Down
8 changes: 4 additions & 4 deletions roles/reproducer/tasks/configure_architecture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
vars:
run_directory: "{{ _cifmw_reproducer_framework_location }}"
exports:
ANSIBLE_LOG_PATH: "{{ ansible_user_dir }}/ci-framework-data/logs/ansible-deploy-architecture.log"
ANSIBLE_LOG_PATH: "{{ cifmw_reproducer_controller_basedir }}/logs/ansible-deploy-architecture.log"
default_extravars:
- "@~/ci-framework-data/parameters/reproducer-variables.yml"
- "@~/ci-framework-data/parameters/openshift-environment.yml"
extravars: "{{ cifmw_reproducer_play_extravars }}"
playbook: "deploy-edpm.yml"
ansible.builtin.template:
dest: "/home/zuul/deploy-architecture.sh"
dest: "{{ cifmw_reproducer_controller_user_dir }}/deploy-architecture.sh"
src: "script.sh.j2"
mode: "0755"
owner: "zuul"
group: "zuul"
owner: "{{ cifmw_reproducer_controller_user }}"
group: "{{ cifmw_reproducer_controller_user }}"

- name: Rotate some logs
tags:
Expand Down
6 changes: 3 additions & 3 deletions roles/reproducer/tasks/configure_cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
extravars: "{{ cifmw_reproducer_play_extravars }}"
playbook: "clean_openstack_deployment.yaml"
ansible.builtin.template:
dest: "/home/zuul/cleanup-architecture.sh"
dest: "{{ cifmw_reproducer_controller_user_dir }}/cleanup-architecture.sh"
src: "script.sh.j2"
mode: "0755"
owner: "zuul"
group: "zuul"
owner: "{{ cifmw_reproducer_controller_user }}"
group: "{{ cifmw_reproducer_controller_user }}"

- name: Rotate some logs
tags:
Expand Down
Loading
Loading