step reorg
diff --git a/roles/create-vms/tasks/main.yml b/roles/create-vms/tasks/main.yml
index 5c42a20..f830fde 100644
--- a/roles/create-vms/tasks/main.yml
+++ b/roles/create-vms/tasks/main.yml
@@ -49,3 +49,8 @@
- name: Verify that we can log into every VM after restarting network interfaces
command: ansible services -m ping -u ubuntu
+# sshkey is registered in head-prep task
+- name: Enable root ssh login on VM's that need it
+ command: ansible {{ item.name }} -b -u ubuntu -m authorized_key -a "user='root' key='{{ sshkey.stdout }}'"
+ with_items: "{{ head_vm_list | selectattr('root_ssh_login', 'defined') | list }}"
+
diff --git a/roles/juju-setup/templates/eth0.cfg.j2 b/roles/create-vms/templates/eth0.cfg.j2
similarity index 100%
rename from roles/juju-setup/templates/eth0.cfg.j2
rename to roles/create-vms/templates/eth0.cfg.j2
diff --git a/roles/juju-setup/files/ansible.cfg b/roles/head-prep/files/ansible.cfg
similarity index 78%
rename from roles/juju-setup/files/ansible.cfg
rename to roles/head-prep/files/ansible.cfg
index dd43d2b..7fa4a86 100644
--- a/roles/juju-setup/files/ansible.cfg
+++ b/roles/head-prep/files/ansible.cfg
@@ -1,2 +1,4 @@
[defaults]
host_key_checking = false
+forks=20
+
diff --git a/roles/head-prep/tasks/main.yml b/roles/head-prep/tasks/main.yml
index 5a51ebf..768390e 100644
--- a/roles/head-prep/tasks/main.yml
+++ b/roles/head-prep/tasks/main.yml
@@ -50,3 +50,16 @@
user={{ ansible_user_id }}
key="{{ sshkey.stdout }}"
+- name: Disable host key checking in ~/.ssh/config
+ lineinfile:
+ dest={{ ansible_user_dir }}/.ssh/config
+ line="StrictHostKeyChecking no"
+ create=yes
+ owner={{ ansible_user_id }} mode=0600
+
+- name: Disable host key checking in ~/.ansible.cfg
+ copy:
+ src=ansible.cfg
+ dest={{ ansible_user_dir }}/.ansible.cfg
+ owner={{ ansible_user_id }} mode=0644
+
diff --git a/roles/juju-setup/tasks/main.yml b/roles/juju-setup/tasks/main.yml
index acbae5e..279049d 100644
--- a/roles/juju-setup/tasks/main.yml
+++ b/roles/juju-setup/tasks/main.yml
@@ -1,18 +1,6 @@
---
# roles/juju-setup/main/tasks.yml
-- name: Disable host key checking in ~/.ssh/config
- lineinfile:
- dest={{ ansible_user_dir }}/.ssh/config
- line="StrictHostKeyChecking no"
- create=yes
- mode=0600
-
-- name: Disable host key checking in ~/.ansible.cfg
- copy:
- src=ansible.cfg
- dest={{ ansible_user_dir }}/.ansible.cfg
-
# sshkey is registered in head-prep task
- name: Enable root ssh login on VM's that need it
command: ansible {{ item.name }} -b -u ubuntu -m authorized_key -a "user='root' key='{{ sshkey.stdout }}'"