diff options
-rw-r--r-- | .tito/packages/openshift-ansible | 2 | ||||
-rw-r--r-- | filter_plugins/oo_filters.py | 25 | ||||
-rw-r--r-- | inventory/byo/hosts.aep.example | 6 | ||||
-rw-r--r-- | inventory/byo/hosts.origin.example | 6 | ||||
-rw-r--r-- | inventory/byo/hosts.ose.example | 6 | ||||
-rw-r--r-- | openshift-ansible.spec | 28 | ||||
-rw-r--r-- | playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml | 12 | ||||
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 24 | ||||
-rw-r--r-- | roles/os_zabbix/vars/template_openshift_master.yml | 25 |
9 files changed, 114 insertions, 20 deletions
diff --git a/.tito/packages/openshift-ansible b/.tito/packages/openshift-ansible index bc2fab995..bfc9e0962 100644 --- a/.tito/packages/openshift-ansible +++ b/.tito/packages/openshift-ansible @@ -1 +1 @@ -3.0.38-1 ./ +3.0.39-1 ./ diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index 289e3b8f7..450101785 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -646,6 +646,30 @@ class FilterModule(object): persistent_volume_claims.append(persistent_volume_claim) return persistent_volume_claims + @staticmethod + def oo_31_rpm_rename_conversion(rpms, openshift_version=None): + """ Filters a list of 3.0 rpms and return the corresponding 3.1 rpms + names with proper version (if provided) + + If 3.1 rpms are passed in they will only be augmented with the + correct version. This is important for hosts that are running both + Masters and Nodes. + """ + if not isinstance(rpms, list): + raise errors.AnsibleFilterError("failed expects to filter on a list") + if openshift_version is not None and not isinstance(openshift_version, basestring): + raise errors.AnsibleFilterError("failed expects openshift_version to be a string") + + rpms_31 = [] + for rpm in rpms: + if not 'atomic' in rpm: + rpm = rpm.replace("openshift", "atomic-openshift") + if openshift_version: + rpm = rpm + openshift_version + rpms_31.append(rpm) + + return rpms_31 + def filters(self): """ returns a mapping of filters to methods """ return { @@ -671,4 +695,5 @@ class FilterModule(object): "oo_openshift_env": self.oo_openshift_env, "oo_persistent_volumes": self.oo_persistent_volumes, "oo_persistent_volume_claims": self.oo_persistent_volume_claims, + "oo_31_rpm_rename_conversion": self.oo_31_rpm_rename_conversion, } diff --git a/inventory/byo/hosts.aep.example b/inventory/byo/hosts.aep.example index 7f4a1a9d2..915a82579 100644 --- a/inventory/byo/hosts.aep.example +++ b/inventory/byo/hosts.aep.example @@ -98,8 +98,8 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', # Set cockpit plugins #osm_cockpit_plugins=['cockpit-kubernetes'] -# Native high availbility cluster method with optional load balancer. -# If no lb group is defined installer assumes that a load balancer has +# Native high availability cluster method with optional load balancer. +# If no lb group is defined, the installer assumes that a load balancer has # been preconfigured. For installation the value of # openshift_master_cluster_hostname must resolve to the load balancer # or to one or all of the masters defined in the inventory if no load @@ -247,7 +247,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', # openshift-ansible will wait indefinitely for your input when it detects that the # value of openshift_hostname resolves to an IP address not bound to any local # interfaces. This mis-configuration is problematic for any pod leveraging host -# networking and liveness or readiness probes. +# networking and liveness or readiness probes. # Setting this variable to true will override that check. #openshift_override_hostname_check=true diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example index aae987796..4fe514d97 100644 --- a/inventory/byo/hosts.origin.example +++ b/inventory/byo/hosts.origin.example @@ -103,8 +103,8 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', # Set cockpit plugins #osm_cockpit_plugins=['cockpit-kubernetes'] -# Native high availbility cluster method with optional load balancer. -# If no lb group is defined installer assumes that a load balancer has +# Native high availability cluster method with optional load balancer. +# If no lb group is defined, the installer assumes that a load balancer has # been preconfigured. For installation the value of # openshift_master_cluster_hostname must resolve to the load balancer # or to one or all of the masters defined in the inventory if no load @@ -252,7 +252,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', # openshift-ansible will wait indefinitely for your input when it detects that the # value of openshift_hostname resolves to an IP address not bound to any local # interfaces. This mis-configuration is problematic for any pod leveraging host -# networking and liveness or readiness probes. +# networking and liveness or readiness probes. # Setting this variable to true will override that check. #openshift_override_hostname_check=true diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example index f017f9a6e..26caba36a 100644 --- a/inventory/byo/hosts.ose.example +++ b/inventory/byo/hosts.ose.example @@ -98,8 +98,8 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', # Set cockpit plugins #osm_cockpit_plugins=['cockpit-kubernetes'] -# Native high availbility cluster method with optional load balancer. -# If no lb group is defined installer assumes that a load balancer has +# Native high availability cluster method with optional load balancer. +# If no lb group is defined, the installer assumes that a load balancer has # been preconfigured. For installation the value of # openshift_master_cluster_hostname must resolve to the load balancer # or to one or all of the masters defined in the inventory if no load @@ -247,7 +247,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', # openshift-ansible will wait indefinitely for your input when it detects that the # value of openshift_hostname resolves to an IP address not bound to any local # interfaces. This mis-configuration is problematic for any pod leveraging host -# networking and liveness or readiness probes. +# networking and liveness or readiness probes. # Setting this variable to true will override that check. #openshift_override_hostname_check=true diff --git a/openshift-ansible.spec b/openshift-ansible.spec index 218c714f5..b6efaafdb 100644 --- a/openshift-ansible.spec +++ b/openshift-ansible.spec @@ -5,7 +5,7 @@ } Name: openshift-ansible -Version: 3.0.38 +Version: 3.0.39 Release: 1%{?dist} Summary: Openshift and Atomic Enterprise Ansible License: ASL 2.0 @@ -259,6 +259,32 @@ Atomic OpenShift Utilities includes %changelog +* Tue Feb 09 2016 Brenton Leanhardt <bleanhar@redhat.com> 3.0.39-1 +- Bug 1304150 - Can't upgrade atomic-openshift to specified version + (bleanhar@redhat.com) +- Mask master service when using native ha (jdetiber@redhat.com) +- aoi: Safer check for master_routingconfig_subdomain (smunilla@redhat.com) +- Add a DNS server on OpenStack clusters (lhuard@amadeus.com) +- renamed /etc/openshift to /etc/origin (sten@redhat.com) +- gitignore : .tag* (atom editor tag files) (sdodson@redhat.com) +- Add an early check to ensure that node names resolve to an interface on the + host (sdodson@redhat.com) +- Allow compression option to be set to empty for non compressed QCow images + Support tgz and gzip compressed images (akram@free.fr) +- Replace status_changed bool (abutcher@redhat.com) +- Improve docs and consistency of setting the ssh_user (jdetiber@redhat.com) +- remove outdated comments (jdetiber@redhat.com) +- add etcd hosts for gce playbooks (jdetiber@redhat.com) +- GCE cloud provider updates (jdetiber@redhat.com) +- Remove extra nfs configuration. (abutcher@redhat.com) +- Do not apply the etcd_certificates role during node playbook. + (abutcher@redhat.com) +- Add g_new_node_hosts to cluster_hosts. (abutcher@redhat.com) +- Updating examples to use /etc/origin/master/htpasswd (jstuever@redhat.com) +- Refactor registry storage options. (abutcher@redhat.com) +- Additional overrides for cloud provider playbooks (jdetiber@redhat.com) +- Bring first etcd server up before others. (dgoodwin@redhat.com) + * Tue Feb 02 2016 Brenton Leanhardt <bleanhar@redhat.com> 3.0.38-1 - aoi: Ask for osm_default_subdomain in interactive mode (smunilla@redhat.com) - add item to hold number of stray OVS rules found/removed (jdiaz@redhat.com) diff --git a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml index 8ec379109..55c36810f 100644 --- a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml +++ b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml @@ -229,12 +229,19 @@ hosts: oo_masters_to_config vars: openshift_version: "{{ openshift_pkg_version | default('') }}" + roles: + - openshift_facts tasks: - name: Upgrade to latest available kernel action: "{{ ansible_pkg_mgr}} name=kernel state=latest" - name: Upgrade master packages command: "{{ ansible_pkg_mgr}} update -y {{ openshift.common.service_type }}-master{{ openshift_version }}" + when: openshift_pkg_version is not defined + + - name: Upgrade packages + command: "{{ ansible_pkg_mgr}} install -y {{ openshift.common.installed_variant_rpms | oo_31_rpm_rename_conversion(openshift_version) | join (' ')}}" + when: openshift_pkg_version is defined and deployment_type == 'openshift-enterprise' - name: Ensure python-yaml present for config upgrade action: "{{ ansible_pkg_mgr }} name=PyYAML state=present" @@ -415,6 +422,11 @@ tasks: - name: Upgrade node packages command: "{{ ansible_pkg_mgr }} update -y {{ openshift.common.service_type }}-node{{ openshift_version }}" + when: openshift_pkg_version is not defined + + - name: Upgrade packages + command: "{{ ansible_pkg_mgr}} install -y {{ openshift.common.installed_variant_rpms | oo_31_rpm_rename_conversion(openshift_version) | join (' ')}}" + when: openshift_pkg_version is defined and deployment_type == 'openshift-enterprise' - name: Restart node service service: name="{{ openshift.common.service_type }}-node" state=restarted diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 85c8abdf0..d11af307b 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -1070,6 +1070,28 @@ def set_container_facts_if_unset(facts): return facts +def set_installed_variant_rpm_facts(facts): + """ Set RPM facts of installed variant + Args: + facts (dict): existing facts + Returns: + dict: the facts dict updated with installed_variant_rpms + """ + installed_rpms = [] + for base_rpm in ['openshift', 'atomic-openshift', 'origin']: + optional_rpms = ['master', 'node', 'clients', 'sdn-ovs'] + variant_rpms = [base_rpm] + \ + ['{0}-{1}'.format(base_rpm, r) for r in optional_rpms] + \ + ['tuned-profiles-%s-node' % base_rpm] + for rpm in variant_rpms: + exit_code, _, _ = module.run_command(['rpm', '-q', rpm]) + if exit_code == 0: + installed_rpms.append(rpm) + + facts['common']['installed_variant_rpms'] = installed_rpms + return facts + + class OpenShiftFactsInternalError(Exception): """Origin Facts Error""" @@ -1159,6 +1181,8 @@ class OpenShiftFacts(object): facts = set_aggregate_facts(facts) facts = set_etcd_facts_if_unset(facts) facts = set_container_facts_if_unset(facts) + if not facts['common']['is_containerized']: + facts = set_installed_variant_rpm_facts(facts) return dict(openshift=facts) def get_defaults(self, roles): diff --git a/roles/os_zabbix/vars/template_openshift_master.yml b/roles/os_zabbix/vars/template_openshift_master.yml index 9d20eb012..5aae2496a 100644 --- a/roles/os_zabbix/vars/template_openshift_master.yml +++ b/roles/os_zabbix/vars/template_openshift_master.yml @@ -2,13 +2,13 @@ g_template_openshift_master: name: Template Openshift Master zitems: - - name: create_app + - name: openshift.master.app.create applications: - Openshift Master - key: create_app + key: openshift.master.app.create - - key: openshift.master.registry.healthz - description: "Shows the health status of the cluster's docker registry" + - key: openshift.master.registry.healthy_pct + description: "Shows the percentage of healthy registries in the cluster" type: int applications: - Openshift Master @@ -288,14 +288,14 @@ g_template_openshift_master: # Put triggers that depend on other triggers here (deps must be created first) - name: 'Application creation has failed on {HOST.NAME}' - expression: '{Template Openshift Master:create_app.last(#1)}=1 and {Template Openshift Master:create_app.last(#2)}=1' + expression: '{Template Openshift Master:openshift.master.app.create.last(#1)}=1 and {Template Openshift Master:openshift.master.app.create.last(#2)}=1' url: 'https://github.com/openshift/ops-sop/blob/master/V3/Alerts/check_create_app.asciidoc' dependencies: - 'Openshift Master process not running on {HOST.NAME}' priority: avg - name: 'Application creation has failed multiple times in the last hour on {HOST.NAME}' - expression: '{Template Openshift Master:create_app.sum(1h)}>3' + expression: '{Template Openshift Master:openshift.master.app.create.sum(1h)}>3' url: 'https://github.com/openshift/ops-sop/blob/master/V3/Alerts/check_create_app.asciidoc' dependencies: - 'Openshift Master process not running on {HOST.NAME}' @@ -333,9 +333,16 @@ g_template_openshift_master: - 'Openshift Master process not running on {HOST.NAME}' priority: avg - - name: 'Docker Registry check failed on {HOST.NAME}' - expression: '{Template Openshift Master:openshift.master.registry.healthz.max(#2)}<1' - url: 'https://github.com/openshift/ops-sop/blob/master/V3/Alerts/openshift_master.asciidoc' + - name: 'One or more Docker Registries is unhealthy according to {HOST.NAME}' + expression: '{Template Openshift Master:openshift.master.registry.healthy_pct.last(#2)}<100 and {Template Openshift Master:openshift.master.registry.healthy_pct.max(#2)}>50' + url: 'https://github.com/openshift/ops-sop/blob/master/V3/Alerts/openshift_registry.asciidoc' + dependencies: + - 'Openshift Master process not running on {HOST.NAME}' + priority: avg + + - name: 'Multiple Docker Registries are unhealthy according to {HOST.NAME}' + expression: '{Template Openshift Master:openshift.master.registry.healthy_pct.last(#2)}<51' + url: 'https://github.com/openshift/ops-sop/blob/master/V3/Alerts/openshift_registry.asciidoc' dependencies: - 'Openshift Master process not running on {HOST.NAME}' priority: high |