xci: osa: Simplify OpenStack host playbooks 79/53979/4
authorMarkos Chandras <mchandras@suse.de>
Fri, 16 Mar 2018 11:45:14 +0000 (11:45 +0000)
committerFatih Degirmenci <fdegir@gmail.com>
Sat, 17 Mar 2018 09:03:07 +0000 (10:03 +0100)
The configure-targethost playbook is configuring all the OSA hosts so
we can simplify all that by introducing a new 'openstack' host group
with the controller and the compute nodes and configure all of them
in parallel.

Change-Id: I21f8709e7649b041575dab45fc4e070aa01e0a6f
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/installer/osa/files/ha/inventory
xci/installer/osa/files/mini/inventory
xci/installer/osa/files/noha/inventory
xci/installer/osa/playbooks/configure-opnfvhost.yml
xci/installer/osa/playbooks/configure-targethosts.yml

index 1ef4502..f5d882e 100644 (file)
@@ -9,3 +9,7 @@ controller02 ansible_ssh_host=192.168.122.5
 [compute]
 compute00 ansible_ssh_host=192.168.122.6
 compute01 ansible_ssh_host=192.168.122.7
+
+[openstack:children]
+controller
+compute
index 63a1bfa..4224131 100644 (file)
@@ -6,3 +6,7 @@ controller00 ansible_ssh_host=192.168.122.3
 
 [compute]
 compute00 ansible_ssh_host=192.168.122.4
+
+[openstack:children]
+controller
+compute
index 90b3153..0e3b8d8 100644 (file)
@@ -7,3 +7,7 @@ controller00 ansible_ssh_host=192.168.122.3
 [compute]
 compute00 ansible_ssh_host=192.168.122.4
 compute01 ansible_ssh_host=192.168.122.5
+
+[openstack:children]
+controller
+compute
index 8255995..8829f27 100644 (file)
         src: "{{ ansible_env.HOME }}/openrc"
         dest: "{{ XCI_PATH }}/.cache/openrc"
         flat: true
+
+    - name: add public key to host
+      copy:
+        src: "{{ XCI_PATH }}/xci/files/authorized_keys"
+        dest: /root/.ssh/authorized_keys
index ad8bafc..31c3e02 100644 (file)
@@ -1,18 +1,5 @@
 ---
-- hosts: all
-  remote_user: root
-  tasks:
-    - name: add public key to host
-      copy:
-        src: "{{ XCI_PATH }}/xci/files/authorized_keys"
-        dest: /root/.ssh/authorized_keys
-
-    - name: fetch xci environment
-      copy:
-        src: "{{ XCI_PATH }}/.cache/xci.env"
-        dest: /root/xci.env
-
-- hosts: controller
+- hosts: openstack
   remote_user: root
   vars_files:
     - "{{ XCI_PATH }}/xci/var/opnfv.yml"
         - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
   roles:
     - role: bootstrap-host
-
-- hosts: compute
-  remote_user: root
-  vars_files:
-    - "{{ XCI_PATH }}/xci/var/opnfv.yml"
-
-  pre_tasks:
-    - name: Load distribution variables
-      include_vars:
-        file: "{{ item }}"
-      with_items:
-        - "{{ XCI_PATH }}/xci/var/{{ ansible_os_family }}.yml"
-        - "{{ XCI_FLAVOR_ANSIBLE_FILE_PATH }}/flavor-vars.yml"
-  roles:
-    - role: bootstrap-host
-    - role: configure-ceph
-      when: XCI_CEPH_ENABLED == "true"
-
-- hosts: compute00
-  remote_user: root
-  roles:
     - role: configure-nfs
+      when:
+        - "'compute' in group_names"
+    - role: configure-ceph
+      when:
+        - XCI_CEPH_ENABLED == "true"
+        - "'compute' in group_names"
+  tasks:
+    - name: add public key to host
+      copy:
+        src: "{{ XCI_PATH }}/xci/files/authorized_keys"
+        dest: /root/.ssh/authorized_keys