Skip to content

Commit

Permalink
change ansible k8s dep
Browse files Browse the repository at this point in the history
Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed Oct 4, 2023
1 parent 97e7ba7 commit aba64a1
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 48 deletions.
2 changes: 1 addition & 1 deletion operator/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

tasks:
- name: Create Namespace
k8s:
kubernetes.core.k8s:
api_version: v1
kind: Namespace
name: '{{ namespace }}'
Expand Down
2 changes: 1 addition & 1 deletion operator/molecule/default/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
state: absent

- name: Destroy Namespace
k8s:
kubernetes.core.k8s:
api_version: v1
kind: Namespace
name: '{{ namespace }}'
Expand Down
4 changes: 2 additions & 2 deletions operator/molecule/default/kustomize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
changed_when: false

- name: Set resources to {{ state }}
k8s:
kubernetes.core.k8s:
definition: '{{ item }}'
state: '{{ state }}'
wait: no
loop: '{{ resources.stdout | from_yaml_all | list }}'

- name: Wait for resources to get to {{ state }}
k8s:
kubernetes.core.k8s:
definition: '{{ item }}'
state: '{{ state }}'
wait: yes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Create the forklift.konveyor.io/v1beta1.ForkliftController
k8s:
kubernetes.core.k8s:
state: present
namespace: '{{ namespace }}'
definition: "{{ lookup('template', '/'.join([samples_dir, cr_file])) | from_yaml }}"
Expand Down
8 changes: 3 additions & 5 deletions operator/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
collections:
- name: community.kubernetes
version: "2.0.1"
- name: operator_sdk.util
version: "0.4.0"
version: "0.5.0"
- name: kubernetes.core
version: "2.3.1"
version: "2.4.0"
- name: cloud.common
version: "2.1.1"
version: "2.1.4"
4 changes: 2 additions & 2 deletions operator/roles/forkliftcontroller/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ galaxy_info:
platforms:
- name: EL
versions:
- 8
- 9

galaxy_tags:
- forklift
Expand All @@ -28,4 +28,4 @@ galaxy_info:
dependencies: []
collections:
- operator_sdk.util
- community.kubernetes
- kubernetes.core
4 changes: 2 additions & 2 deletions operator/roles/forkliftcontroller/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
- block:

- name: "Get {{ resource_kind }} resources labeled {{ feature_label }}"
k8s_info:
kubernetes.core.k8s_info:
namespace: "{{ app_namespace }}"
kind: "{{ resource_kind }}"
label_selectors:
- "service = {{ feature_label }}"
register: results

- name: "Clean up {{ resource_kind }} resources labeled {{ feature_label }}"
k8s:
kubernetes.core.k8s:
namespace: "{{ app_namespace }}"
kind: "{{ results.resources[0].kind }}"
name: "{{ results.resources[0].metadata.name }}"
Expand Down
68 changes: 34 additions & 34 deletions operator/roles/forkliftcontroller/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,178 +48,178 @@
trusted_ca_enabled: true

- name: "Create an empty ConfigMap that will hold the trusted CA"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'configmap-trusted-ca.yml.j2') }}"

- name: "Setup the webhook secret"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'secret-webhook-server-secret.yml.j2') }}"

- name: "Setup controller config map"
k8s:
kubernetes.core.k8s:
state : present
definition: "{{ lookup('template', 'controller/configmap-controller.yml.j2') }}"

- name: "Setup inventory service"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'controller/service-inventory.yml.j2') }}"

- name: "Setup controller deployment"
k8s:
kubernetes.core.k8s:
state : present
definition: "{{ lookup('template', 'controller/deployment-controller.yml.j2') }}"
merge_type: "merge"

- name: "Setup inventory route"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'controller/route-inventory.yml.j2') }}"
when: not k8s_cluster|bool

- name: "Setup forklift-controller security context constraints"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'controller/controller-scc.yml.j2') }}"
when: not k8s_cluster|bool

- when: feature_volume_populator|bool
block:
- name: "Setup populator controller deployment"
k8s:
kubernetes.core.k8s:
state: "{{ volume_populator_state }}"
definition: "{{ lookup('template', 'populator/deployment-populator-controller.yml.j2') }}"

- when: k8s_cluster|bool
block:
- name: "Create a trusted CA issuer"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'cert-manager-trusted-ca.yml.j2') }}"
- name: "Configure webhook certificate on K8s"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'api/ca.yml.j2') }}"
- name: "Configure validation certificate on K8s"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'validation/ca.yml.j2') }}"
- name: "Configure inventory certificate on K8s"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'controller/ca.yml.j2') }}"
- name: "Configure must-gather certificate on K8s"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'must-gather-api/ca.yml.j2') }}"

- name: "Setup api service"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'api/service-forklift-api.yml.j2') }}"

- name: "Setup api deployment"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'api/deployment-forklift-api.yml.j2') }}"

- name: "Delete aggregated validation webhook configurations"
k8s:
kubernetes.core.k8s:
state: absent
definition: "{{ lookup('template', 'api/validatingwebhookconfiguration-forklift-api.yml.j2') }}"

- name: "Setup secrets validating webhook configuration"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'api/validatingwebhookconfiguration-secrets.yml.j2') }}"

- name: "Setup plans validating webhook configuration"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'api/validatingwebhookconfiguration-plans.yml.j2') }}"

- name: "Setup providers validating webhook configuration"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'api/validatingwebhookconfiguration-providers.yml.j2') }}"

- name: "Delete aggregated mutating webhook configurations"
k8s:
kubernetes.core.k8s:
state: absent
definition: "{{ lookup('template', 'api/mutatingwebhookconfiguration-forklift-api.yml.j2') }}"

- name: "Setup secrets mutating webhook configuration"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'api/mutatingwebhookconfiguration-secrets.yml.j2') }}"

- name: "Setup plans mutating webhook configuration"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'api/mutatingwebhookconfiguration-plans.yml.j2') }}"

- name: "Setup default provider"
k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'controller/provider-host.yml.j2') }}"
when: "'kubevirt.io' in api_groups"

- when: feature_validation|bool
block:
- name: "Setup validation service"
k8s:
kubernetes.core.k8s:
state: "{{ validation_state }}"
definition: "{{ lookup('template', 'validation/service-validation.yml.j2') }}"

- name: "Setup validation config map"
k8s:
kubernetes.core.k8s:
state: "{{ validation_state }}"
definition: "{{ lookup('template', 'validation/configmap-validation.yml.j2') }}"

- name: "Setup validation deployment"
k8s:
kubernetes.core.k8s:
state: "{{ validation_state }}"
definition: "{{ lookup('template', 'validation/deployment-validation.yml.j2') }}"

- when: feature_must_gather_api|bool
block:
- name: "Setup must-gather-api service"
k8s:
kubernetes.core.k8s:
state: "{{ must_gather_api_state }}"
definition: "{{ lookup('template', 'must-gather-api/service-must-gather-api.yml.j2') }}"

- name: "Setup must-gather-api deployment"
k8s:
kubernetes.core.k8s:
state: "{{ must_gather_api_state }}"
definition: "{{ lookup('template', 'must-gather-api/deployment-must-gather-api.yml.j2') }}"

- when: feature_ui_plugin|bool and not k8s_cluster|bool
block:

- name: "Setup UI plugin configmap"
k8s:
kubernetes.core.k8s:
state: "{{ ui_plugin_state }}"
definition: "{{ lookup('template', 'ui-plugin/configmap-ui-plugin.yml.j2') }}"

- name: "Setup UI plugin service"
k8s:
kubernetes.core.k8s:
state: "{{ ui_plugin_state }}"
definition: "{{ lookup('template', 'ui-plugin/service-ui-plugin.yml.j2') }}"

- name: "Setup UI plugin deployment"
k8s:
kubernetes.core.k8s:
state: "{{ ui_plugin_state }}"
definition: "{{ lookup('template', 'ui-plugin/deployment-ui-plugin.yml.j2') }}"

- name: "Setup console plugin"
k8s:
kubernetes.core.k8s:
state: "{{ ui_plugin_state }}"
definition: "{{ lookup('template', 'ui-plugin/console-plugin.yml.j2') }}"

- name: "Get cluster console information"
k8s_info:
kubernetes.core.k8s_info:
api_version: operator.openshift.io/v1
kind: console
name: cluster
Expand All @@ -230,7 +230,7 @@
console_plugins: "{{ console_operator['resources'][0]['spec']['plugins'] | default([]) }}"

- name: "Enable console plugin"
k8s:
kubernetes.core.k8s:
api_version: operator.openshift.io/v1
kind: console
name: cluster
Expand Down

0 comments on commit aba64a1

Please sign in to comment.