Bläddra i källkod

Merge pull request #3895 from mtnbikenc/playbook-refactor

Merged by openshift-bot
OpenShift Bot 8 år sedan
förälder
incheckning
92723e8a64
35 ändrade filer med 109 tillägg och 187 borttagningar
  1. 4 0
      playbooks/byo/openshift-cluster/config.yml
  2. 1 23
      playbooks/byo/openshift-cluster/enable_dnsmasq.yml
  3. 24 0
      playbooks/byo/openshift-cluster/initialize_groups.yml
  4. 1 23
      playbooks/byo/openshift-cluster/openshift-logging.yml
  5. 4 0
      playbooks/byo/openshift-cluster/redeploy-certificates.yml
  6. 4 0
      playbooks/byo/openshift-cluster/redeploy-etcd-certificates.yml
  7. 4 0
      playbooks/byo/openshift-cluster/redeploy-master-certificates.yml
  8. 4 0
      playbooks/byo/openshift-cluster/redeploy-node-certificates.yml
  9. 4 0
      playbooks/byo/openshift-cluster/redeploy-openshift-ca.yml
  10. 4 0
      playbooks/byo/openshift-cluster/redeploy-registry-certificates.yml
  11. 4 0
      playbooks/byo/openshift-cluster/redeploy-router-certificates.yml
  12. 1 23
      playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml
  13. 1 23
      playbooks/byo/openshift-cluster/upgrades/upgrade_etcd.yml
  14. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade.yml
  15. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade_control_plane.yml
  16. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade_nodes.yml
  17. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade.yml
  18. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade_control_plane.yml
  19. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade_nodes.yml
  20. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade.yml
  21. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade_control_plane.yml
  22. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade_nodes.yml
  23. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_6/upgrade.yml
  24. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_6/upgrade_control_plane.yml
  25. 2 0
      playbooks/byo/openshift-cluster/upgrades/v3_6/upgrade_nodes.yml
  26. 4 0
      playbooks/byo/openshift-etcd/restart.yml
  27. 4 0
      playbooks/byo/openshift-master/restart.yml
  28. 1 23
      playbooks/byo/openshift-master/scaleup.yml
  29. 4 0
      playbooks/byo/openshift-node/restart.yml
  30. 1 23
      playbooks/byo/openshift-node/scaleup.yml
  31. 4 0
      playbooks/byo/openshift_facts.yml
  32. 4 0
      playbooks/byo/rhel_subscribe.yml
  33. 3 1
      playbooks/common/openshift-cluster/openshift_logging.yml
  34. 0 24
      playbooks/common/openshift-cluster/std_include.yml
  35. 0 24
      playbooks/common/openshift-cluster/upgrades/init.yml

+ 4 - 0
playbooks/byo/openshift-cluster/config.yml

@@ -1,4 +1,8 @@
 ---
+- include: initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 1 - 23
playbooks/byo/openshift-cluster/enable_dnsmasq.yml

@@ -1,26 +1,4 @@
 ---
-- name: Create initial host groups for localhost
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
-  - name: Evaluate group l_oo_all_hosts
-    add_host:
-      name: "{{ item }}"
-      groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts | default([]) }}"
-    changed_when: False
-
-- name: Create initial host groups for all hosts
-  hosts: l_oo_all_hosts
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
+- include: initialize_groups.yml
 
 - include: ../../common/openshift-cluster/enable_dnsmasq.yml

+ 24 - 0
playbooks/byo/openshift-cluster/initialize_groups.yml

@@ -0,0 +1,24 @@
+---
+- name: Create initial host groups for localhost
+  hosts: localhost
+  connection: local
+  become: no
+  gather_facts: no
+  tags:
+  - always
+  tasks:
+  - include_vars: cluster_hosts.yml
+  - name: Evaluate group l_oo_all_hosts
+    add_host:
+      name: "{{ item }}"
+      groups: l_oo_all_hosts
+    with_items: "{{ g_all_hosts | default([]) }}"
+    changed_when: no
+
+- name: Create initial host groups for all hosts
+  hosts: l_oo_all_hosts
+  gather_facts: no
+  tags:
+  - always
+  tasks:
+  - include_vars: cluster_hosts.yml

+ 1 - 23
playbooks/byo/openshift-cluster/openshift-logging.yml

@@ -4,29 +4,7 @@
 # Hosted logging on.  See inventory/byo/hosts.*.example for the
 # currently supported method.
 #
-- name: Create initial host groups for localhost
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
-  - name: Evaluate group l_oo_all_hosts
-    add_host:
-      name: "{{ item }}"
-      groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts | default([]) }}"
-    changed_when: False
-
-- name: Create initial host groups for all hosts
-  hosts: l_oo_all_hosts
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
+- include: initialize_groups.yml
 
 - include: ../../common/openshift-cluster/openshift_logging.yml
   vars:

+ 4 - 0
playbooks/byo/openshift-cluster/redeploy-certificates.yml

@@ -1,4 +1,8 @@
 ---
+- include: initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 4 - 0
playbooks/byo/openshift-cluster/redeploy-etcd-certificates.yml

@@ -1,4 +1,8 @@
 ---
+- include: initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 4 - 0
playbooks/byo/openshift-cluster/redeploy-master-certificates.yml

@@ -1,4 +1,8 @@
 ---
+- include: initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 4 - 0
playbooks/byo/openshift-cluster/redeploy-node-certificates.yml

@@ -1,4 +1,8 @@
 ---
+- include: initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 4 - 0
playbooks/byo/openshift-cluster/redeploy-openshift-ca.yml

@@ -1,4 +1,8 @@
 ---
+- include: initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 4 - 0
playbooks/byo/openshift-cluster/redeploy-registry-certificates.yml

@@ -1,4 +1,8 @@
 ---
+- include: initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 4 - 0
playbooks/byo/openshift-cluster/redeploy-router-certificates.yml

@@ -1,4 +1,8 @@
 ---
+- include: initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 1 - 23
playbooks/byo/openshift-cluster/upgrades/docker/upgrade.yml

@@ -1,27 +1,5 @@
 ---
 # Playbook to upgrade Docker to the max allowable version for an OpenShift cluster.
-- name: Create initial host groups for localhost
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../cluster_hosts.yml
-  - name: Evaluate group l_oo_all_hosts
-    add_host:
-      name: "{{ item }}"
-      groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts | default([]) }}"
-    changed_when: False
-
-- name: Create initial host groups for all hosts
-  hosts: l_oo_all_hosts
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../cluster_hosts.yml
+- include: ../../initialize_groups.yml
 
 - include: ../../../../common/openshift-cluster/upgrades/docker/docker_upgrade.yml

+ 1 - 23
playbooks/byo/openshift-cluster/upgrades/upgrade_etcd.yml

@@ -1,26 +1,4 @@
 ---
-- name: Create initial host groups for localhost
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../cluster_hosts.yml
-  - name: Evaluate group l_oo_all_hosts
-    add_host:
-      name: "{{ item }}"
-      groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts | default([]) }}"
-    changed_when: False
-
-- name: Create initial host groups for all hosts
-  hosts: l_oo_all_hosts
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../cluster_hosts.yml
+- include: ../initialize_groups.yml
 
 - include: ../../../common/openshift-cluster/upgrades/etcd/main.yml

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade.yml

@@ -2,6 +2,8 @@
 #
 # Full Control Plane + Nodes Upgrade
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade_control_plane.yml

@@ -11,6 +11,8 @@
 #
 # You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_3/upgrade_nodes.yml

@@ -4,6 +4,8 @@
 #
 # Upgrades nodes only, but requires the control plane to have already been upgraded.
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade.yml

@@ -2,6 +2,8 @@
 #
 # Full Control Plane + Nodes Upgrade
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade_control_plane.yml

@@ -11,6 +11,8 @@
 #
 # You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade_nodes.yml

@@ -4,6 +4,8 @@
 #
 # Upgrades nodes only, but requires the control plane to have already been upgraded.
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade.yml

@@ -2,6 +2,8 @@
 #
 # Full Control Plane + Nodes Upgrade
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade_control_plane.yml

@@ -11,6 +11,8 @@
 #
 # You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_5/upgrade_nodes.yml

@@ -4,6 +4,8 @@
 #
 # Upgrades nodes only, but requires the control plane to have already been upgraded.
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_6/upgrade.yml

@@ -2,6 +2,8 @@
 #
 # Full Control Plane + Nodes Upgrade
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_6/upgrade_control_plane.yml

@@ -11,6 +11,8 @@
 #
 # You can run the upgrade_nodes.yml playbook after this to upgrade these components separately.
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 2 - 0
playbooks/byo/openshift-cluster/upgrades/v3_6/upgrade_nodes.yml

@@ -4,6 +4,8 @@
 #
 # Upgrades nodes only, but requires the control plane to have already been upgraded.
 #
+- include: ../../initialize_groups.yml
+
 - include: ../../../../common/openshift-cluster/upgrades/init.yml
   tags:
   - pre_upgrade

+ 4 - 0
playbooks/byo/openshift-etcd/restart.yml

@@ -1,4 +1,8 @@
 ---
+- include: ../openshift-cluster/initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 4 - 0
playbooks/byo/openshift-master/restart.yml

@@ -1,4 +1,8 @@
 ---
+- include: ../openshift-cluster/initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 1 - 23
playbooks/byo/openshift-master/scaleup.yml

@@ -1,27 +1,5 @@
 ---
-- name: Create initial host groups for localhost
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
-  - name: Evaluate group l_oo_all_hosts
-    add_host:
-      name: "{{ item }}"
-      groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts | default([]) }}"
-    changed_when: False
-
-- name: Create initial host groups for all hosts
-  hosts: l_oo_all_hosts
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
+- include: ../openshift-cluster/initialize_groups.yml
 
 - include: ../../common/openshift-master/scaleup.yml
   vars:

+ 4 - 0
playbooks/byo/openshift-node/restart.yml

@@ -1,4 +1,8 @@
 ---
+- include: ../openshift-cluster/initialize_groups.yml
+  tags:
+  - always
+
 - include: ../../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 1 - 23
playbooks/byo/openshift-node/scaleup.yml

@@ -1,27 +1,5 @@
 ---
-- name: Create initial host groups for localhost
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
-  - name: Evaluate group l_oo_all_hosts
-    add_host:
-      name: "{{ item }}"
-      groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts | default([]) }}"
-    changed_when: False
-
-- name: Create initial host groups for all hosts
-  hosts: l_oo_all_hosts
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
+- include: ../openshift-cluster/initialize_groups.yml
 
 - include: ../../common/openshift-node/scaleup.yml
   vars:

+ 4 - 0
playbooks/byo/openshift_facts.yml

@@ -1,4 +1,8 @@
 ---
+- include: openshift-cluster/initialize_groups.yml
+  tags:
+  - always
+
 - include: ../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 4 - 0
playbooks/byo/rhel_subscribe.yml

@@ -1,4 +1,8 @@
 ---
+- include: openshift-cluster/initialize_groups.yml
+  tags:
+  - always
+
 - include: ../common/openshift-cluster/std_include.yml
   tags:
   - always

+ 3 - 1
playbooks/common/openshift-cluster/openshift_logging.yml

@@ -1,11 +1,13 @@
 ---
+- include: evaluate_groups.yml
+
 - name: OpenShift Aggregated Logging
   hosts: oo_first_master
   roles:
   - openshift_logging
 
 - name: Update Master configs
-  hosts: masters:!oo_first_master
+  hosts: oo_masters:!oo_first_master
   tasks:
   - block:
     - include_role:

+ 0 - 24
playbooks/common/openshift-cluster/std_include.yml

@@ -1,28 +1,4 @@
 ---
-- name: Create initial host groups for localhost
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
-  - name: Evaluate group l_oo_all_hosts
-    add_host:
-      name: "{{ item }}"
-      groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts | default([]) }}"
-    changed_when: no
-
-- name: Create initial host groups for all hosts
-  hosts: l_oo_all_hosts
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
-
 - include: evaluate_groups.yml
   tags:
   - always

+ 0 - 24
playbooks/common/openshift-cluster/upgrades/init.yml

@@ -1,28 +1,4 @@
 ---
-- name: Create initial host groups for localhost
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../../byo/openshift-cluster/cluster_hosts.yml
-  - name: Evaluate group l_oo_all_hosts
-    add_host:
-      name: "{{ item }}"
-      groups: l_oo_all_hosts
-    with_items: "{{ g_all_hosts | default([]) }}"
-    changed_when: False
-
-- name: Create initial host groups for all hosts
-  hosts: l_oo_all_hosts
-  gather_facts: no
-  tags:
-  - always
-  tasks:
-  - include_vars: ../../../byo/openshift-cluster/cluster_hosts.yml
-
 - include: ../evaluate_groups.yml
   vars:
     # Do not allow adding hosts during upgrade.