summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-09-17 11:35:57 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2021-09-23 09:41:50 +0000
commitf06a9ff1afc7544c1b38b8acf39bcad6cecf04a0 (patch)
tree382698a0be247efaa83a5729dfdc548ab7b52955 /ansible
parent527a1e7493e30bc01a4b1384ce215ddce9cef58c (diff)
[ANSIBLE] Setup config file containing resources dir full path
Such config might be handy in scenarios where user defined scripts populated with offline-platform require to leverage the full path to resources directory on infra node. Change-Id: I5b4468ef7b396d2583ad64255679a29f3ff675b4 Issue-ID: OOM-2835 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com> (cherry picked from commit 38f3b8f533159118bf393232cb341a9f8a353e82)
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/resource-data/defaults/main.yml1
-rw-r--r--ansible/roles/resource-data/tasks/main.yml6
-rw-r--r--ansible/roles/resource-data/templates/resources.cfg.j21
3 files changed, 8 insertions, 0 deletions
diff --git a/ansible/roles/resource-data/defaults/main.yml b/ansible/roles/resource-data/defaults/main.yml
index 5905ad42..962bf102 100644
--- a/ansible/roles/resource-data/defaults/main.yml
+++ b/ansible/roles/resource-data/defaults/main.yml
@@ -1,2 +1,3 @@
---
resources_on_nfs: false
+resources_cfg_path: /etc/default/resources.cfg
diff --git a/ansible/roles/resource-data/tasks/main.yml b/ansible/roles/resource-data/tasks/main.yml
index 023a160e..74e647f2 100644
--- a/ansible/roles/resource-data/tasks/main.yml
+++ b/ansible/roles/resource-data/tasks/main.yml
@@ -41,3 +41,9 @@
when:
- inventory_hostname in groups.infrastructure
- hostvars[groups.resources.0].to_be_uploaded_resources_list is defined
+
+- name: Store resources location in cfg file
+ template:
+ src: resources.cfg.j2
+ dest: "{{ resources_cfg_path }}"
+ when: inventory_hostname in groups.infrastructure
diff --git a/ansible/roles/resource-data/templates/resources.cfg.j2 b/ansible/roles/resource-data/templates/resources.cfg.j2
new file mode 100644
index 00000000..74f87761
--- /dev/null
+++ b/ansible/roles/resource-data/templates/resources.cfg.j2
@@ -0,0 +1 @@
+APP_DATA_PATH={{ app_data_path }}