diff options
Diffstat (limited to 'playbooks/common')
10 files changed, 37 insertions, 31 deletions
| diff --git a/playbooks/common/openshift-cluster/initialize_facts.yml b/playbooks/common/openshift-cluster/initialize_facts.yml index cda490b1f..37f523246 100644 --- a/playbooks/common/openshift-cluster/initialize_facts.yml +++ b/playbooks/common/openshift-cluster/initialize_facts.yml @@ -1,6 +1,7 @@  ---  - name: Initialize host facts    hosts: oo_all_hosts +  any_errors_fatal: true    roles:    - openshift_facts    tasks: diff --git a/playbooks/common/openshift-cluster/openshift_hosted.yml b/playbooks/common/openshift-cluster/openshift_hosted.yml index 811b3d685..c3077e3c2 100644 --- a/playbooks/common/openshift-cluster/openshift_hosted.yml +++ b/playbooks/common/openshift-cluster/openshift_hosted.yml @@ -1,30 +1,18 @@ -- name: Create persistent volumes and create hosted services +- name: Create persistent volumes    hosts: oo_first_master    vars: -    attach_registry_volume: "{{ openshift.hosted.registry.storage.kind != None }}" -    deploy_infra: "{{ openshift.master.infra_nodes | default([]) | length > 0 }}"      persistent_volumes: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volumes(groups) }}"      persistent_volume_claims: "{{ hostvars[groups.oo_first_master.0] | oo_persistent_volume_claims }}"    roles:    - role: openshift_persistent_volumes      when: persistent_volumes | length > 0 or persistent_volume_claims | length > 0 -  - role: openshift_serviceaccounts -    openshift_serviceaccounts_names: -    - router -    - registry -    openshift_serviceaccounts_namespace: default -    openshift_serviceaccounts_sccs: -    - privileged -  - role: openshift_registry -    registry_volume_claim: "{{ openshift.hosted.registry.storage.volume.name }}-claim" -    when: deploy_infra | bool and attach_registry_volume | bool -  - role: openshift_metrics -    when: openshift.hosted.metrics.deploy | bool  - name: Create Hosted Resources    hosts: oo_first_master    pre_tasks:    - set_fact:        openshift_hosted_router_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}" +      openshift_hosted_registry_registryurl: "{{ hostvars[groups.oo_first_master.0].openshift.master.registry_url }}" +    when: "'master' in hostvars[groups.oo_first_master.0].openshift and 'registry_url' in hostvars[groups.oo_first_master.0].openshift.master"    roles:    - role: openshift_hosted diff --git a/playbooks/common/openshift-cluster/update_repos_and_packages.yml b/playbooks/common/openshift-cluster/update_repos_and_packages.yml index 0a37d4597..e3d16d359 100644 --- a/playbooks/common/openshift-cluster/update_repos_and_packages.yml +++ b/playbooks/common/openshift-cluster/update_repos_and_packages.yml @@ -5,6 +5,11 @@    vars:      openshift_deployment_type: "{{ deployment_type }}"    roles: +  # Explicitly calling openshift_facts because it appears that when +  # rhel_subscribe is skipped that the openshift_facts dependency for +  # openshift_repos is also skipped (this is the case at least for Ansible +  # 2.0.2) +  - openshift_facts    - role: rhel_subscribe      when: deployment_type in ["enterprise", "atomic-enterprise", "openshift-enterprise"] and            ansible_distribution == "RedHat" and diff --git a/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh b/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh index a2a9579b5..7bf249742 100644 --- a/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh +++ b/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh @@ -1,7 +1,11 @@  #!/bin/bash - -installed=$(yum list installed -e 0 -q "$@" 2>&1 | tail -n +2 | awk '{ print $2 }' | sort -r | tr '\n' ' ') -available=$(yum list available -e 0 -q "$@" 2>&1 | tail -n +2 | grep -v 'el7ose' | awk '{ print $2 }' | sort -r | tr '\n' ' ') +if [ `which dnf 2> /dev/null` ]; then +  installed=$(dnf repoquery --installed --latest-limit 1 -d 0 --qf '%{version}-%{release}' "${@}" 2> /dev/null) +  available=$(dnf repoquery --available --latest-limit 1 -d 0 --qf '%{version}-%{release}' "${@}" 2> /dev/null) +else +  installed=$(repoquery --plugins --pkgnarrow=installed --qf '%{version}-%{release}' "${@}" 2> /dev/null) +  available=$(repoquery --plugins --pkgnarrow=available --qf '%{version}-%{release}' "${@}" 2> /dev/null) +fi  echo "---"  echo "curr_version: ${installed}" diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml index 27b3ece96..f163cca86 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml @@ -212,6 +212,9 @@        msg: Upgrade packages not found      when: openshift_image_tag is not defined and (g_aos_versions.avail_version | default(g_aos_versions.curr_version, true) | version_compare(target_version, '<')) +- name: Verify docker upgrade targets +  hosts: oo_masters_to_config:oo_nodes_to_config:oo_etcd_to_config +  tasks:    - name: Determine available Docker      script: ../files/rpm_versions.sh docker      register: g_docker_version_result @@ -266,7 +269,7 @@  - name: Backup etcd    hosts: etcd_hosts_to_backup    vars: -    embedded_etcd: "{{ openshift.master.embedded_etcd }}" +    embedded_etcd: "{{ hostvars[groups.oo_first_master.0].openshift.master.embedded_etcd }}"      timestamp: "{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}"    roles:    - openshift_facts diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml index c93bf2a17..964257af5 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml @@ -4,7 +4,7 @@  ###############################################################################  - name: Upgrade docker -  hosts: oo_masters_to_config:oo_nodes_to_config:oo_etcd_to_config +  hosts: oo_masters_to_config:oo_nodes_to_config    roles:    - openshift_facts    tasks: @@ -20,6 +20,15 @@          openshift_image_tag: "v{{ g_new_version }}"          openshift_version: "{{ g_new_version }}" +- name: Upgrade docker +  hosts: oo_etcd_to_config +  roles: +  - openshift_facts +  tasks: +  # Upgrade docker when host is not atomic and host is not a non-containerized etcd node +  - include: docker_upgrade.yml +    when: not openshift.common.is_atomic | bool and not ('oo_etcd_to_config' in group_names and not openshift.common.is_containerized) +  # The cli image is used by openshift_docker_facts to determine the currently installed  # version.  We need to explicitly pull the latest image to handle cases where  # the locally cached 'latest' tag is older the g_new_version. diff --git a/playbooks/common/openshift-etcd/config.yml b/playbooks/common/openshift-etcd/config.yml index 6cb3a954f..a95de8cf3 100644 --- a/playbooks/common/openshift-etcd/config.yml +++ b/playbooks/common/openshift-etcd/config.yml @@ -1,6 +1,7 @@  ---  - name: Set etcd facts needed for generating certs    hosts: oo_etcd_to_config +  any_errors_fatal: true    roles:    - openshift_facts    tasks: diff --git a/playbooks/common/openshift-loadbalancer/service.yml b/playbooks/common/openshift-loadbalancer/service.yml index 19fffd5e9..e06a14c89 100644 --- a/playbooks/common/openshift-loadbalancer/service.yml +++ b/playbooks/common/openshift-loadbalancer/service.yml @@ -17,4 +17,4 @@    connection: ssh    gather_facts: no    tasks: -    - service: name=hapoxy state="{{ new_cluster_state }}" +    - service: name=haproxy state="{{ new_cluster_state }}" diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 0ca148169..8fd0904d6 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -46,7 +46,7 @@        openshift_hosted_metrics_duration: "{{ lookup('oo_option', 'openshift_hosted_metrics_duration') | default(7) }}"      when: openshift_hosted_metrics_duration is not defined    - set_fact: -      openshift_hosted_metrics_resolution: "{{ lookup('oo_option', 'openshift_hosted_metrics_resolution') | default(10) }}" +      openshift_hosted_metrics_resolution: "{{ lookup('oo_option', 'openshift_hosted_metrics_resolution') | default('10s', true) }}"      when: openshift_hosted_metrics_resolution is not defined    roles:    - openshift_facts @@ -186,11 +186,6 @@                                  | list ) }}"        master_cert_subdir: master-{{ openshift.common.hostname }}        master_cert_config_dir: "{{ openshift.common.config_base }}/master" -  - set_fact: -      openshift_infra_nodes: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']) -                                 | oo_nodes_with_label('region', 'infra') -                                 | oo_collect('inventory_hostname') }}" -    when: openshift_infra_nodes is not defined and groups.oo_nodes_to_config | default([]) | length > 0  - name: Configure master certificates    hosts: oo_first_master diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index b3491ef8d..80659dc52 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -121,7 +121,7 @@                                                      | union(groups['oo_etcd_to_config'] | default([])))                                                  | oo_collect('openshift.common.hostname') | default([]) | join (',')                                                  }}" -    when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and  +    when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and              openshift_generate_no_proxy_hosts | default(True) | bool }}"    roles:    - openshift_node @@ -137,7 +137,7 @@                                                      | union(groups['oo_etcd_to_config'] | default([])))                                                  | oo_collect('openshift.common.hostname') | default([]) | join (',')                                                  }}" -    when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and  +    when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and              openshift_generate_no_proxy_hosts | default(True) | bool }}"    roles:    - openshift_node @@ -184,7 +184,7 @@          -C {{ etcd_generated_certs_dir }}/{{ item.etcd_cert_subdir }} .      args:        creates: "{{ etcd_generated_certs_dir }}/{{ item.etcd_cert_subdir }}.tgz" -    with_items: etcd_needing_client_certs | default([]) +    with_items: "{{ etcd_needing_client_certs | default([]) }}"    - name: Retrieve the etcd cert tarballs      fetch:        src: "{{ etcd_generated_certs_dir }}/{{ item.etcd_cert_subdir }}.tgz" @@ -192,7 +192,7 @@        flat: yes        fail_on_missing: yes        validate_checksum: yes -    with_items: etcd_needing_client_certs | default([]) +    with_items: "{{ etcd_needing_client_certs | default([]) }}"  - name: Copy the external etcd flannel certs to the nodes    hosts: oo_nodes_to_config | 
