Explorar el Código

openstack_fixes

- move openstack user-data content into heat template
Jason DeTiberus hace 9 años
padre
commit
3b0ef37a38

+ 16 - 3
playbooks/openstack/openshift-cluster/config.yml

@@ -1,8 +1,21 @@
 ---
+- hosts: localhost
+  gather_facts: no
+  tasks:
+  - include_vars: vars.yml
+  - include_vars: cluster_hosts.yml
+  - add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: "{{ g_all_hosts }}"
+
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  - include_vars: vars.yml
+  - include_vars: cluster_hosts.yml
+
 - include: ../../common/openshift-cluster/config.yml
-  vars_files:
-  - ../../openstack/openshift-cluster/vars.yml
-  - ../../openstack/openshift-cluster/cluster_hosts.yml
   vars:
     g_nodeonmaster: true
     g_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"

+ 7 - 1
playbooks/openstack/openshift-cluster/files/heat_stack.yaml

@@ -591,11 +591,17 @@ resources:
     type: OS::Heat::MultipartMime
     properties:
       parts:
-        - config: { get_file: user-data }
         - config:
             str_replace:
               template: |
                 #cloud-config
+                disable_root: true
+
+                system_info:
+                  default_user:
+                    name: openshift
+                    sudo: ["ALL=(ALL) NOPASSWD: ALL"]
+
                 write_files:
                   - path: /etc/sudoers.d/00-openshift-no-requiretty
                     permissions: 440

+ 0 - 13
playbooks/openstack/openshift-cluster/files/user-data

@@ -1,13 +0,0 @@
-#cloud-config
-disable_root: true
-
-system_info:
-  default_user:
-    name: openshift
-    sudo: ["ALL=(ALL) NOPASSWD: ALL"]
-
-write_files:
-  - path: /etc/sudoers.d/00-openshift-no-requiretty
-    permissions: 440
-    content: |
-      Defaults:openshift !requiretty

+ 16 - 3
playbooks/openstack/openshift-cluster/update.yml

@@ -1,4 +1,20 @@
 ---
+- hosts: localhost
+  gather_facts: no
+  tasks:
+  - include_vars: vars.yml
+  - include_vars: cluster_hosts.yml
+  - add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: "{{ g_all_hosts }}"
+
+- hosts: l_oo_all_hosts
+  gather_facts: no
+  tasks:
+  - include_vars: vars.yml
+  - include_vars: cluster_hosts.yml
+
 - include: dns.yml
 
 - name: Populate oo_hosts_to_update group
@@ -6,9 +22,6 @@
   connection: local
   become: no
   gather_facts: no
-  vars_files:
-  - vars.yml
-  - cluster_hosts.yml
   tasks:
   - name: Evaluate oo_hosts_to_update
     add_host: