-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #386 from ministryofjustice/feature/DSOS-2333/ansi…
…ble-secrets-config DSOS-2333-ansible-secrets-config
- Loading branch information
Showing
7 changed files
with
67 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
--- | ||
- name: Set SSM parameters path fact from ec2 ssm-parameters-prefix and Name tag | ||
set_fact: | ||
ssm_parameters_path: '/{{ ssm_parameters_prefix }}/{{ ec2.tags["Name"] }}' | ||
|
||
- name: Set SSM parameters bip cmc path facts | ||
set_fact: | ||
ssm_parameters_path_bip_cmc_cms_cluster_key: "{{ ssm_parameters_path }}/cms_cluster_key" | ||
ssm_parameters_path_bip_cmc_cms_admin_password: "{{ ssm_parameters_path }}/cms_admin_password" | ||
ssm_parameters_path_bip_cmc_lcm_password: "{{ ssm_parameters_path }}/lcm_password" | ||
ssm_parameters_path_bip_cmc_cms_db_password: "{{ ssm_parameters_path }}/cms_db_password" | ||
ssm_parameters_path_bip_cmc_auditing_db_password: "{{ ssm_parameters_path }}/auditing_db_password" | ||
ssm_parameters_path_bip_cmc_product_key: "{{ ssm_parameters_path }}/product_key" | ||
- name: Get BIP secrets | ||
import_role: | ||
name: secretsmanager-passwords | ||
vars: | ||
secretsmanager_passwords: "{{ bip_cmc_secretsmanager_passwords }}" | ||
|
||
- name: Get SSM parameters | ||
- name: Set password facts | ||
set_fact: | ||
bip_cmc_cms_cluster_key: "{{ lookup('aws_ssm', ssm_parameters_path_bip_cmc_cms_cluster_key, region=ansible_ec2_placement_region) }}" | ||
bip_cmc_cms_admin_password: "{{ lookup('aws_ssm', ssm_parameters_path_bip_cmc_cms_admin_password, region=ansible_ec2_placement_region) }}" | ||
bip_cmc_lcm_password: "{{ lookup('aws_ssm', ssm_parameters_path_bip_cmc_lcm_password, region=ansible_ec2_placement_region) }}" | ||
bip_cmc_cms_db_password: "{{ lookup('aws_ssm', ssm_parameters_path_bip_cmc_cms_db_password, region=ansible_ec2_placement_region) }}" | ||
bip_cmc_auditing_db_password: "{{ lookup('aws_ssm', ssm_parameters_path_bip_cmc_auditing_db_password, region=ansible_ec2_placement_region) }}" | ||
bip_cmc_product_key: "{{ lookup('aws_ssm', ssm_parameters_path_bip_cmc_product_key, region=ansible_ec2_placement_region) }}" | ||
cms_cluster_key: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['cms_cluster_key'] }}" | ||
cms_admin_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['cms_admin_password'] }}" | ||
cms_db_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['cms_db_password'] }}" | ||
lcm_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['lcm_password'] }}" | ||
product_key: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['product_key'] }}" | ||
auditing_db_password: "{{ secretsmanager_passwords_dict['bip_cmc'].passwords['auditing_db_password'] }}" |
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
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 |
---|---|---|
@@ -1,14 +1,12 @@ | ||
--- | ||
- name: Set SSM parameters path fact from ec2 ssm-parameters-prefix and Name tag | ||
set_fact: | ||
ssm_parameters_path: '/{{ ssm_parameters_prefix }}/{{ ec2.tags["Name"] }}' | ||
|
||
- name: Set SSM parameters tomcat path facts | ||
set_fact: | ||
ssm_parameters_path_tomcat_cms_password: "{{ ssm_parameters_path }}/cms_password" | ||
ssm_parameters_path_tomcat_product_key: "{{ ssm_parameters_path }}/product_key" | ||
- name: Get tomcat secrets | ||
import_role: | ||
name: secretsmanager-passwords | ||
vars: | ||
secretsmanager_passwords: "{{ tomcat_secretsmanager_passwords }}" | ||
|
||
- name: Get SSM parameters | ||
- name: Set password facts | ||
set_fact: | ||
tomcat_cms_password: "{{ lookup('aws_ssm', ssm_parameters_path_tomcat_cms_password, region=ansible_ec2_placement_region) }}" | ||
tomcat_product_key: "{{ lookup('aws_ssm', ssm_parameters_path_tomcat_product_key, region=ansible_ec2_placement_region) }}" | ||
cms_name: "{{ secretsmanager_passwords_dict['tomcat'].passwords['cms_name'] }}" | ||
cms_admin_password: "{{ secretsmanager_passwords_dict['tomcat'].passwords['cms_admin_password'] }}" | ||
product_key: "{{ secretsmanager_passwords_dict['tomcat'].passwords['product_key'] }}" |