Skip to content

Commit

Permalink
Feat: migrate external OCI CCM config check from OCI cloud provider
Browse files Browse the repository at this point in the history
Signed-off-by: tico88612 <17496418+tico88612@users.noreply.github.com>
  • Loading branch information
tico88612 committed Oct 13, 2024
1 parent 0ec94d2 commit b58a8ef
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- name: External OCI Cloud Controller Manager | Check OCI credentials
include_tasks: oci-credential-check.yml
tags: external-oci

- name: External OCI Cloud Controller Manager | Get base64 cloud-config
set_fact:
external_oracle_cloud_config_secret: "{{ lookup('template', 'external-oci-cloud-config.j2') | b64encode }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_auth_key"
ansible.builtin.assert:
that:
- not external_oracle_auth_use_instance_principals
- external_oracle_auth_key is not defined or not external_oracle_auth_key
fail_msg: "external_oci_auth_key is missing"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_auth_region"
ansible.builtin.assert:
that:
- not external_oracle_auth_use_instance_principals
- external_oracle_auth_region is not defined or not external_oracle_auth_region
fail_msg: "external_oracle_auth_region is missing"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_auth_tenancy"
ansible.builtin.assert:
that:
- not external_oracle_auth_use_instance_principals
- external_oracle_auth_tenancy is not defined or not external_oracle_auth_tenancy
fail_msg: "external_oracle_auth_tenancy is missing"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_auth_user"
ansible.builtin.assert:
that:
- not external_oracle_auth_use_instance_principals
- external_oracle_auth_user is not defined or not external_oracle_auth_user
fail_msg: "external_oracle_auth_user is missing"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_auth_fingerprint"
ansible.builtin.assert:
that:
- not external_oracle_auth_use_instance_principals
- external_oracle_auth_fingerprint is not defined or not external_oracle_auth_fingerprint
fail_msg: "external_oracle_auth_fingerprint is missing"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_compartment"
ansible.builtin.assert:
that:
- external_oracle_compartment is not defined or not external_oracle_compartment
fail_msg: "external_oracle_compartment is missing. This is the compartment in which the cluster resides"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_vcn"
ansible.builtin.assert:
that:
- external_oracle_vcn is not defined or not external_oracle_vcn
fail_msg: "external_oracle_vcn is missing. This is the Virtual Cloud Network in which the cluster resides"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_load_balancer_subnet1"
ansible.builtin.assert:
that:
- external_oracle_load_balancer_subnet1 is not defined or not external_oracle_load_balancer_subnet1
fail_msg: "external_oracle_load_balancer_subnet1 is missingg. This is the first subnet to which loadbalancers will be added"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_load_balancer_subnet2"
ansible.builtin.assert:
that:
- external_oracle_load_balancer_subnet2 is not defined or not external_oracle_load_balancer_subnet2
fail_msg: "external_oracle_load_balancer_subnet2 is missing. Two subnets are required for load balancer high availability"

- name: "External OCI Cloud Controller Manager | Credentials Check | external_oracle_load_balancer_security_list_management_mode"
ansible.builtin.assert:
that:
- external_oracle_load_balancer_security_list_management_mode is not defined or external_oracle_load_balancer_security_list_management_mode not in ["All", "Frontend", "None"]
fail_msg: "external_oracle_load_balancer_security_list_management_mode is missing, or not defined correctly. Valid options are (All, Frontend, None)."

0 comments on commit b58a8ef

Please sign in to comment.