diff options
Diffstat (limited to 'playbooks')
6 files changed, 44 insertions, 29 deletions
diff --git a/playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade.yml b/playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade.yml index 59dd802ee..6b69348b7 100644 --- a/playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade.yml +++ b/playbooks/byo/openshift-cluster/upgrades/v3_4/upgrade.yml @@ -6,8 +6,8 @@    tags:    - pre_upgrade -# Configure the upgrade target for the common upgrade tasks: -- hosts: l_oo_all_hosts +- name: Configure the upgrade target for the common upgrade tasks +  hosts: l_oo_all_hosts    tags:    - pre_upgrade    tasks: diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml index 0f226f5f9..a95cb68b7 100644 --- a/playbooks/common/openshift-cluster/config.yml +++ b/playbooks/common/openshift-cluster/config.yml @@ -38,6 +38,9 @@    - set_fact:        openshift_docker_log_options: "{{ lookup('oo_option', 'docker_log_options') }}"      when: openshift_docker_log_options is not defined +  - set_fact: +      openshift_docker_selinux_enabled: "{{ lookup('oo_option', 'docker_selinux_enabled') }}" +    when: openshift_docker_selinux_enabled is not defined  - include: ../openshift-etcd/config.yml    tags: diff --git a/playbooks/common/openshift-cluster/upgrades/init.yml b/playbooks/common/openshift-cluster/upgrades/init.yml index 8cac2fb3b..76645ff3f 100644 --- a/playbooks/common/openshift-cluster/upgrades/init.yml +++ b/playbooks/common/openshift-cluster/upgrades/init.yml @@ -1,5 +1,6 @@  --- -- hosts: localhost +- name: Create l_oo_all_hosts group +  hosts: localhost    connection: local    become: no    gather_facts: no @@ -10,7 +11,8 @@        groups: l_oo_all_hosts      with_items: "{{ g_all_hosts | default([]) }}" -- hosts: l_oo_all_hosts +- name: Include g_*_hosts vars for hosts in group l_oo_all_hosts +  hosts: l_oo_all_hosts    gather_facts: no    tasks:    - include_vars: ../../../byo/openshift-cluster/cluster_hosts.yml @@ -46,3 +48,14 @@      when: openshift_docker_log_options is not defined  - include: ../initialize_facts.yml + +- name: Ensure clean repo cache in the event repos have been changed manually +  hosts: oo_all_hosts +  tags: +  - pre_upgrade +  tasks: +  - name: Clean package cache +    command: "{{ ansible_pkg_mgr }} clean all" +    when: not openshift.common.is_atomic | bool +    args: +      warn: no diff --git a/playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml b/playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml index 9632626a4..c83923dae 100644 --- a/playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml +++ b/playbooks/common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml @@ -12,10 +12,6 @@        msg: Verify the correct version was found      when: verify_upgrade_version is defined and openshift_version != verify_upgrade_version -  - name: Clean package cache -    command: "{{ ansible_pkg_mgr }} clean all" -    when: not openshift.common.is_atomic | bool -    - set_fact:        g_new_service_name: "{{ 'origin' if deployment_type =='origin' else 'atomic-openshift' }}"      when: not openshift.common.is_containerized | bool diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml index 7f738ea0f..77b37cdc2 100644 --- a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml +++ b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml @@ -51,6 +51,8 @@    roles:    - openshift_master_facts +# The main master upgrade play. Should handle all changes to the system in one pass, with +# support for optional hooks to be defined.  - name: Upgrade master    hosts: oo_masters_to_config    vars: @@ -62,6 +64,14 @@    roles:    - openshift_facts    post_tasks: + +  # Run the pre-upgrade hook if defined: +  - debug: msg="Running master pre-upgrade hook {{ openshift_master_upgrade_pre_hook }}" +    when: openshift_master_upgrade_pre_hook is defined + +  - include: "{{ openshift_master_upgrade_pre_hook }}" +    when: openshift_master_upgrade_pre_hook is defined +    - include: rpm_upgrade.yml component=master      when: not openshift.common.is_containerized | bool @@ -102,12 +112,26 @@        state: link      when: ca_crt_stat.stat.isreg and not ca_bundle_stat.stat.exists +  # Run the upgrade hook prior to restarting services/system if defined: +  - debug: msg="Running master upgrade hook {{ openshift_master_upgrade_hook }}" +    when: openshift_master_upgrade_hook is defined + +  - include: "{{ openshift_master_upgrade_hook }}" +    when: openshift_master_upgrade_hook is defined +    - include: ../../openshift-master/restart_hosts.yml      when: openshift.common.rolling_restart_mode == 'system'    - include: ../../openshift-master/restart_services.yml      when: openshift.common.rolling_restart_mode == 'services' +  # Run the post-upgrade hook if defined: +  - debug: msg="Running master post-upgrade hook {{ openshift_master_upgrade_post_hook }}" +    when: openshift_master_upgrade_post_hook is defined + +  - include: "{{ openshift_master_upgrade_post_hook }}" +    when: openshift_master_upgrade_post_hook is defined +    - set_fact:        master_update_complete: True diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index de36fd263..7a334e771 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -75,17 +75,6 @@          ha: "{{ openshift_master_ha | default(groups.oo_masters | length > 1) }}"          master_count: "{{ openshift_master_count | default(groups.oo_masters | length) }}" -- name: Create temp directory for syncing certs -  hosts: localhost -  connection: local -  become: no -  gather_facts: no -  tasks: -  - name: Create local temp directory for syncing certs -    local_action: command mktemp -d /tmp/openshift-ansible-XXXXXXX -    register: g_master_mktemp -    changed_when: False -  - name: Determine if session secrets must be generated    hosts: oo_first_master    roles: @@ -117,7 +106,6 @@    hosts: oo_masters_to_config    any_errors_fatal: true    vars: -    sync_tmpdir: "{{ hostvars.localhost.g_master_mktemp.stdout }}"      openshift_master_ha: "{{ openshift.master.ha }}"      openshift_master_count: "{{ openshift.master.master_count }}"      openshift_master_session_auth_secrets: "{{ hostvars[groups.oo_first_master.0].openshift.master.session_auth_secrets }}" @@ -144,12 +132,3 @@    - name: Create group for deployment type      group_by: key=oo_masters_deployment_type_{{ openshift.common.deployment_type }}      changed_when: False - -- name: Delete temporary directory on localhost -  hosts: localhost -  connection: local -  become: no -  gather_facts: no -  tasks: -  - file: name={{ g_master_mktemp.stdout }} state=absent -    changed_when: False  | 
