Skip to content

Commit

Permalink
Use kubernetes.core to test DCI Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyskapunk committed Jan 7, 2025
1 parent e6df99a commit ac81a4e
Show file tree
Hide file tree
Showing 23 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: ocp
# Always leave patch version as .0
# Patch version is replaced from commit date in UNIX epoch format
# example: 0.3.2147483647
version: 0.24.0
version: 0.25.0

# The path to the Markdown (.md) readme file.
readme: README.md
Expand Down
8 changes: 4 additions & 4 deletions roles/acm_sno/tasks/acm-pull-data.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: "Get current worker's MCP"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
name: worker
Expand All @@ -11,14 +11,14 @@
acm_mc: "{{ worker_mcp.resources[0].spec.configuration.name }}"

- name: "Get current worker's Machine configs"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: machineconfiguration.openshift.io/v1
kind: MachineConfig
name: "{{ acm_mc }}"
register: worker_mc

- name: "Get cluster user-ca cert if exists"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: v1
kind: ConfigMap
name: "user-ca-bundle"
Expand All @@ -33,7 +33,7 @@
user_ca_bundle.resources | length == 1

- name: "Get hub cluster pull_secret details"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: v1
kind: Secret
name: "pull-secret"
Expand Down
36 changes: 18 additions & 18 deletions roles/acm_sno/tasks/create-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- acm_machine_cidr

- name: "Create a managed cluster namespace"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: v1
kind: Namespace
Expand Down Expand Up @@ -46,7 +46,7 @@
{{ acm_user_registry | indent(4) }}
ca-bundle.crt: |
{{ acm_user_ca_bundle | indent(4) }}
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
definition: "{{ cm_def }}"
namespace: multicluster-engine
Expand All @@ -55,7 +55,7 @@
- inherit_mirroring | bool

- name: "Check the AgentServiceConfig instance"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: agent-install.openshift.io/v1beta1
kind: AgentServiceConfig
name: agent
Expand All @@ -81,13 +81,13 @@
osImages: "{{ asg.resources[0].spec.osImages + [os_images] }}"
mirrorRegistryRef:
name: mirror-registry-config-map
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
definition: "{{ as_def }}"
when: (asg.resources | length == 1)

- name: "Wait for assisted-image-service pods to be Running"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: v1
kind: Pod
label_selectors:
Expand All @@ -103,7 +103,7 @@
no_log: true

- name: "Wait for assisted-service to be Running"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: v1
kind: Pod
label_selectors:
Expand All @@ -119,7 +119,7 @@
no_log: true

- name: "Validate the Service config volumes binding"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: v1
kind: PersistentVolumeClaim
namespace: "multicluster-engine"
Expand All @@ -129,7 +129,7 @@
delay: 15

- name: "Set pull secret for Assisted installer and Cluster deployment"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: v1
kind: Secret
Expand All @@ -145,7 +145,7 @@
img_release: "{{ lookup('password', '/dev/null length=15 chars=ascii_lowercase,digits') }}"

- name: "Create the ClusterImageSet"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: hive.openshift.io/v1
kind: ClusterImageSet
Expand All @@ -160,7 +160,7 @@

# Keeping some placeholders related to IPv6 configuration
- name: "Create the Agent cluster install"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
Expand Down Expand Up @@ -190,7 +190,7 @@
sshPublicKey: "{{ acm_ssh_key }}"

- name: "Request the cluster deployment"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: hive.openshift.io/v1
kind: ClusterDeployment
Expand All @@ -217,7 +217,7 @@
name: "pullsecret-{{ acm_cluster_name }}"

- name: "Create KlusterletAddonConfig"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: agent.open-cluster-management.io/v1
kind: KlusterletAddonConfig
Expand All @@ -242,7 +242,7 @@
enabled: false

- name: "Create ManagedCluster"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: cluster.open-cluster-management.io/v1
kind: ManagedCluster
Expand Down Expand Up @@ -293,7 +293,7 @@
- acm_disconnected | bool

- name: "Create the InfraEnv"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: agent-install.openshift.io/v1beta1
kind: InfraEnv
Expand All @@ -320,7 +320,7 @@
ignitionConfigOverride: "{{ ignition_config | default(omit) }}"

- name: "Wait for the boot ISO creation"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: agent-install.openshift.io/v1beta1
kind: InfraEnv
name: "{{ acm_cluster_name }}-infra"
Expand All @@ -333,7 +333,7 @@
delay: 6

- name: "BMC credentials"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: v1
data:
Expand All @@ -346,7 +346,7 @@
type: Opaque

- name: "Create BareMetalHost"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
Expand All @@ -369,7 +369,7 @@
online: true

- name: "Wait for the Host Provisioning"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: metal3.io/v1alpha1
kind: BareMetalHost
name: "{{ acm_cluster_name }}"
Expand Down
24 changes: 12 additions & 12 deletions roles/acm_sno/tasks/delete-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
- acm_cluster_name

- name: "Delete managed cluster"
community.kubernetes.k8s:
kubernetes.core.k8s:
state: absent
api: cluster.open-cluster-management.io/v1
kind: ManagedCluster
name: "{{ acm_cluster_name }}"
namespace: "{{ acm_cluster_name }}"

- name: "Delete cluster deployment"
community.kubernetes.k8s:
kubernetes.core.k8s:
api: hive.openshift.io/v1
state: absent
kind: ClusterDeployment
name: "{{ acm_cluster_name }}"
namespace: "{{ acm_cluster_name }}"

- name: "Disable BMC credentials finalizers"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: v1
kind: Secret
Expand All @@ -35,7 +35,7 @@
ignore_errors: true

- name: "Delete BMC credentials"
community.kubernetes.k8s:
kubernetes.core.k8s:
state: absent
api: v1
kind: Secret
Expand All @@ -44,7 +44,7 @@
ignore_errors: true

- name: "Disable BMH finalizers"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
Expand All @@ -55,15 +55,15 @@
ignore_errors: true

- name: "Delete bare-metal host"
community.kubernetes.k8s:
kubernetes.core.k8s:
state: absent
api: metal3.io/v1alpha1
kind: BareMetalHost
name: "{{ acm_cluster_name }}"
namespace: "{{ acm_cluster_name }}"

- name: "Wait for BMH to be deprovisioned"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: metal3.io/v1alpha1
kind: BareMetalHost
name: "{{ acm_cluster_name }}"
Expand All @@ -76,7 +76,7 @@
delay: 15

- name: "Delete infraEnv"
community.kubernetes.k8s:
kubernetes.core.k8s:
state: absent
api: agent-install.openshift.io/v1beta1
kind: InfraEnv
Expand All @@ -85,30 +85,30 @@
ignore_errors: true

- name: "Delete agent cluster install"
community.kubernetes.k8s:
kubernetes.core.k8s:
state: absent
api: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
name: "{{ acm_cluster_name }}"
namespace: "{{ acm_cluster_name }}"

- name: "Delete klusterlet addon config"
community.kubernetes.k8s:
kubernetes.core.k8s:
state: absent
api: agent.open-cluster-management.io/v1
kind: KlusterletAddonConfig
name: "{{ acm_cluster_name }}"
namespace: "{{ acm_cluster_name }}"

- name: "Delete cluster namespace"
community.kubernetes.k8s:
kubernetes.core.k8s:
state: absent
api: v1
kind: Namespace
name: "{{ acm_cluster_name }}"

- name: "Wait for cluster namespace to be deleted"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: v1
kind: Namespace
name: "{{ acm_cluster_name }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/acm_sno/tasks/get-credentials.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: "Get Kubeconfig secret"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: v1
kind: Secret
name: "{{ acm_cluster_name }}-admin-kubeconfig"
Expand All @@ -9,7 +9,7 @@
no_log: true

- name: "Get kubeadmin credentials"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: v1
kind: Secret
name: "{{ acm_cluster_name }}-admin-password"
Expand Down
2 changes: 1 addition & 1 deletion roles/acm_sno/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ansible.builtin.include_tasks: pre-run.yml

- name: "Check cluster namespace"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: v1
kind: Namespace
name: "{{ acm_cluster_name }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/acm_sno/tasks/monitor-install.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: "Get cluster install status"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: extensions.hive.openshift.io/v1beta1
kind: AgentClusterInstall
name: "{{ acm_cluster_name }}"
Expand Down
8 changes: 4 additions & 4 deletions roles/acm_sno/tasks/pre-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- acm_disconnected | bool

- name: "Check if the ACM CRD is present"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
kind: CustomResourceDefinition
name: multiclusterengines.multicluster.openshift.io
register: acm_crd
Expand All @@ -21,7 +21,7 @@
when: acm_crd.resources | list | count == 0

- name: "Check the AgentServiceConfig instance"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api: agent-install.openshift.io/v1beta1
kind: AgentServiceConfig
name: agent
Expand All @@ -37,14 +37,14 @@
- acm_vm_external_network | bool
block:
- name: "Get provisioning configuration"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: metal3.io/v1alpha1
kind: Provisioning
name: provisioning-configuration
register: provisioning_cr

- name: "Allow to expose virtual media via external network"
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: metal3.io/v1alpha1
kind: Provisioning
Expand Down
2 changes: 1 addition & 1 deletion roles/check_resource/tasks/verify_network_state.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: "Wait until all pods in openshift-ovn-kubernetes namespace are running"
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
kind: Pod
namespace: "openshift-ovn-kubernetes"
register: ovn_pods
Expand Down
2 changes: 1 addition & 1 deletion roles/check_resource/tasks/wait-mcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
seconds: 60

- name: Wait for MCP to be updated
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
register: _cr_mcp_status
Expand Down
Loading

0 comments on commit ac81a4e

Please sign in to comment.