Skip to content

Commit

Permalink
ansible 2.12 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fridim committed Mar 3, 2022
1 parent 38e5363 commit b1e8dea
Show file tree
Hide file tree
Showing 404 changed files with 975 additions and 970 deletions.
14 changes: 7 additions & 7 deletions ansible/cloud_providers/ec2_infrastructure_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
when: agnosticd_open_environment | default(false) | bool

- name: Run infra-ec2-template-generate Role
import_role:
include_role:
name: infra-ec2-template-generate

- name: Run infra-ec2-template-create Role
import_role:
include_role:
name: infra-ec2-template-create
vars:
aws_region_loop: "{{aws_region}}"
Expand Down Expand Up @@ -76,11 +76,11 @@
include_tasks: ec2_detect_region_tasks.yml

- name: Run infra-ec2-create-inventory Role
import_role:
include_role:
name: infra-ec2-create-inventory

- name: Run Common SSH Config Generator Role
import_role:
include_role:
name: infra-common-ssh-config-generate

# include global vars again, this time for all hosts now that the inventory is built
Expand Down Expand Up @@ -110,11 +110,11 @@
ansible_ssh_extra_args: "{{ ansible_ssh_extra_args|d() }} -F {{output_dir}}/{{ env_type }}_{{ guid }}_ssh_conf"

- name: Run infra-ec2-wait_for_linux_hosts Role
import_role:
include_role:
name: infra-ec2-wait_for_linux_hosts

- name: Run infra-ec2-linux-set-hostname Role
import_role:
include_role:
name: infra-ec2-linux-set-hostname

- name: Step 001.4 Configure Windows Hosts and Wait for Connection
Expand All @@ -139,7 +139,7 @@
aws_region_final: "{{hostvars['localhost'].aws_region_final}}"

- name: Run infra-ec2-wait_for_linux_hosts Role
import_role:
include_role:
name: infra-ec2-wait_for_windows_hosts

- name: Set output_dir for all windows hosts
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/aap2-ansible-workshops/post_infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
tasks:

- name: Gather EC2 facts
ec2_instance_facts:
amazon.aws.ec2_instance_info:
region: "{{ aws_region_final|d(aws_region) | default(region) | default('us-east-1')}}"
filters:
instance-state-name: running
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/ansible-workshops/post_infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
tasks:

- name: Gather EC2 facts
ec2_instance_facts:
amazon.aws.ec2_instance_info:
region: "{{ aws_region_final|d(aws_region) | default(region) | default('us-east-1')}}"
filters:
instance-state-name: running
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/aro/htpasswd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
- oauth-htpasswd.yaml

- name: Retrieve API server configuration (for API endpoint)
k8s_facts:
kubernetes.core.k8s_info:
host: "{{ az_aro4_public_api_fixed }}"
api_key: "{{ az_aro4_auth_results.k8s_auth.api_key }}"
api_version: config.openshift.io/v1
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/linklight-foundations/post_infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
hostvars: ""

- name: Gather EC2 facts
ec2_instance_facts:
amazon.aws.ec2_instance_info:
aws_access_key: "{{ aws_access_key_id }}"
aws_secret_key: "{{ aws_secret_access_key }}"
region: "{{ aws_region_final|d(aws_region) | default(region) | default('us-east-1')}}"
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/linklight/post_infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
tasks:

- name: Gather EC2 facts
ec2_instance_facts:
amazon.aws.ec2_instance_info:
# aws_access_key: "{{ aws_access_key_id }}"
# aws_secret_key: "{{ aws_secret_access_key }}"
region: "{{ aws_region_final|d(aws_region) | default(region) | default('us-east-1')}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@
register: ansible_agnostic_deployer_head

- name: Gather ec2 facts
ec2_instance_facts:
amazon.aws.ec2_instance_info:
aws_access_key: "{{ aws_access_key_id }}"
aws_secret_key: "{{ aws_secret_access_key }}"
region: "{{ aws_region_final | default(aws_region) }}"
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/ocp-workshop/post_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@
register: ansible_agnostic_deployer_head

- name: Gather ec2 facts
ec2_instance_facts:
amazon.aws.ec2_instance_info:
aws_access_key: "{{ aws_access_key_id }}"
aws_secret_key: "{{ aws_secret_access_key }}"
region: "{{ aws_region_final | default(aws_region) }}"
Expand Down
4 changes: 2 additions & 2 deletions ansible/configs/ocp4-cluster/destroy_env_ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
AWS_DEFAULT_REGION: "{{aws_region_final|d(aws_region)}}"
tasks:
- name: Get all EC2 instances
ec2_instance_info:
amazon.aws.ec2_instance_info:
filters:
"tag:guid": "{{ guid }}"
"tag:env_type": "{{ env_type }}"
Expand All @@ -85,7 +85,7 @@

- name: Wait until all EC2 instances are running
when: r_stopped_instances.instances | length > 0
ec2_instance_info:
amazon.aws.ec2_instance_info:
filters:
"tag:guid": "{{ guid }}"
"tag:env_type": "{{ env_type }}"
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/ocp4-cluster/destroy_env_osp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
when: rhcos_image_name | default("") | length == 0
block:
- name: Get Cluster Name
k8s_info:
kubernetes.core.k8s_info:
kubeconfig: "/home/cloud-user/cluster-{{ guid }}/auth/kubeconfig"
api_version: config.openshift.io/v1
kind: Infrastructure
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/ocp4-cluster/post_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
when: test_deploy_runs is defined
block:
- name: Check on status of job
k8s_facts:
kubernetes.core.k8s_info:
api_version: batch/v1
kind: Job
name: fio-test
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/ocp4-cluster/pre_infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

- name: Call infra-local-create-ssh-key role
when: set_env_authorized_key | bool
import_role:
include_role:
name: infra-local-create-ssh_key
tags:
- generate_env_keys
Expand Down
15 changes: 10 additions & 5 deletions ansible/configs/ocp4-cluster/pre_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@
tags:
- step003
- common_tasks
roles:
- role: set-repositories
tasks:
- include_role:
name: set-repositories
when: repo_method is defined
- role: common

- include_role:
name: common
when: install_common | bool
- role: set_env_authorized_key

- include_role:
name: set_env_authorized_key
when: set_env_authorized_key | bool
tasks:

- name: Add GUID to /etc/skel/.bashrc
lineinfile:
path: "/etc/skel/.bashrc"
Expand Down
2 changes: 1 addition & 1 deletion ansible/configs/ocp4-disconnected-osp-lab/software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
INFRA_ID: "{{ r_infra_id.stdout }}"

- name: Wait for job to finish (1h max)
k8s_info:
kubernetes.core.k8s_info:
api_version: batch/v1
kind: Job
name: fio-test
Expand Down
6 changes: 3 additions & 3 deletions ansible/configs/ocp4-workshop/lifecycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
- when: ACTION == 'status'
block:
- name: Get EC2 facts using (guid, env_type) tag
ec2_instance_facts:
amazon.aws.ec2_instance_info:
filters:
"tag:guid": "{{ guid }}"
"tag:env_type": "{{ env_type }}"
Expand Down Expand Up @@ -114,7 +114,7 @@
seconds: "{{ lifecycle_start_pause | default(180) }}"

- name: Get CSRs that need to be approved
k8s_facts:
kubernetes.core.k8s_info:
api_version: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
# Field selectors don't seem to work
Expand All @@ -134,7 +134,7 @@
seconds: 10

- name: Get additional CSRs that need to be approved
k8s_facts:
kubernetes.core.k8s_info:
api_version: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
# Field selectors don't seem to work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
when: rhcos_image_name | default("") | length == 0
block:
- name: Get Cluster Name
k8s_info:
kubernetes.core.k8s_info:
kubeconfig: "/home/cloud-user/cluster-{{ guid }}/auth/kubeconfig"
api_version: config.openshift.io/v1
kind: Infrastructure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
seconds: "{{ lifecycle_start_pause | default(180) }}"

- name: Get CSRs that need to be approved
k8s_facts:
kubernetes.core.k8s_info:
api_version: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
# Field selectors don't seem to work
Expand All @@ -67,7 +67,7 @@
seconds: 10

- name: Get additional CSRs that need to be approved
k8s_facts:
kubernetes.core.k8s_info:
api_version: certificates.k8s.io/v1beta1
kind: CertificateSigningRequest
# Field selectors don't seem to work
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
when: test_deploy_runs is defined
block:
- name: Check on status of job
k8s_facts:
kubernetes.core.k8s_info:
api_version: batch/v1
kind: Job
name: fio-test
Expand Down
22 changes: 11 additions & 11 deletions ansible/configs/osp-stf/software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
definition: "{{ lookup('file', 'operatorgroup.yaml') }}"

- name: Wait for operator group to be present
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1
kind: OperatorGroup
name: service-telemetry-operator-group
Expand All @@ -144,7 +144,7 @@
definition: "{{ lookup('file', 'amqsubscription.yaml') }}"

- name: Get Installed AMQ Certificate Manager CSV
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: Subscription
name: amq7-cert-manager-operator
Expand All @@ -157,7 +157,7 @@
- r_subscription_amq_certificate_manager.resources[0].status.currentCSV | length > 0

- name: Wait until AMQ Certificate Manager CSV is installed
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
name: "{{ r_subscription_amq_certificate_manager.resources[0].status.currentCSV }}"
Expand All @@ -176,7 +176,7 @@
definition: "{{ lookup('file', 'elasticcloudsubscription.yaml') }}"

- name: Get Installed Elastic Cloud CSV
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: Subscription
name: elastic-cloud-eck
Expand All @@ -189,7 +189,7 @@
- r_subscription_elastic_cloud.resources[0].status.currentCSV | length > 0

- name: Wait until Elastic Cloud CSV is installed
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
name: "{{ r_subscription_elastic_cloud.resources[0].status.currentCSV }}"
Expand All @@ -208,7 +208,7 @@
definition: "{{ lookup('file', 'servicetelemetrysubscription.yaml') }}"

- name: Get Installed Service Telemetry CSV
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: Subscription
name: service-telemetry-operator
Expand All @@ -221,7 +221,7 @@
- r_subscription_service_telemetry.resources[0].status.currentCSV | length > 0

- name: Wait until Service Telemetry CSV is installed
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
name: "{{ r_subscription_service_telemetry.resources[0].status.currentCSV }}"
Expand All @@ -240,7 +240,7 @@
definition: "{{ lookup('file', 'servicetelemetryobject.yaml') }}"

- name: Wait until Service Telemetry is ready
k8s_info:
kubernetes.core.k8s_info:
api_version: infra.watch/v1alpha1
kind: ServiceTelemetry
name: stf-default
Expand Down Expand Up @@ -287,7 +287,7 @@
definition: "{{ lookup('file', 'grafanasubscription.yaml') }}"

- name: Get Installed Grafana CSV
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: Subscription
name: grafana-operator
Expand All @@ -300,7 +300,7 @@
- r_subscription_grafana.resources[0].status.currentCSV | length > 0

- name: Wait until grafana CSV is installed
k8s_info:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
name: "{{ r_subscription_grafana.resources[0].status.currentCSV }}"
Expand Down Expand Up @@ -334,7 +334,7 @@
definition: "{{ lookup('file', 'dashboardroute.yaml') }}"

- name: Get grafana route
k8s_info:
kubernetes.core.k8s_info:
api_version: route.openshift.io/v1
kind: Route
name: dashboards
Expand Down
4 changes: 2 additions & 2 deletions ansible/configs/rosa/destroy_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
AWS_DEFAULT_REGION: "{{aws_region_final|d(aws_region)}}"
tasks:
- name: Get all EC2 instances
ec2_instance_info:
amazon.aws.ec2_instance_info:
filters:
"tag:guid": "{{ guid }}"
"tag:env_type": "{{ env_type }}"
Expand All @@ -78,7 +78,7 @@

- name: Wait until all EC2 instances are running
when: r_stopped_instances.instances | length > 0
ec2_instance_info:
amazon.aws.ec2_instance_info:
filters:
"tag:guid": "{{ guid }}"
"tag:env_type": "{{ env_type }}"
Expand Down
4 changes: 2 additions & 2 deletions ansible/configs/sap-integration/custom_workloads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
resource_definition: "{{ lookup( 'template', './files/k8s/storage_cluster.j2' ) | from_yaml }}"

- name: Wait until storage classes are available
k8s_info:
kubernetes.core.k8s_info:
api_version: v1
kind: StorageClass
name: "{{ item }}"
Expand Down Expand Up @@ -214,7 +214,7 @@
resource_definition: "{{ lookup( 'template', './files/k8s/camelk_subscription.j2' ) | from_yaml }}"

- name: Wait for the status of the Camel-K subscription to not be empty
k8s_facts:
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
kind: Subscription
name: red-hat-camel-k
Expand Down
Loading

0 comments on commit b1e8dea

Please sign in to comment.