Skip to content

Commit eb73450

Browse files
committed
[multiple] Consolidate operator_namespace var to group_vars
Move all the definitions and hardcoding of operator_namespace so that it can be easily changed and managed from group_vars. Signed-off-by: Amartya Sinha <amsinha@redhat.com>
1 parent d123a4a commit eb73450

File tree

7 files changed

+10
-19
lines changed

7 files changed

+10
-19
lines changed

group_vars/all.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ cifmw_installyamls_repos_relative: src/github.com/openstack-k8s-operators/instal
1010
cifmw_installyamls_repos: "{{ ansible_user_dir }}/{{ cifmw_installyamls_repos_relative }}"
1111
cifmw_architecture_repo_relative: src/github.com/openstack-k8s-operators/architecture
1212
cifmw_architecture_repo: "{{ ansible_user_dir }}/{{ cifmw_architecture_repo_relative }}"
13+
14+
operator_namespace: "{{ cifmw_install_yamls_defaults['OPERATOR_NAMESPACE'] | default('openstack-operators') }}"

roles/kustomize_deploy/tasks/install_operators.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@
438438
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
439439
api_version: "operator.openstack.org/v1beta1"
440440
kind: OpenStack
441-
namespace: openstack-operators
441+
namespace: "{{ operator_namespace }}"
442442
name: openstack
443443
wait: true
444444
wait_condition:
@@ -462,7 +462,7 @@
462462
kubernetes.core.k8s_info:
463463
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
464464
kind: Deployment
465-
namespace: openstack-operators
465+
namespace: "{{ operator_namespace }}"
466466
label_selectors:
467467
- "{{ item }}"
468468
wait: true

roles/kustomize_deploy/tasks/install_plan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
context: "{{ cifmw_openshift_context | default(omit) }}"
2525
api_version: operators.coreos.com/v1alpha1
2626
kind: InstallPlan
27-
namespace: openstack-operators
27+
namespace: "{{ operator_namespace }}"
2828
register: _cifmw_kustomize_deploy_install_plans
2929
until: >
3030
_cifmw_kustomize_deploy_install_plans.resources |
@@ -50,7 +50,7 @@
5050
api_key: "{{ cifmw_openshift_token | default(omit) }}"
5151
context: "{{ cifmw_openshift_context | default(omit) }}"
5252
state: present
53-
namespace: openstack-operators
53+
namespace: "{{ operator_namespace }}"
5454
definition:
5555
apiVersion: operators.coreos.com/v1alpha1
5656
kind: InstallPlan
@@ -70,7 +70,7 @@
7070
context: "{{ cifmw_openshift_context | default(omit) }}"
7171
api_version: operators.coreos.com/v1alpha1
7272
kind: InstallPlan
73-
namespace: openstack-operators
73+
namespace: "{{ operator_namespace }}"
7474
name: "{{ _cifmw_kustomize_deploy_installplan_name }}"
7575
register: _cifmw_kustomize_deploy_installplan
7676
until:

roles/os_must_gather/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cifmw_os_must_gather_repo_path: "{{ ansible_user_dir }}/src/github.com/openstack
2626
cifmw_os_must_gather_timeout: "30m"
2727
cifmw_os_must_gather_additional_namespaces: "kuttl,openshift-storage,openshift-marketplace,openshift-operators,sushy-emulator,tobiko"
2828
cifmw_os_must_gather_namespaces:
29-
- openstack-operators
29+
- "{{ operator_namespace }}"
3030
- openstack
3131
- baremetal-operator-system
3232
- openshift-machine-api

roles/run_hook/tasks/playbook.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
{%- endif -%}
1515
_bdir: >-
1616
{{ cifmw_basedir | default(ansible_user_dir ~ '/ci-framework-data') }}
17-
_operator_namespace: >-
18-
{{
19-
cifmw_install_yamls_defaults['OPERATOR_NAMESPACE'] |
20-
default('openstack-operators')
21-
}}
2217
_namespace: >-
2318
{{
2419
cifmw_install_yamls_defaults['NAMESPACE'] |
@@ -31,7 +26,6 @@
3126
log_path: >-
3227
{{ _bdir }}/logs/{{ step }}_{{ _hook_name }}.log
3328
extra_vars: >-
34-
-e operator_namespace={{ _operator_namespace }}
3529
-e namespace={{ _namespace}}
3630
{%- if hook.extra_vars is defined and hook.extra_vars|length > 0 -%}
3731
{% for key,value in hook.extra_vars.items() -%}

roles/set_openstack_containers/tasks/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@
3737
- name: Set common facts for the role
3838
ansible.builtin.set_fact:
3939
operator_name: "{{ cifmw_set_openstack_containers_operator_name }}"
40-
operator_namespace: >-
41-
{{
42-
cifmw_install_yamls_defaults['OPERATOR_NAMESPACE'] |
43-
default(cifmw_set_openstack_containers_operators_namespace)
44-
}}
4540
cifmw_set_openstack_containers_common_env: >-
4641
{{
4742
( cifmw_install_yamls_environment |

roles/update/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
kind: OpenStack
7575
metadata:
7676
name: openstack
77-
namespace: openstack-operators
77+
namespace: "{{ operator_namespace }}"
7878

7979
- name: Set update step to Wait for successful deployment of the openstack operator
8080
ansible.builtin.command:
@@ -89,7 +89,7 @@
8989
context: "{{ cifmw_openshift_context | default(omit) }}"
9090
api_version: operator.openstack.org/v1beta1
9191
kind: OpenStack
92-
namespace: openstack-operators
92+
namespace: "{{ operator_namespace }}"
9393
register: _cifmw_update_openstack_info
9494
until: >
9595
_cifmw_update_openstack_info.resources[0].status.conditions is defined

0 commit comments

Comments
 (0)