Skip to content

Commit 790cabf

Browse files
committed
Scope variables for collision prevention
1 parent fa4c7a9 commit 790cabf

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

playbooks/engine/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
tasks:
66
- name: Load the production config
77
ansible.builtin.include_vars:
8-
name: app_config
8+
name: ota_engine_app_config
99
file: "{{ inventory_dir }}/{{ ota_engine_config_path | default('../config/production.json') }}"
1010
tags: always
1111

roles/engine/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ota_engine_declarations_directory: "{{ app_config.name }}"
1+
ota_engine_declarations_directory: "{{ ota_engine_app_config.name }}"
22
ota_engine_declarations_branch: main
33
ota_engine_snapshots_branch: main
44
ota_engine_versions_branch: main

roles/engine/tasks/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
- name: Install services declarations
2020
ansible.builtin.git:
21-
repo: '{{ app_config.services.repository }}'
21+
repo: '{{ ota_engine_app_config.services.repository }}'
2222
dest: '/home/{{ ansible_user }}/{{ ota_engine_declarations_directory }}'
2323
version: '{{ ota_engine_declarations_branch }}'
2424
force: true
@@ -76,21 +76,21 @@
7676

7777
- name: Setup snapshots git repository
7878
ansible.builtin.include_tasks: database.yml
79-
when: app_config.recorder.snapshots.storage.git.repository is defined
79+
when: ota_engine_app_config.recorder.snapshots.storage.git.repository is defined
8080
vars:
8181
engine_database_name: snapshots
82-
engine_database_repository: '{{ app_config.recorder.snapshots.storage.git.repository }}'
82+
engine_database_repository: '{{ ota_engine_app_config.recorder.snapshots.storage.git.repository }}'
8383
engine_database_branch: '{{ ota_engine_snapshots_branch }}'
84-
engine_database_directory: '/home/{{ ansible_user }}/{{ ota_engine_declarations_directory }}/{{ app_config.recorder.snapshots.storage.git.path }}'
84+
engine_database_directory: '/home/{{ ansible_user }}/{{ ota_engine_declarations_directory }}/{{ ota_engine_app_config.recorder.snapshots.storage.git.path }}'
8585

8686
- name: Setup versions git repository
8787
ansible.builtin.include_tasks: database.yml
88-
when: app_config.recorder.versions.storage.git.repository is defined
88+
when: ota_engine_app_config.recorder.versions.storage.git.repository is defined
8989
vars:
9090
engine_database_name: versions
91-
engine_database_repository: '{{ app_config.recorder.versions.storage.git.repository }}'
91+
engine_database_repository: '{{ ota_engine_app_config.recorder.versions.storage.git.repository }}'
9292
engine_database_branch: '{{ ota_engine_versions_branch }}'
93-
engine_database_directory: '/home/{{ ansible_user }}/{{ ota_engine_declarations_directory }}/{{ app_config.recorder.versions.storage.git.path }}'
93+
engine_database_directory: '/home/{{ ansible_user }}/{{ ota_engine_declarations_directory }}/{{ ota_engine_app_config.recorder.versions.storage.git.path }}'
9494

9595
- name: Start Open Terms Archive schedulers
9696
ansible.builtin.command:

roles/engine/templates/nginx-conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
location / {
88
# Allowing for a `burst` of up to 5 requests beyond the specified rate limit. The `nodelay` parameter ensures that excessive requests beyond the burst limit are immediately rejected with a 429 error response instead of being queued. See https://www.nginx.com/blog/rate-limiting-nginx/.
99
limit_req zone=limited burst=5 nodelay;
10-
proxy_pass http://localhost:{{ app_config.api.port }};
10+
proxy_pass http://localhost:{{ ota_engine_app_config.api.port }};
1111
proxy_redirect off;
1212
}
1313
}

roles/federated_api/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
- name: Save production config data into a variable
3333
set_fact:
34-
app_config: "{{ read_config.stdout | from_json }}"
34+
ota_federated_api_app_config: "{{ read_config.stdout | from_json }}"
3535

3636
- name: Install dependencies
3737
ansible.builtin.command:

roles/federated_api/templates/nginx-conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
location / {
88
# Allowing for a `burst` of up to 5 requests beyond the specified rate limit. The `nodelay` parameter ensures that excessive requests beyond the burst limit are immediately rejected with a 429 error response instead of being queued. See https://www.nginx.com/blog/rate-limiting-nginx/.
99
limit_req zone=limited burst=5 nodelay;
10-
proxy_pass http://localhost:{{ app_config.port }};
10+
proxy_pass http://localhost:{{ ota_federated_api_app_config.port }};
1111
proxy_redirect off;
1212
}
1313
}

0 commit comments

Comments
 (0)