diff --git a/tsg-9140-scripts/roles/tsg-os-provision/files/tsg-os-provision/tasks/provision.yml b/tsg-9140-scripts/roles/tsg-os-provision/files/tsg-os-provision/tasks/provision.yml index a51ed46d..1566d47c 100644 --- a/tsg-9140-scripts/roles/tsg-os-provision/files/tsg-os-provision/tasks/provision.yml +++ b/tsg-9140-scripts/roles/tsg-os-provision/files/tsg-os-provision/tasks/provision.yml @@ -86,6 +86,23 @@ dest: /opt/tsg/tfe/conf/pangu/pangu_pxy.conf tags: tfe + - name: "mkdir /opt/tsg/etc/" + file: + path: /opt/tsg/etc + state: directory + + - name: "tsg-os-provision: template the tsg_device_tag" + template: + src: "../templates/tsg_device_tag.json.j2" + dest: /opt/tsg/etc/tsg_device_tag.json + tags: tsg_device_tag + + - name: "tsg-os-provision: template the tsg_sn" + template: + src: "../templates/tsg_sn.json.j2" + dest: /opt/tsg/etc/tsg_sn.json + tags: tsg_sn + - name: "tsg-os-provision: snapshot the stage2 config files" copy: src: /data/tsg-os-provision/provision.yml diff --git a/tsg-9140-scripts/roles/tsg_device_tag/tasks/main.yml b/tsg-9140-scripts/roles/tsg_device_tag/tasks/main.yml new file mode 100644 index 00000000..7f9699c3 --- /dev/null +++ b/tsg-9140-scripts/roles/tsg_device_tag/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: "Template the tsg_device_tag.json.j2" + template: + src: "{{ role_path }}/templates/tsg_device_tag.json.j2.j2" + dest: /opt/tsg/tsg-os-provision/templates/tsg_device_tag.json.j2 + tags: template diff --git a/tsg-9140-scripts/roles/tsg_device_tag/templates/tsg_device_tag.json.j2.j2 b/tsg-9140-scripts/roles/tsg_device_tag/templates/tsg_device_tag.json.j2.j2 new file mode 100644 index 00000000..1526e2c0 --- /dev/null +++ b/tsg-9140-scripts/roles/tsg_device_tag/templates/tsg_device_tag.json.j2.j2 @@ -0,0 +1,4 @@ +[MAAT] +{% raw %} +ACCEPT_TAGS={"tags":[{"tag":"data_center","value":"{{ data_center }}"}]} +{% endraw %} diff --git a/tsg-9140-scripts/roles/tsg_sn/tasks/main.yml b/tsg-9140-scripts/roles/tsg_sn/tasks/main.yml new file mode 100644 index 00000000..708daad1 --- /dev/null +++ b/tsg-9140-scripts/roles/tsg_sn/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: "Template the tsg_sn.json.j2.j2" + template: + src: "{{ role_path }}/templates/tsg_sn.json.j2.j2" + dest: /opt/tsg/tsg-os-provision/templates/tsg_sn.json.j2 + tags: template \ No newline at end of file diff --git a/tsg-9140-scripts/roles/tsg_sn/templates/tsg_sn.json.j2.j2 b/tsg-9140-scripts/roles/tsg_sn/templates/tsg_sn.json.j2.j2 new file mode 100644 index 00000000..44f813a3 --- /dev/null +++ b/tsg-9140-scripts/roles/tsg_sn/templates/tsg_sn.json.j2.j2 @@ -0,0 +1,5 @@ +{ +{% raw %} + "sn": "{{ tsg_sn }}" +{% endraw %} +} \ No newline at end of file diff --git a/tsg-9140-scripts/tsg_9140_deploy.yml b/tsg-9140-scripts/tsg_9140_deploy.yml index dba38ddf..6dde2cca 100644 --- a/tsg-9140-scripts/tsg_9140_deploy.yml +++ b/tsg-9140-scripts/tsg_9140_deploy.yml @@ -6,6 +6,8 @@ roles: #- {role: init-env, tags: init-env} - {role: tsg-os-provision, tags: tsg-os-provision} + - {role: tsg_device_tag, tags: tsg_device_tag} + - {role: tsg_sn, tags: tsg_sn} - {role: framework, tags: framework} #- {role: kernel-ml, tags: kernel-ml} - {role: mrzcpd, tags: mrzcpd}