Skip to content

Commit 08e4d34

Browse files
committed
fix: clean up ansible errors
Signed-off-by: Chris Butler <chris.butler@redhat.com>
1 parent f79a7c7 commit 08e4d34

File tree

6 files changed

+63
-62
lines changed

6 files changed

+63
-62
lines changed

.ansible-lint

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Vim filetype=yaml
22
---
33
offline: false
4-
requirements: requirements.yml
54

65
exclude_paths:
7-
- .cache/
8-
- .github/
9-
- charts/
10-
- common/
11-
- tests/
6+
- .cache/
7+
- .github/
8+
- charts/
9+
- common/
10+
- tests/
11+
- requirements.yml
12+
- values-*
1213

1314
# warn_list:
1415
# - yaml

.releaserc.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
branches:
2-
- main
2+
- main
33
plugins:
4-
- "@semantic-release/commit-analyzer"
5-
- "@semantic-release/release-notes-generator"
6-
- "@semantic-release/github"
7-
- "@semantic-release/git"
4+
- "@semantic-release/commit-analyzer"
5+
- "@semantic-release/release-notes-generator"
6+
- "@semantic-release/github"
7+
- "@semantic-release/git"

ansible/azure-nat-gateway.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
retries: 20
1919
delay: 5
2020

21-
- name: Get Azure credentials
21+
- name: Get Azure configuration
2222
kubernetes.core.k8s_info:
2323
kind: ConfigMap
2424
namespace: openshift-cloud-controller-manager
@@ -41,7 +41,7 @@
4141
no_log: true
4242

4343
- name: Create Public IP for NAT Gateway
44-
azure_rm_publicipaddress:
44+
azure.azcollection.azure_rm_publicipaddress:
4545
subscription_id: "{{ azure_subscription_id }}"
4646
tenant: "{{ azure_tenant_id }}"
4747
client_id: "{{ azure_client_id }}"
@@ -52,7 +52,7 @@
5252
allocation_method: "static"
5353

5454
- name: Retrieve Public IP for NAT Gateway
55-
azure_rm_publicipaddress_info:
55+
azure.azcollection.azure_rm_publicipaddress_info:
5656
subscription_id: "{{ azure_subscription_id }}"
5757
tenant: "{{ azure_tenant_id }}"
5858
client_id: "{{ azure_client_id }}"
@@ -86,4 +86,3 @@
8686
name: "{{ azure_subnet }}"
8787
virtual_network_name: "{{ azure_vnet }}"
8888
nat_gateway: "{{ coco_nat_gateway_name }}"
89-
...

ansible/configure-issuer.yaml

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,43 @@
77
vars:
88
kubeconfig: "{{ lookup('env', 'KUBECONFIG') }}"
99
tasks:
10-
- name: Get Azure credentials
11-
kubernetes.core.k8s_info:
12-
kind: Secret
13-
namespace: openshift-cloud-controller-manager
14-
name: azure-cloud-credentials
15-
register: azure_credentials
16-
retries: 20
17-
delay: 5
18-
- name: List DNS zones
19-
azure.azcollection.azure_rm_dnszone_info:
20-
#resource_group: "{{ azure_credentials['data']['re'] }}" # don't pass if
21-
auth_source: "auto"
22-
subscription_id: "{{ azure_credentials.resources[0]['data']['azure_subscription_id'] | b64decode }}"
23-
client_id: "{{ azure_credentials.resources[0]['data']['azure_client_id'] | b64decode }}"
24-
secret: "{{ azure_credentials.resources[0]['data']['azure_client_secret'] | b64decode }}"
25-
tenant: "{{ azure_credentials.resources[0]['data']['azure_tenant_id'] | b64decode }}"
26-
register: dns_zones
27-
# FIXME: This assumes only one dns zone is present. we should be matching against available dns zones.
28-
- name: Split the Path
29-
set_fact:
30-
path_parts: "{{ dns_zones.ansible_info.azure_dnszones[0].id.split('/') }}"
31-
- name: Find the Resource Group Name
32-
set_fact:
33-
resource_group: "{{ path_parts[4] }}"
34-
- name: Get hosted zone
35-
set_fact:
36-
hosted_zone: "{{ dns_zones.ansible_info.azure_dnszones[0].name }}"
37-
- name: "Set k8s cm"
38-
kubernetes.core.k8s:
39-
api_version: v1
40-
kind: ConfigMap
41-
resource_definition:
42-
apiVersion: v1
10+
- name: Get Azure credentials
11+
kubernetes.core.k8s_info:
12+
kind: Secret
13+
namespace: openshift-cloud-controller-manager
14+
name: azure-cloud-credentials
15+
register: azure_credentials
16+
retries: 20
17+
delay: 5
18+
- name: List DNS zones
19+
azure.azcollection.azure_rm_dnszone_info:
20+
auth_source: "auto"
21+
subscription_id: "{{ azure_credentials.resources[0]['data']['azure_subscription_id'] | b64decode }}"
22+
client_id: "{{ azure_credentials.resources[0]['data']['azure_client_id'] | b64decode }}"
23+
secret: "{{ azure_credentials.resources[0]['data']['azure_client_secret'] | b64decode }}"
24+
tenant: "{{ azure_credentials.resources[0]['data']['azure_tenant_id'] | b64decode }}"
25+
register: dns_zones
26+
# FIXME: This assumes only one dns zone is present. we should be matching against available dns zones.
27+
- name: Split the Path
28+
ansible.builtin.set_fact:
29+
path_parts: "{{ dns_zones.ansible_info.azure_dnszones[0].id.split('/') }}"
30+
- name: Find the Resource Group Name
31+
ansible.builtin.set_fact:
32+
resource_group: "{{ path_parts[4] }}"
33+
- name: Get hosted zone
34+
ansible.builtin.set_fact:
35+
hosted_zone: "{{ dns_zones.ansible_info.azure_dnszones[0].name }}"
36+
- name: "Set k8s cm"
37+
kubernetes.core.k8s:
38+
api_version: v1
4339
kind: ConfigMap
44-
metadata:
45-
name: dnsinfo
46-
namespace: imperative
47-
data:
48-
resource_group: "{{ resource_group }}"
49-
hosted_zone: "{{ hosted_zone }}"
50-
state: present
40+
resource_definition:
41+
apiVersion: v1
42+
kind: ConfigMap
43+
metadata:
44+
name: dnsinfo
45+
namespace: imperative
46+
data:
47+
resource_group: "{{ resource_group }}"
48+
hosted_zone: "{{ hosted_zone }}"
49+
state: present

ansible/install-deps.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
hosts: localhost
55
gather_facts: false
66
tasks:
7-
- name: Install required collection
8-
ansible.builtin.command:
9-
cmd: ansible-galaxy collection install azure.azcollection
10-
- name: Install a Python package
11-
ansible.builtin.command:
12-
cmd: pip install --user -r ~/.ansible/collections/ansible_collections/azure/azcollection/requirements.txt
7+
- name: Ensure collection is installed
8+
community.general.ansible_galaxy_install:
9+
type: collection
10+
name: azure.azcollection
11+
- name: Install a Python package
12+
ansible.builtin.pip:
13+
requirements: "~/.ansible/collections/ansible_collections/azure/azcollection/requirements.txt"
14+
extra_args: --user

requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
collections:
2-
- azure.azcollection
2+
- azure.azcollection

0 commit comments

Comments
 (0)