diff options
Diffstat (limited to 'playbooks/common')
15 files changed, 95 insertions, 23 deletions
| diff --git a/playbooks/common/openshift-cluster/upgrades/init.yml b/playbooks/common/openshift-cluster/upgrades/init.yml index 8ee83819e..ba783638d 100644 --- a/playbooks/common/openshift-cluster/upgrades/init.yml +++ b/playbooks/common/openshift-cluster/upgrades/init.yml @@ -5,7 +5,8 @@      g_new_master_hosts: []      g_new_node_hosts: [] -- import_playbook: ../../../init/facts.yml +- import_playbook: ../../../init/basic_facts.yml +- import_playbook: ../../../init/cluster_facts.yml  - name: Ensure firewall is not switched during upgrade    hosts: "{{ l_upgrade_no_switch_firewall_hosts | default('oo_all_hosts') }}" diff --git a/playbooks/common/openshift-cluster/upgrades/initialize_nodes_to_upgrade.yml b/playbooks/common/openshift-cluster/upgrades/initialize_nodes_to_upgrade.yml index fc1cbf32a..07be0b0d4 100644 --- a/playbooks/common/openshift-cluster/upgrades/initialize_nodes_to_upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/initialize_nodes_to_upgrade.yml @@ -31,7 +31,7 @@        with_items: " {{ groups['oo_nodes_to_config'] }}"        when:        - hostvars[item].openshift is defined -      - hostvars[item].openshift.common.hostname in nodes_to_upgrade.results.results[0]['items'] | map(attribute='metadata.name') | list +      - hostvars[item].openshift.common.hostname | lower in nodes_to_upgrade.results.results[0]['items'] | map(attribute='metadata.name') | list        changed_when: false    # Build up the oo_nodes_to_upgrade group, use the list filtered by label if diff --git a/playbooks/common/openshift-cluster/upgrades/pre/config.yml b/playbooks/common/openshift-cluster/upgrades/pre/config.yml index da63450b8..2b27f8dd0 100644 --- a/playbooks/common/openshift-cluster/upgrades/pre/config.yml +++ b/playbooks/common/openshift-cluster/upgrades/pre/config.yml @@ -49,7 +49,7 @@      # to a more specific version, respecting openshift_image_tag and openshift_pkg_version if      # defined, and overriding the normal behavior of protecting the installed version      openshift_release: "{{ openshift_upgrade_target }}" -    openshift_protect_installed_version: False +    # openshift_protect_installed_version is passed n via upgrade_control_plane.yml      # l_openshift_version_set_hosts is passed via upgrade_control_plane.yml      # l_openshift_version_check_hosts is passed via upgrade_control_plane.yml diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml index e89f06f17..080372c81 100644 --- a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml @@ -310,13 +310,8 @@    - import_role:        name: openshift_node        tasks_from: upgrade.yml -  - name: Set node schedulability -    oc_adm_manage_node: -      node: "{{ openshift.node.nodename | lower }}" -      schedulable: True -    delegate_to: "{{ groups.oo_first_master.0 }}" -    retries: 10 -    delay: 5 -    register: node_schedulable -    until: node_schedulable is succeeded -    when: node_unschedulable is changed +  - import_role: +      name: openshift_manage_node +      tasks_from: config.yml +    vars: +      openshift_master_host: "{{ groups.oo_first_master.0 }}" diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml index 850442b3b..915fae9fd 100644 --- a/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml +++ b/playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml @@ -50,16 +50,11 @@    - import_role:        name: openshift_node        tasks_from: upgrade.yml -  - name: Set node schedulability -    oc_adm_manage_node: -      node: "{{ openshift.node.nodename | lower }}" -      schedulable: True -    delegate_to: "{{ groups.oo_first_master.0 }}" -    retries: 10 -    delay: 5 -    register: node_schedulable -    until: node_schedulable is succeeded -    when: node_unschedulable is changed +  - import_role: +      name: openshift_manage_node +      tasks_from: config.yml +    vars: +      openshift_master_host: "{{ groups.oo_first_master.0 }}"  - name: Re-enable excluders    hosts: oo_nodes_to_upgrade:!oo_masters_to_config diff --git a/playbooks/common/openshift-cluster/upgrades/v3_6/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_6/upgrade.yml index d520c6aee..a2d21b69f 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_6/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_6/upgrade.yml @@ -23,6 +23,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config:oo_nodes_to_upgrade"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_nodes_to_config:oo_masters_to_config" +    openshift_protect_installed_version: False  - import_playbook: validator.yml diff --git a/playbooks/common/openshift-cluster/upgrades/v3_6/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/v3_6/upgrade_control_plane.yml index d88880140..9aa5a3b64 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_6/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_6/upgrade_control_plane.yml @@ -35,6 +35,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_masters_to_config" +    openshift_protect_installed_version: False  - import_playbook: validator.yml diff --git a/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade.yml index 4daa9e490..cc2ec2709 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade.yml @@ -23,6 +23,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config:oo_nodes_to_upgrade"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_nodes_to_config:oo_masters_to_config" +    openshift_protect_installed_version: False  - import_playbook: validator.yml diff --git a/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml index ce069e2d0..b1ecc75d3 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_7/upgrade_control_plane.yml @@ -35,6 +35,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_masters_to_config" +    openshift_protect_installed_version: False  - import_playbook: validator.yml diff --git a/playbooks/common/openshift-cluster/upgrades/v3_8/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_8/upgrade.yml index a9bf354cc..a73b7d63a 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_8/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_8/upgrade.yml @@ -23,6 +23,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config:oo_nodes_to_upgrade"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_nodes_to_config:oo_masters_to_config" +    openshift_protect_installed_version: False  - import_playbook: validator.yml diff --git a/playbooks/common/openshift-cluster/upgrades/v3_8/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/v3_8/upgrade_control_plane.yml index 3f26a6297..723b2e533 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_8/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_8/upgrade_control_plane.yml @@ -36,6 +36,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_masters_to_config" +    openshift_protect_installed_version: False  - import_playbook: validator.yml diff --git a/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade.yml index 20e0c165e..bf6e8605e 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade.yml @@ -20,6 +20,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config:oo_nodes_to_upgrade"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_nodes_to_config:oo_masters_to_config" +    openshift_protect_installed_version: False  - import_playbook: validator.yml diff --git a/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml index 0f48725f6..1dcc38def 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml @@ -41,6 +41,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_masters_to_config" +    openshift_protect_installed_version: False    when: hostvars[groups.oo_first_master.0].openshift_currently_installed_version | version_compare('3.8','<')  - name: Flag pre-upgrade checks complete for hosts without errors 3.8 @@ -82,6 +83,7 @@      l_upgrade_verify_targets_hosts: "oo_masters_to_config"      l_upgrade_docker_target_hosts: "oo_masters_to_config:oo_etcd_to_config"      l_upgrade_excluder_hosts: "oo_masters_to_config" +    openshift_protect_installed_version: False  - name: Flag pre-upgrade checks complete for hosts without errors    hosts: oo_masters_to_config:oo_etcd_to_config diff --git a/playbooks/common/private/components.yml b/playbooks/common/private/components.yml new file mode 100644 index 000000000..089645d07 --- /dev/null +++ b/playbooks/common/private/components.yml @@ -0,0 +1,38 @@ +--- +# These are the core component plays that configure the layers above the control +# plane. A component is generally considered any part of OpenShift that runs on +# top of the cluster and may be considered optional. Over time, much of OpenShift +# above the Kubernetes apiserver and masters may be considered components. +# +# Preconditions: +# +# 1. The control plane is configured and reachable from nodes inside the cluster +# 2. An admin kubeconfig file in /etc/origin/master/admin.kubeconfig that can +#    perform root level actions against the cluster +# 3. On cloud providers, persistent volume provisioners are configured +# 4. A subset of nodes is available to allow components to schedule - this must +#    include the masters and usually includes infra nodes. +# 5. The init/main.yml playbook has been invoked + +- import_playbook: ../../openshift-glusterfs/private/config.yml +  when: groups.oo_glusterfs_to_config | default([]) | count > 0 + +- import_playbook: ../../openshift-hosted/private/config.yml + +- import_playbook: ../../openshift-web-console/private/config.yml +  when: openshift_web_console_install | default(true) | bool + +- import_playbook: ../../openshift-metrics/private/config.yml +  when: openshift_metrics_install_metrics | default(false) | bool + +- import_playbook: ../../openshift-logging/private/config.yml +  when: openshift_logging_install_logging | default(false) | bool + +- import_playbook: ../../openshift-prometheus/private/config.yml +  when: openshift_hosted_prometheus_deploy | default(false) | bool + +- import_playbook: ../../openshift-service-catalog/private/config.yml +  when: openshift_enable_service_catalog | default(true) | bool + +- import_playbook: ../../openshift-management/private/config.yml +  when: openshift_management_install_management | default(false) | bool diff --git a/playbooks/common/private/control_plane.yml b/playbooks/common/private/control_plane.yml new file mode 100644 index 000000000..0a5f1142b --- /dev/null +++ b/playbooks/common/private/control_plane.yml @@ -0,0 +1,34 @@ +--- +# These are the control plane plays that configure a control plane on top of hosts +# identified as masters. Over time, some of the pieces of the current control plane +# may be moved to the components list. +# +# It is not required for any nodes to be configured, or passed to be configured, +# when this playbook is invoked. +# +# Preconditions: +# +# 1. A set of machines have been identified to act as masters +# 2. On cloud providers, a load balancer has been configured to point to the masters +#    and that load balancer has a DNS name +# 3. The init/main.yml playbook has been invoked +# +# Postconditions: +# +# 1. The control plane is reachable from the outside of the cluster +# 2. The master has an /etc/origin/master/admin.kubeconfig file that gives cluster-admin +#    access. + +- import_playbook: ../../openshift-checks/private/install.yml + +- import_playbook: ../../openshift-etcd/private/config.yml + +- import_playbook: ../../openshift-nfs/private/config.yml +  when: groups.oo_nfs_to_config | default([]) | count > 0 + +- import_playbook: ../../openshift-loadbalancer/private/config.yml +  when: groups.oo_lb_to_config | default([]) | count > 0 + +- import_playbook: ../../openshift-master/private/config.yml + +- import_playbook: ../../openshift-master/private/additional_config.yml | 
