-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test - create a dedicated role for nodepool-providers-secrets validation
Change-Id: I7729d4defe4862f6a3dc1e0319a4b42b4bf3cbe0
- Loading branch information
Showing
5 changed files
with
79 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
roles/health-check/test-nodepool-providers-secrets/defaults/main.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
kubeconfig: "~/.kube/config" | ||
sf_config_yaml: | ||
nodepool: | ||
clouds_file: /tmp/clouds.yaml | ||
kube_file: /tmp/kubeconfig.yaml |
31 changes: 31 additions & 0 deletions
31
roles/health-check/test-nodepool-providers-secrets/files/clouds.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
cache: | ||
expiration: | ||
server: 5 | ||
port: 5 | ||
floating-ip: 5 | ||
metrics: | ||
statsd: | ||
prefix: nodepool.openstack | ||
clouds: | ||
nimbus: | ||
api_timeout: 60 | ||
auth: | ||
username: user1 | ||
password: password1 | ||
auth_url: https://keystone.nimbus/v2.0 | ||
project_name: my-project | ||
image_format: 'raw' | ||
metrics: | ||
statsd: | ||
prefix: nodepool.openstack.nimbus | ||
cumulus: | ||
api_timeout: 60 | ||
auth: | ||
username: user2 | ||
password: password2 | ||
auth_url: https://keystone.cumulus/v2.0 | ||
project_name: my-other-project | ||
image_format: 'raw' | ||
metrics: | ||
statsd: | ||
prefix: nodepool.openstack.cumulus |
41 changes: 41 additions & 0 deletions
41
roles/health-check/test-nodepool-providers-secrets/tasks/main.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
- name: Prepare a minimal sfconfig.yaml file | ||
ansible.builtin.copy: | ||
content: "{{ sf_config_yaml | to_yaml }}" | ||
dest: /tmp/sfconfig.yaml | ||
|
||
- name: Dump current secrets from nodepool | ||
command: > | ||
tools/sfconfig --config /tmp/sfconfig.yaml nodepool-providers-secrets --dump | ||
args: | ||
chdir: "{{ zuul.project.src_dir }}" | ||
|
||
- name: set a fake clouds.yaml configuration | ||
ansible.builtin.copy: | ||
src: clouds.yaml | ||
dest: /tmp/clouds.yaml | ||
|
||
- name: Upload clouds secrets to nodepool | ||
command: > | ||
tools/sfconfig --config /tmp/sfconfig.yaml nodepool-providers-secrets --update | ||
args: | ||
chdir: "{{ zuul.project.src_dir }}" | ||
|
||
- name: Wait for secrets to be updated | ||
ansible.builtin.include_role: | ||
name: "health-check/check-sf-resource-ready" | ||
|
||
- name: "Check that clouds.yaml available in nodepool-builder" | ||
ansible.builtin.shell: | | ||
kubectl exec nodepool-builder-0 -- bash -c "ls /var/lib/nodepool/.config/openstack/clouds.yaml" | ||
- name: Fetch nodepool-launcher Pod info | ||
kubernetes.core.k8s_info: | ||
kind: Pod | ||
label_selectors: | ||
- "run = nodepool-launcher" | ||
register: nodepool_launcher_info | ||
|
||
- name: "Check that clouds.yaml available in nodepool-launcher containers" | ||
ansible.builtin.shell: | | ||
kubectl exec {{ nodepool_launcher_info.resources[0].metadata.name }} -- bash -c "ls /var/lib/nodepool/.config/openstack/clouds.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters