Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#191 from openstack-k8s-ope…
Browse files Browse the repository at this point in the history
…rators/global-install-yamls-out

Make OUT variable of install_yamls a global default
  • Loading branch information
openshift-merge-robot authored May 24, 2023
2 parents 1deb2dd + 369a2db commit 0bc790d
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 29 deletions.
1 change: 0 additions & 1 deletion ci_framework/roles/edpm_deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
- name: Set EDPM related vars
ansible.builtin.set_fact:
cifmw_edpm_deploy_env: |
OUT: "{{ cifmw_edpm_deploy_manifests_dir }}"
PATH: "{{ cifmw_path }}"
cacheable: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- name: Converge
hosts: all
vars:
cifmw_path: "{{ ansible_user_dir }}/.crc/bin:{{ ansible_user_dir }}/.crc/bin/oc:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}"
cifmw_use_crc: true
cifmw_operator_build_meta_name: openstack
cifmw_edpm_prepare_dry_run: true
Expand Down
25 changes: 13 additions & 12 deletions ci_framework/roles/edpm_prepare/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
- name: Prepare storage in CRC
vars:
make_crc_storage_dryrun: "{{ cifmw_edpm_prepare_dry_run }}"
when:
- cifmw_use_crc is defined
- cifmw_use_crc | bool
- not cifmw_edpm_prepare_skip_crc_storage_creation | bool
ansible.builtin.include_role:
name: 'install_yamls_makes'
tasks_from: 'make_crc_storage'

- name: Set install_yamls Makefile environment variables
vars:
operators_build_output: "{{ (cifmw_operator_build_output | default({'operators':{}})).operators }}"
ansible.builtin.set_fact:
cifmw_edpm_prepare_common_env:
OUT: "{{ cifmw_edpm_prepare_manifests_dir }}"
PATH: "{{ cifmw_path }}"
cifmw_edpm_prepare_make_openstack_env: |
{% if cifmw_operator_build_meta_name is defined and cifmw_operator_build_meta_name in operators_build_output %}
OPENSTACK_IMG: {{ operators_build_output[cifmw_operator_build_meta_name].image_catalog }}
Expand All @@ -27,6 +16,18 @@
{% endif %}
cifmw_edpm_prepare_operators_build_output: "{{ operators_build_output }}"

- name: Prepare storage in CRC
vars:
make_crc_storage_env: "{{ cifmw_edpm_prepare_common_env }}"
make_crc_storage_dryrun: "{{ cifmw_edpm_prepare_dry_run }}"
when:
- cifmw_use_crc is defined
- cifmw_use_crc | bool
- not cifmw_edpm_prepare_skip_crc_storage_creation | bool
ansible.builtin.include_role:
name: 'install_yamls_makes'
tasks_from: 'make_crc_storage'

- name: Get internal OpenShift registry route
ansible.builtin.command:
cmd: "oc get route default-route -n openshift-image-registry -o jsonpath='{.spec.host}'"
Expand Down
4 changes: 3 additions & 1 deletion ci_framework/roles/install_yamls/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
# All variables intended for modification should be placed in this file.
# All variables within this role should have a prefix of "cifmw_install_yamls"
cifmw_install_yamls_envfile: "install_yamls.sh"
cifmw_install_yamls_out_dir: "{{ cifmw_basedir | default(ansible_user_dir ~ '/ci-framework') }}/artifacts"
cifmw_install_yamls_out_dir_basedir: "{{ cifmw_basedir | default(ansible_user_dir ~ '/ci-framework') }}"
cifmw_install_yamls_out_dir: "{{ cifmw_install_yamls_out_dir_basedir }}/artifacts"
cifmw_install_yamls_manifests_dir: "{{ cifmw_manifests | default(cifmw_install_yamls_out_dir_basedir ~ '/artifacts/manifests') }}"
# A list of Install_yamls makefile vars that needs to be exported
# cifmw_install_yamls_vars:
# MICROSHIFT: 1
Expand Down
14 changes: 8 additions & 6 deletions ci_framework/roles/install_yamls/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,11 @@
cifmw_install_yamls_vars.keys() |
map('upper') |
zip(cifmw_install_yamls_vars.values()) |
items2dict(key_name=0, value_name=1)
items2dict(key_name=0, value_name=1) |
combine({'OUT': cifmw_install_yamls_manifests_dir})
}}
cacheable: true

- name: Show the env structure
ansible.builtin.debug:
var: edpm_env

- name: Ensure user cifmw_install_yamls_vars contains existing Makefile variables
ansible.builtin.assert:
that: >-
Expand All @@ -77,14 +74,19 @@
when:
- cifmw_install_yamls_vars is not defined
ansible.builtin.set_fact:
edpm_env: {}
edpm_env:
OUT: "{{ cifmw_install_yamls_manifests_dir }}"
cacheable: true

- name: Set install_yamls default values
ansible.builtin.set_fact:
cifmw_install_yamls_defaults: "{{ get_makefiles_env_output.makefiles_values | combine(edpm_env) }}"
cacheable: true

- name: Show the env structure
ansible.builtin.debug:
var: edpm_env

- name: "Generate make targets"
register: cifmw_generate_makes
generate_make_tasks:
Expand Down
2 changes: 1 addition & 1 deletion scenarios/centos-9/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ post_ctlplane_deploy:
type: playbook
source: rabbitmq_tuning.yml

edpm_env:
cifmw_install_yamls_vars:
BMO_SETUP: false

# The actual ceph_make task understands "make_ceph_environment".
Expand Down
5 changes: 1 addition & 4 deletions scenarios/centos-9/edpm_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ cifmw_install_yamls_vars:
OUTPUT_DIR: "{{ cifmw_basedir }}/artifacts/edpm_compute" # used by gen-ansibleee-ssh-key.sh
OUTPUT_BASEDIR: "{{ cifmw_basedir }}/artifacts/edpm_compute" # used by gen-edpm-compute-node.sh
SSH_KEY: "{{ cifmw_basedir }}/artifacts/edpm_compute/ansibleee-ssh-key-id_rsa"
STORAGE_CLASS: crc-csi-hostpath-provisioner

# edpm_deploy role vars
cifmw_edpm_deploy_run_validation: true
# edpm_prepare role vars
cifmw_edpm_prepare_skip_crc_storage_creation: true
cifmw_edpm_prepare_skip_openstack_operator: true
cifmw_edpm_prepare_make_openstack_deploy_env:
STORAGE_CLASS: crc-csi-hostpath-provisioner

cifmw_operator_build_meta_name: "openstack-operator"
edpm_env:
STORAGE_CLASS: crc-csi-hostpath-provisioner

# edpm_deploy role vars
cifmw_edpm_deploy_manifests_dir: "{{ cifmw_installyamls_repos }}/out"
Expand Down
3 changes: 1 addition & 2 deletions scenarios/centos-9/kuttl.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
edpm_env:
OUT: "{{ cifmw_installyamls_repos }}/out"
cifmw_install_yamls_vars:
STORAGE_CLASS: crc-csi-hostpath-provisioner
5 changes: 3 additions & 2 deletions scenarios/centos-9/local-env.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/install_yamls"
cifmw_install_yamls_vars:
BMO_SETUP: false

cifmw_use_libvirt: true
cifmw_use_crc: true
cifmw_operator_build_push_registry: "default-route-openshift-image-registry.apps-crc.testing"
Expand All @@ -15,5 +18,3 @@ pre_infra:
inventory: "{{ cifmw_installyamls_repos }}/devsetup/hosts"
type: playbook
source: "{{ cifmw_installyamls_repos }}/devsetup/download_tools.yaml"
edpm_env:
BMO_SETUP: false

0 comments on commit 0bc790d

Please sign in to comment.