CORD-1151
Make cord_dir and cord_profile_dir local to config node
use head_* and config_* prefixes to avoid hardcoding paths
config-side ssh key generation+
fix frontend & mock builds
[build] group in inventory
fix inventory strangeness
raise privs when creating ssh_pki_dir
move admin-openrc.sh.j2 to cord-profile
add copy-cord-playbook.yml, clarify where it runs
fix paths for head_cord_profile_dir with mock/frontend
use /opt/cord_profile/admin-openrc.sh rather than ~/admin-openrc.sh
install pki
make comment in do-enlist-compute-node accurate, set correct interface
remove hardcoded credential path
logging and ssh key fixes
Change-Id: Ie7560c911dce1558e09806c9997884dfbd475e9c
diff --git a/roles/exampleservice-config/defaults/main.yml b/roles/exampleservice-config/defaults/main.yml
index 82098e0..0ce1f31 100644
--- a/roles/exampleservice-config/defaults/main.yml
+++ b/roles/exampleservice-config/defaults/main.yml
@@ -1,6 +1,6 @@
---
# exampleservice-config/defaults/main.yml
-cord_dir: "{{ ansible_user_dir + '/cord' }}"
-cord_profile_dir: "{{ ansible_user_dir + '/cord_profile' }}"
-
+# As a test, this is assumed to entirely run on the head node
+head_cord_dir: "/opt/cord"
+head_cord_profile_dir: "/opt/cord_profile"
diff --git a/roles/exampleservice-config/tasks/main.yml b/roles/exampleservice-config/tasks/main.yml
index dc21c17..c07838c 100644
--- a/roles/exampleservice-config/tasks/main.yml
+++ b/roles/exampleservice-config/tasks/main.yml
@@ -6,7 +6,7 @@
remote_src: True # file is local to the remote machine
force: False # only copy if destination file doesn't exist
src: "/dev/null"
- dest: "{{ cord_profile_dir }}/key_import/{{ item }}"
+ dest: "{{ head_cord_profile_dir }}/key_import/{{ item }}"
mode: 0600
with_items:
- exampleservice_rsa
@@ -14,16 +14,16 @@
- name: Copy exampleservice onboarding TOSCA files to cord_profile
copy:
- src: "{{ cord_dir }}/orchestration/xos_services/exampleservice/xos/exampleservice-onboard.yaml"
- dest: "{{ cord_profile_dir }}/exampleservice-onboard.yaml"
+ src: "{{ head_cord_dir }}/orchestration/xos_services/exampleservice/xos/exampleservice-onboard.yaml"
+ dest: "{{ head_cord_profile_dir }}/exampleservice-onboard.yaml"
- name: TOSCA to mount exampleservice volume in XOS container
template:
src: "xos-exampleservice.yaml.j2"
- dest: "{{ cord_profile_dir }}/xos-exampleservice.yaml"
+ dest: "{{ head_cord_profile_dir }}/xos-exampleservice.yaml"
- name: TOSCA to create exampleservice test config
template:
src: "test-exampleservice.yaml.j2"
- dest: "{{ cord_profile_dir }}/test-exampleservice.yaml"
+ dest: "{{ head_cord_profile_dir }}/test-exampleservice.yaml"
diff --git a/roles/exampleservice-config/templates/xos-exampleservice.yaml.j2 b/roles/exampleservice-config/templates/xos-exampleservice.yaml.j2
index 441e075..1baba82 100644
--- a/roles/exampleservice-config/templates/xos-exampleservice.yaml.j2
+++ b/roles/exampleservice-config/templates/xos-exampleservice.yaml.j2
@@ -15,7 +15,7 @@
/opt/xos_services/exampleservice:
type: tosca.nodes.XOSVolume
properties:
- host_path: "{{ cord_dir }}/orchestration/xos_services/exampleservice"
+ host_path: "{{ head_cord_dir }}/orchestration/xos_services/exampleservice"
read_only: True
requirements:
- xos: