summaryrefslogtreecommitdiffstats
path: root/prototypes/xci/playbooks/configure-opnfvhost.yml
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-05-10 11:37:38 +0100
committerMarkos Chandras <mchandras@suse.de>2017-05-11 23:42:12 +0100
commit723d3bfe75a2007b6316e4f4fb4d4e7d7ac266ea (patch)
tree1ca25d3e94b476dd287022f1564c2768f2d617f8 /prototypes/xci/playbooks/configure-opnfvhost.yml
parent21f9500be4da1332fdd41260a3e1f4761f857219 (diff)
prototypes: xci: Move host keys away from / directory
Putting the host keys in '/' requires root privileges so it's best if we place them in the same directory like the rest of the XCI files. Change-Id: I030ed3d6cbb57bb984a78aeffb4eca2bd5c10bb0 Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'prototypes/xci/playbooks/configure-opnfvhost.yml')
-rw-r--r--prototypes/xci/playbooks/configure-opnfvhost.yml10
1 files changed, 8 insertions, 2 deletions
diff --git a/prototypes/xci/playbooks/configure-opnfvhost.yml b/prototypes/xci/playbooks/configure-opnfvhost.yml
index 28e6b2178..af90c9dc0 100644
--- a/prototypes/xci/playbooks/configure-opnfvhost.yml
+++ b/prototypes/xci/playbooks/configure-opnfvhost.yml
@@ -55,8 +55,12 @@
shell: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N ""
args:
creates: /root/.ssh/id_rsa
+ - name: ensure ssh key storage directory exists
+ file:
+ path: "{{ OPNFV_SSH_HOST_KEYS_PATH }}"
+ state: directory
- name: fetch public key
- fetch: src="/root/.ssh/id_rsa.pub" dest="/"
+ fetch: src="/root/.ssh/id_rsa.pub" dest="{{ OPNFV_SSH_HOST_KEYS_PATH }}"
- name: copy flavor inventory
shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/inventory {{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks"
- name: copy flavor vars
@@ -89,8 +93,10 @@
chdir: "{{OPENSTACK_OSA_PATH}}/scripts"
- hosts: localhost
remote_user: root
+ vars_files:
+ - ../var/opnfv.yml
tasks:
- name: Generate authorized_keys
- shell: "/bin/cat /opnfv/root/.ssh/id_rsa.pub >> ../file/authorized_keys"
+ shell: "/bin/cat {{ OPNFV_SSH_HOST_KEYS_PATH }}/opnfv/root/.ssh/id_rsa.pub >> ../file/authorized_keys"
- name: Append public keys to authorized_keys
shell: "/bin/cat /root/.ssh/id_rsa.pub >> ../file/authorized_keys"