Skip to content

Commit c2a3fa9

Browse files
jfilipczpabrahamssonoybed
authored
Parametrize AZ list for ocp4-cluster inventories (#105)
* Add support for machinesets custom AZs, with default pointing to zone A * fixed variable name * Typo fix * Update handling of default AZ list * Some additional updates * Update translate-engagement-data/site.yml Co-authored-by: Petter Abrahamsson <[email protected]> * Aligned the automation to work with vars passed by LodeStar * Typo fix * modified the implementation to set single AZ as default * Updating task description Updating task description Co-authored-by: Petter Abrahamsson <[email protected]> Co-authored-by: Øystein Bedin <[email protected]>
1 parent 2f52f44 commit c2a3fa9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

translate-engagement-data/site.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
when:
1414
- (governor_type is undefined or (governor_type | trim) == "") or (governor_spec is undefined or (governor_spec | trim) == "")
1515
- block:
16-
- name: Set fact used to check if a hosting environment is needed
16+
- name: Set default values and fact used to check if a hosting environment is needed
1717
set_fact:
1818
ocp_cloud_provider_name: "{{ hosting_environments[0].ocp_cloud_provider_name | default('other') }}"
19+
single_az_zone: "true"
1920
- block:
2021
- name: Read credentials
2122
include_vars:
@@ -27,6 +28,12 @@
2728
file:
2829
path: "{{ directory }}/ocp-init"
2930
state: directory
31+
- name: Check what AZ scheme is to be used
32+
set_fact:
33+
single_az_zone: "false"
34+
when:
35+
- hosting_environments[0].ocp_cloud_provider_availability_zone is defined
36+
- hosting_environments[0].ocp_cloud_provider_availability_zone|trim|lower != "one"
3037
- name: Create Resource Claim
3138
vars:
3239
claim_content:
@@ -41,6 +48,8 @@
4148
ocp_ldap_sa_user: "{{ ocp_ldap_sa_username }}"
4249
ocp_ldap_sa_password: "{{ ocp_ldap_sa_password }}"
4350
ocp_subdomain: "{{ hosting_environments[0].ocp_sub_domain }}"
51+
agnosticd_aws_capacity_reservation_enable: "{{ single_az_zone }}"
52+
agnosticd_aws_capacity_reservation_single_zone: "{{ single_az_zone }}"
4453
copy:
4554
content: "{{ lookup('template', inventory_dir + '/../files/templates/resourceclaim.yaml.j2') }}"
4655
dest: "{{ directory }}/ocp-init/cluster-init.yaml"
@@ -49,4 +58,3 @@
4958
when:
5059
- hosting_environments is defined
5160
- hosting_environments|length > 0
52-

0 commit comments

Comments
 (0)