Skip to content

Commit

Permalink
Merge pull request #185 from companieshouse/abbreviate-development-do…
Browse files Browse the repository at this point in the history
…mains

Abbreviate domains to avoid exceeding character limit
  • Loading branch information
marcransome committed Jun 21, 2024
2 parents de1c010 + 4078cd5 commit 324cc93
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions roles/deploy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
- scripts_artifact_path is defined and scripts_artifact_path | trim | length > 0
msg: "Required variable(s) empty or undefined"

# The hostname is assumed to be in the format: fil-tuxedo-<environment>-<instance-index>
# The hostname is assumed to be in the format: fil-tuxedo-<environment>-<instance-index>; the environment
# name 'development' is abbreviated to 'dev' to avoid exceeding the domain character limit
- name: Set Tuxedo facts for config population
set_fact:
tuxedo_domain_id_suffix: "{{ ansible_facts.hostname | regex_replace('^fil-tuxedo-([A-Za-z].*)-(\\d+)$', 'FIL_\\2_\\1_DOM') | upper }}"
tuxedo_logical_machine_id_suffix: "{{ ansible_facts.hostname | regex_replace('^fil-tuxedo-([A-Za-z].*)-(\\d+)$', 'FIL_\\2_\\1_SRV') | upper }}"
tuxedo_local_domain_suffix: "{{ ansible_facts.hostname | regex_replace('^fil-tuxedo-([A-Za-z].*)-(\\d+)$', 'FIL_\\2_\\1_LOD') | upper }}"
tuxedo_domain_id_suffix: "{{ ansible_facts.hostname | regex_replace('development', 'dev') | regex_replace('^fil-tuxedo-([A-Za-z].*)-(\\d+)$', 'FIL_\\2_\\1_DOM') | upper }}"
tuxedo_logical_machine_id_suffix: "{{ ansible_facts.hostname | regex_replace('development', 'dev') | regex_replace('^fil-tuxedo-([A-Za-z].*)-(\\d+)$', 'FIL_\\2_\\1_SRV') | upper }}"
tuxedo_local_domain_suffix: "{{ ansible_facts.hostname | regex_replace('development', 'dev') | regex_replace('^fil-tuxedo-([A-Za-z].*)-(\\d+)$', 'FIL_\\2_\\1_LOD') | upper }}"

- name: Set CloudWatch agent facts for config population
set_fact:
Expand Down

0 comments on commit 324cc93

Please sign in to comment.