Skip to content

Commit

Permalink
add optional NR region handling for start scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien4218 committed Jun 2, 2022
1 parent 22e001f commit 2f68863
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions deploy/linux/roles/upload/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,32 @@
dest: ~/{{ service_id }}/startScenario.json
when: scenario_exist is defined and scenario_exist.stat.exists == false

# Main API
- name: Replace any NR region specific URL - EU
ansible.builtin.replace:
path: ~/{{ service_id }}/startScenario.json
regexp: '/api.newrelic.com/'
replace: '/api.eu.newrelic.com/'
when: newrelic_region is defined and (newrelic_region|upper) == "EU"
- name: Replace any NR region specific URL - Staging
ansible.builtin.replace:
path: ~/{{ service_id }}/startScenario.json
regexp: '/api.newrelic.com/'
replace: '/staging-api.newrelic.com/'
when: newrelic_region is defined and (newrelic_region|upper) == "STAGING"

# Log API
- name: Replace any NR region specific URL - EU
ansible.builtin.replace:
path: ~/{{ service_id }}/startScenario.json
regexp: 'log-api.newrelic.com'
replace: 'log-api.eu.newrelic.com'
when: newrelic_region is defined and (newrelic_region|upper) == "EU"
- name: Replace any NR region specific URL - Staging
ansible.builtin.replace:
path: ~/{{ service_id }}/startScenario.json
regexp: 'log-api.newrelic.com'
replace: 'staging-log-api.newrelic.com'
when: newrelic_region is defined and (newrelic_region|upper) == "STAGING"

- include_tasks: create_artifact_params.yml

0 comments on commit 2f68863

Please sign in to comment.