first round of fixes from testing

This commit is contained in:
Lee Goolsbee
2024-03-25 14:27:28 -05:00
parent a902044657
commit c610d975ca
8 changed files with 24 additions and 28 deletions

View File

@@ -1,25 +1,32 @@
# handle setting up to call the bitbucket api
- name: set_fact for the MeshRegistrationCredentialsSecret
- name: retrieve cloudformation facts
amazon.aws.cloudformation_info:
stack_name: '{{ atl_aws_stack_id }}'
region: '{{ ansible_ec2_placement_region }}'
stack_resources: yes
register: cfn_stack_facts
- name: set fact for the MeshRegistrationCredentialsSecret
ansible.builtin.set_fact:
mesh_registration_credential_secret: "{{ cfnFacts.cloudformation[stack_name].stack_resources.MeshRegistrationCredentialsSecret }}"
mesh_registration_credential_secret: "{{ cfn_stack_facts.cloudformation[atl_aws_stack_name].stack_resources.MeshRegistrationCredentialsSecret }}"
# NOTE: we decided we want to barf early if the secret doesnt exist as ll the rest of this is somewhat useless if we cant register nodes
# when:
# - cfnFacts.cloudformation[stack_name].stack_resources.MeshRegistrationCredentialsSecret is defined
# - cfn_stack_facts.cloudformation[stack_name].stack_resources.MeshRegistrationCredentialsSecret is defined
- name: get the mesh registration username
ansible.builtin.set_fact:
mesh_registration_username: "{{ lookup('amazon.aws.secretsmanager_secret', secretpath, region=ansible_ec2_placement_region, bypath=false, nested=true) }}"
ignore_errors: no
vars:
secretpath: "{{ cfnFacts.cloudformation[stack_name].stack_resources.MeshRegistrationCredentialsSecret }}.username"
secretpath: "{{ mesh_registration_credential_secret }}.username"
- name: get the mesh registration password
ansible.builtin.set_fact:
mesh_registration_password: "{{ lookup('amazon.aws.secretsmanager_secret', secretpath, region=ansible_ec2_placement_region, bypath=false, nested=true) }}"
ignore_errors: no
vars:
secretpath: "{{ cfnFacts.cloudformation[stack_name].stack_resources.MeshRegistrationCredentialsSecret }}.password"
secretpath: "{{ mesh_registration_credential_secret }}.password"
no_log: True
- name: generate the basic auth string