Skip to content

Commit

Permalink
Fixed chicken-egg issue galaxy credentials and orgs
Browse files Browse the repository at this point in the history
  • Loading branch information
silvinux committed Oct 23, 2022
1 parent 9a5b7b9 commit 4be97cf
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions roles/filetree_read/tests/config-controller-filetree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
connection: local
gather_facts: false
vars:
controller_configuration_projects_async_retries: 60
controller_configuration_projects_async_retries: 120
controller_configuration_projects_async_delay: 2
controller_username: "{{ vault_controller_username | default(lookup('env', 'CONTROLLER_USERNAME')) }}"
controller_password: "{{ vault_controller_password | default(lookup('env', 'CONTROLLER_PASSWORD')) }}"
controller_hostname: "{{ vault_controller_hostname | default(lookup('env', 'CONTROLLER_HOST')) }}"
controller_validate_certs: "{{ vault_controller_validate_certs | default(lookup('env', 'CONTROLLER_VERIFY_SSL')) }}"

pre_tasks:
- name: "Setup authentication (block)"
block:
Expand All @@ -32,36 +31,29 @@
when: controller_oauthtoken is not defined
tags:
- always
roles:
- {role: redhat_cop.controller_configuration.filetree_read, assign_galaxy_credentials_to_org: false}
- {role: redhat_cop.controller_configuration.dispatch, assign_galaxy_credentials_to_org: false}

post_tasks:
- block:
- name: Include Tasks to load Galaxy credentials to be added to Organizations
ansible.builtin.include_role:
name: redhat_cop.controller_configuration.filetree_read
tasks_from: "{{ create_orgs_credentials }}"
loop:
- organizations.yml
- credentials.yml
loop_control:
loop_var: create_orgs_credentials
tasks_from: organizations.yml

- name: Include Tasks to add Galaxy credentials to Organizations
ansible.builtin.include_role:
name: redhat_cop.controller_configuration.dispatch
apply:
tags:
- organizations
- credentials
vars:
assign_galaxy_credentials_to_org: false
controller_configuration_dispatcher_roles:
- {role: organizations, var: controller_organizations, tags: organizations}
- {role: credentials, var: controller_credentials, tags: credentials}

roles:
- {role: redhat_cop.controller_configuration.filetree_read}
- {role: redhat_cop.controller_configuration.dispatch}
tags:
- organizations

post_tasks:
- name: "Delete the Authentication Token used"
ansible.builtin.uri:
url: "https://{{ controller_hostname }}{{ controller_oauthtoken_url }}"
Expand Down

0 comments on commit 4be97cf

Please sign in to comment.