aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorSean Mooney <sean.k.mooney@intel.com>2016-08-03 14:25:52 +0000
committerSean Mooney <sean.k.mooney@intel.com>2016-08-31 13:12:20 +0000
commit538dbac24a86d21f28191f503e2daa3b89c1ed5b (patch)
treeffdb287a8adab1e9d21d9681d2430c4a6196916d /ansible
parent96b3f0ae3e547f586eb1b1e003e015a664639d16 (diff)
downloadkolla-538dbac24a86d21f28191f503e2daa3b89c1ed5b.tar.gz
kolla-538dbac24a86d21f28191f503e2daa3b89c1ed5b.zip
adds bifrost ssh key generation
- This change extend the genpwd.py command to generate an ssh key pair bifrost. - This change bifrost config and bootstrap task to install the generated keys. - This change updates the bifrost guide to discribe how to provide your own key. Change-Id: I05243f58843d9195cace253dff5628fae89c78e8 Implements: blueprint bifrost-support
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/bifrost/tasks/bootstrap.yml19
-rw-r--r--ansible/roles/bifrost/tasks/config.yml9
-rw-r--r--ansible/roles/bifrost/templates/id_rsa1
-rw-r--r--ansible/roles/bifrost/templates/id_rsa.pub1
-rw-r--r--ansible/roles/bifrost/templates/ssh_config3
5 files changed, 33 insertions, 0 deletions
diff --git a/ansible/roles/bifrost/tasks/bootstrap.yml b/ansible/roles/bifrost/tasks/bootstrap.yml
index d4cb0fa79..8332c1d9e 100644
--- a/ansible/roles/bifrost/tasks/bootstrap.yml
+++ b/ansible/roles/bifrost/tasks/bootstrap.yml
@@ -7,3 +7,22 @@
ansible-playbook -vvvv -i /bifrost/playbooks/inventory/localhost
/bifrost/playbooks/install.yaml -e @/etc/bifrost/bifrost.yml
-e @/etc/bifrost/dib.yml -e skip_package_install=true'
+- name: installing ssh keys
+ command: >
+ docker exec bifrost_deploy
+ bash -c 'mkdir /root/.ssh ; mkdir /home/ironic/.ssh;
+ cp -f /etc/bifrost/id_rsa /root/.ssh/id_rsa &&
+ cp -f /etc/bifrost/id_rsa.pub /root/.ssh/id_rsa.pub &&
+ cp -f /etc/bifrost/ssh_config /root/.ssh/config &&
+ cp -f /etc/bifrost/id_rsa /home/ironic/.ssh/id_rsa &&
+ cp -f /etc/bifrost/id_rsa.pub /home/ironic/.ssh/id_rsa.pub &&
+ cp -f /etc/bifrost/ssh_config /home/ironic/.ssh/config &&
+ chmod 600 /root/.ssh/id_rsa &&
+ chmod 600 /root/.ssh/id_rsa.pub &&
+ chmod 600 /root/.ssh/config &&
+ chmod 600 /home/ironic/.ssh/id_rsa &&
+ chmod 600 /home/ironic/.ssh/id_rsa.pub &&
+ chmod 600 /home/ironic/.ssh/config &&
+ chown ironic:ironic /home/ironic/.ssh/id_rsa &&
+ chown ironic:ironic /home/ironic/.ssh/id_rsa.pub &&
+ chown ironic:ironic /home/ironic/.ssh/config'
diff --git a/ansible/roles/bifrost/tasks/config.yml b/ansible/roles/bifrost/tasks/config.yml
index 8a66523bc..14bcbb267 100644
--- a/ansible/roles/bifrost/tasks/config.yml
+++ b/ansible/roles/bifrost/tasks/config.yml
@@ -19,3 +19,12 @@
- "dib"
- "servers"
+- name: template ssh keys
+ template:
+ src: "{{ item.src }}"
+ dest: "{{ node_config_directory }}/bifrost/{{ item.dest }}"
+ with_items:
+ - { src: "id_rsa", dest: "id_rsa" }
+ - { src: "id_rsa.pub", dest: "id_rsa.pub" }
+ - { src: "ssh_config", dest: "ssh_config" }
+
diff --git a/ansible/roles/bifrost/templates/id_rsa b/ansible/roles/bifrost/templates/id_rsa
new file mode 100644
index 000000000..d1d3a9ed4
--- /dev/null
+++ b/ansible/roles/bifrost/templates/id_rsa
@@ -0,0 +1 @@
+{{ bifrost_ssh_key.private_key }}
diff --git a/ansible/roles/bifrost/templates/id_rsa.pub b/ansible/roles/bifrost/templates/id_rsa.pub
new file mode 100644
index 000000000..173bbb204
--- /dev/null
+++ b/ansible/roles/bifrost/templates/id_rsa.pub
@@ -0,0 +1 @@
+{{ bifrost_ssh_key.public_key }}
diff --git a/ansible/roles/bifrost/templates/ssh_config b/ansible/roles/bifrost/templates/ssh_config
new file mode 100644
index 000000000..41dff51a6
--- /dev/null
+++ b/ansible/roles/bifrost/templates/ssh_config
@@ -0,0 +1,3 @@
+Host *
+ StrictHostKeyChecking no
+ UserKnownHostsFile /dev/null