Skip to content

Commit

Permalink
Merge pull request #264 from Sandeepyadav93/add-option-to-pass-availa…
Browse files Browse the repository at this point in the history
…bility-policy

Add support for control plane availability policy
  • Loading branch information
tonyskapunk authored Apr 30, 2024
2 parents 54667eb + 88f021a commit e14d2c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/acm_hypershift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ At this time the role supports creating the OpenShift required endpoints under t
| ah_hcp_cli_path | | No | Path to the hcp CLI, if `ah_download_cli` the role will get the binary from the Management Cluster
| ah_ssh_key | `sshKey` from Management cluster | No | SSH key to be added to the `authorized_keys` file in NodePool's instances
| ah_disconnected | False | No | Defines if the management cluster is in a disconnected (air-gapped) environment
| ah_control_plane_availability_policy | HighlyAvailable | No | ControllerAvailabilityPolicy specifies the availability policy applied to critical control plane components. Options: HighlyAvailable, SingleReplica |

## Disconnected control planes

Expand Down
3 changes: 3 additions & 0 deletions roles/acm_hypershift/tasks/create-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
{%- if ah_ca_bundle_file is defined %} --additional-trust-bundle "{{ ah_ca_bundle_file }}"{%- endif %}
{%- if ah_hc_annotations | length >0 %} --annotations {{ ah_hc_annotations }}{%- endif %}
{%- if ah_ssh_key | length >0 %} --ssh-key {{ ah_ssh_key }}{%- endif %}
{% if ah_control_plane_availability_policy is defined %}
--control-plane-availability-policy="{{ ah_control_plane_availability_policy }}"
{% endif %}
notify: Remove working directory
changed_when: false

Expand Down
7 changes: 7 additions & 0 deletions roles/acm_hypershift/tasks/validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,11 @@
kind: StorageClass
register: ah_sc
failed_when: not 'true' in query_results

- name: "Check for valid control plane availability policy"
ansible.builtin.fail:
msg: "Control plane availability policy '{{ ah_control_plane_availability_policy }}' is not supported"
when:
- ah_control_plane_availability_policy is defined
- ah_control_plane_availability_policy not in ah_control_plane_availability_policies
...
4 changes: 4 additions & 0 deletions roles/acm_hypershift/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
ah_cluster_types:
- kubevirt
- agent

ah_control_plane_availability_policies:
- HighlyAvailable
- SingleReplica
...

0 comments on commit e14d2c6

Please sign in to comment.