-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: problems found when deploying kubernetes 1.24.3 cluster
fix: authentication
- Loading branch information
1 parent
703e3ae
commit 7e04f7c
Showing
11 changed files
with
125 additions
and
304 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
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
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,12 @@ | ||
--- | ||
- name: "Check OpenStack" | ||
set_fact: | ||
pass_provider: "openstack" | ||
when: "pass_provider is not defined" | ||
|
||
- name: "Set OpenStack default variables" | ||
set_fact: | ||
use_generic_ssh_key: True | ||
generic_ssh_key_name: generic-key | ||
when: "use_generic_ssh_key is not defined or (use_generic_ssh_key | bool) " | ||
... |
15 changes: 15 additions & 0 deletions
15
ansible/playbook/openstack/openstack_auth_passstore_v3applicationcredential.yml
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,15 @@ | ||
--- | ||
- name: "OpenStack authentication with passwordstore and v3applicationcredential" | ||
hosts: localhost | ||
|
||
tasks: | ||
|
||
- name: "Set facts" | ||
ansible.builtin.set_fact: | ||
rhos_authentication_type: v3applicationcredential | ||
rhos_authentication: | ||
auth_url: "{{ query('passwordstore', 'openstack/host/os_auth_url')[0] }}" | ||
application_credential_id: "{{ query('passwordstore', 'openstack/host/app_cred_id')[0] }}" | ||
application_credential_secret: "{{ query('passwordstore', 'openstack/host/app_cred_secret')[0] }}" | ||
|
||
... |
2 changes: 1 addition & 1 deletion
2
ansible/playbook/openstack/openstack_auth_passstore_v3password.yml
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
55 changes: 55 additions & 0 deletions
55
ansible/playbook/openstack/openstack_list_objects_v3applicationcredential.yml
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,55 @@ | ||
--- | ||
- name: "Instanciate RHOS authentication" | ||
ansible.builtin.import_playbook: "openstack_auth_passstore_v3applicationcredential.yml" | ||
vars: | ||
vm_user: "snowdrop" | ||
pass_provider: "openstack" | ||
|
||
- name: "OpenStack Authentication" | ||
hosts: localhost | ||
|
||
tasks: | ||
|
||
- name: "Get auth_token" | ||
openstack.cloud.auth: | ||
auth_type: "{{ rhos_authentication_type }}" | ||
auth: "{{ rhos_authentication }}" | ||
register: auth_result | ||
|
||
- name: "Print Openstack Authentication result" | ||
ansible.builtin.debug: | ||
msg: "auth_result: {{ auth_result }}" | ||
verbosity: 0 | ||
|
||
|
||
- name: List Fedora images | ||
openstack.cloud.image_info: | ||
auth_type: "{{ rhos_authentication_type }}" | ||
auth: "{{ rhos_authentication }}" | ||
properties: | ||
os_distro: "fedora" | ||
register: image_info_result | ||
|
||
- name: "Print Openstack output" | ||
ansible.builtin.debug: | ||
var: image_info_result | ||
|
||
# https://docs.openstack.org/ocata/cli-reference/glance-property-keys.html | ||
- name: List Fedora images | ||
openstack.cloud.image_info: | ||
# token, v2token, v3token, admin_token | ||
auth_type: token | ||
auth: | ||
auth_url: "https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13000" | ||
# token: "{{ auth_result.ansible_facts['auth_token'] }}" | ||
token: "{{ auth_result.auth_token }}" | ||
interface: "internal" | ||
properties: | ||
os_distro: "fedora" | ||
register: image_info_result | ||
|
||
- name: "Print Openstack output" | ||
ansible.builtin.debug: | ||
var: image_info_result | ||
... | ||
# ansible-playbook ansible/playbook/openstack/openstack_auth.yml |
18 changes: 6 additions & 12 deletions
18
...book/openstack/openstack_list_objects.yml → ...ack/openstack_list_objects_v3password.yml
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
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
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
Oops, something went wrong.