summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml5
-rw-r--r--README.md1
-rw-r--r--inventory/byo/hosts.origin.example46
-rw-r--r--inventory/byo/hosts.ose.example44
-rw-r--r--playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml24
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py9
-rw-r--r--roles/openshift_facts/tasks/main.yml9
-rw-r--r--roles/openshift_facts/vars/main.yml5
8 files changed, 135 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index 15fe61959..0698b0280 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,11 +13,14 @@ python:
- "3.5"
install:
- - pip install tox-travis
+ - pip install tox-travis coveralls
script:
- tox
+after_success:
+ - coveralls
+
notifications:
email:
recipients:
diff --git a/README.md b/README.md
index 751e5ebf1..3ec6555e8 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
[![Join the chat at https://gitter.im/openshift/openshift-ansible](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/openshift/openshift-ansible)
[![Build Status](https://travis-ci.org/openshift/openshift-ansible.svg?branch=master)](https://travis-ci.org/openshift/openshift-ansible)
+[![Coverage Status](https://coveralls.io/repos/github/openshift/openshift-ansible/badge.svg?branch=master)](https://coveralls.io/github/openshift/openshift-ansible?branch=master)
# OpenShift Ansible
diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example
index 7741730ad..0ddca6576 100644
--- a/inventory/byo/hosts.origin.example
+++ b/inventory/byo/hosts.origin.example
@@ -300,7 +300,51 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
#
# Disable management of the OpenShift Router
#openshift_hosted_manage_router=false
-
+#
+# Router sharding support has been added and can be achieved by supplying the correct
+# data to the inventory. The variable to house the data is openshift_hosted_routers
+# and is in the form of a list. If no data is passed then a default router will be
+# created. There are multiple combinations of router sharding. The one described
+# below supports routers on separate nodes.
+#openshift_hosted_routers:
+#- name: router1
+# stats_port: 1936
+# ports:
+# - 80:80
+# - 443:443
+# replicas: 1
+# namespace: default
+# serviceaccount: router
+# selector: type=router1
+# images: "openshift3/ose-${component}:${version}"
+# edits: []
+# certificates:
+# certfile: /path/to/certificate/abc.crt
+# keyfile: /path/to/certificate/abc.key
+# cafile: /path/to/certificate/ca.crt
+#- name: router2
+# stats_port: 1936
+# ports:
+# - 80:80
+# - 443:443
+# replicas: 1
+# namespace: default
+# serviceaccount: router
+# selector: type=router2
+# images: "openshift3/ose-${component}:${version}"
+# certificates:
+# certfile: /path/to/certificate/xyz.crt
+# keyfile: /path/to/certificate/xyz.key
+# cafile: /path/to/certificate/ca.crt
+# edits:
+# # ROUTE_LABELS sets the router to listen for routes
+# # tagged with the provided values
+# - key: spec.template.spec.containers[0].env
+# value:
+# name: ROUTE_LABELS
+# value: "route=external"
+# action: append
+#
# OpenShift Registry Console Options
# Override the console image prefix for enterprise deployments, not used in origin
# default is "registry.access.redhat.com/openshift3/" and the image appended is "registry-console"
diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example
index 3da9be081..7f80a9639 100644
--- a/inventory/byo/hosts.ose.example
+++ b/inventory/byo/hosts.ose.example
@@ -300,6 +300,50 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
#
# Disable management of the OpenShift Router
#openshift_hosted_manage_router=false
+#
+# Router sharding support has been added and can be achieved by supplying the correct
+# data to the inventory. The variable to house the data is openshift_hosted_routers
+# and is in the form of a list. If no data is passed then a default router will be
+# created. There are multiple combinations of router sharding. The one described
+# below supports routers on separate nodes.
+#openshift_hosted_routers:
+#- name: router1
+# stats_port: 1936
+# ports:
+# - 80:80
+# - 443:443
+# replicas: 1
+# namespace: default
+# serviceaccount: router
+# selector: type=router1
+# images: "openshift3/ose-${component}:${version}"
+# edits: []
+# certificates:
+# certfile: /path/to/certificate/abc.crt
+# keyfile: /path/to/certificate/abc.key
+# cafile: /path/to/certificate/ca.crt
+#- name: router2
+# stats_port: 1936
+# ports:
+# - 80:80
+# - 443:443
+# replicas: 1
+# namespace: default
+# serviceaccount: router
+# selector: type=router2
+# images: "openshift3/ose-${component}:${version}"
+# certificates:
+# certfile: /path/to/certificate/xyz.crt
+# keyfile: /path/to/certificate/xyz.key
+# cafile: /path/to/certificate/ca.crt
+# edits:
+# # ROUTE_LABELS sets the router to listen for routes
+# # tagged with the provided values
+# - key: spec.template.spec.containers[0].env
+# value:
+# name: ROUTE_LABELS
+# value: "route=external"
+# action: append
# OpenShift Registry Console Options
# Override the console image prefix for enterprise deployments, not used in origin
diff --git a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml
index fd01a6625..babb7191d 100644
--- a/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml
+++ b/playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml
@@ -173,7 +173,11 @@
- name: Reconcile Cluster Roles
command: >
{{ openshift.common.client_binary }} adm --config={{ openshift.common.config_base }}/master/admin.kubeconfig
- policy reconcile-cluster-roles --additive-only=true --confirm
+ policy reconcile-cluster-roles --additive-only=true --confirm -o name
+ register: reconcile_cluster_role_result
+ changed_when:
+ - reconcile_cluster_role_result.stdout != ''
+ - reconcile_cluster_role_result.rc == 0
run_once: true
- name: Reconcile Cluster Role Bindings
@@ -184,19 +188,31 @@
--exclude-groups=system:authenticated:oauth
--exclude-groups=system:unauthenticated
--exclude-users=system:anonymous
- --additive-only=true --confirm
+ --additive-only=true --confirm -o name
when: origin_reconcile_bindings | bool or ent_reconcile_bindings | bool
+ register: reconcile_bindings_result
+ changed_when:
+ - reconcile_bindings_result.stdout != ''
+ - reconcile_bindings_result.rc == 0
run_once: true
- name: Reconcile Jenkins Pipeline Role Bindings
command: >
- {{ openshift.common.client_binary }} adm --config={{ openshift.common.config_base }}/master/admin.kubeconfig policy reconcile-cluster-role-bindings system:build-strategy-jenkinspipeline --confirm
+ {{ openshift.common.client_binary }} adm --config={{ openshift.common.config_base }}/master/admin.kubeconfig policy reconcile-cluster-role-bindings system:build-strategy-jenkinspipeline --confirm -o name
run_once: true
+ register: reconcile_jenkins_role_binding_result
+ changed_when:
+ - reconcile_jenkins_role_binding_result.stdout != ''
+ - reconcile_jenkins_role_binding_result.rc == 0
when: openshift.common.version_gte_3_4_or_1_4 | bool
- name: Reconcile Security Context Constraints
command: >
- {{ openshift.common.client_binary }} adm policy reconcile-sccs --confirm --additive-only=true
+ {{ openshift.common.client_binary }} adm policy reconcile-sccs --confirm --additive-only=true -o name
+ register: reconcile_scc_result
+ changed_when:
+ - reconcile_scc_result.stdout != ''
+ - reconcile_scc_result.rc == 0
run_once: true
- set_fact:
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 75b55c369..8ea900e21 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -2319,14 +2319,19 @@ class OpenShiftFacts(object):
protected_facts_to_overwrite)
if 'docker' in new_local_facts:
- # remove duplicate and empty strings from registry lists
+ # remove duplicate and empty strings from registry lists, preserving order
for cat in ['additional', 'blocked', 'insecure']:
key = '{0}_registries'.format(cat)
if key in new_local_facts['docker']:
val = new_local_facts['docker'][key]
if isinstance(val, string_types):
val = [x.strip() for x in val.split(',')]
- new_local_facts['docker'][key] = list(set(val) - set(['']))
+ seen = set()
+ new_local_facts['docker'][key] = list()
+ for registry in val:
+ if registry not in seen and registry != '':
+ seen.add(registry)
+ new_local_facts['docker'][key].append(registry)
# Convert legacy log_options comma sep string to a list if present:
if 'log_options' in new_local_facts['docker'] and \
isinstance(new_local_facts['docker']['log_options'], string_types):
diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml
index c538ff7a1..73c668c72 100644
--- a/roles/openshift_facts/tasks/main.yml
+++ b/roles/openshift_facts/tasks/main.yml
@@ -13,6 +13,8 @@
l_is_node_system_container: "{{ (use_node_system_container | default(use_system_containers) | bool) }}"
l_is_master_system_container: "{{ (use_master_system_container | default(use_system_containers) | bool) }}"
l_is_etcd_system_container: "{{ (use_etcd_system_container | default(use_system_containers) | bool) }}"
+- set_fact:
+ l_any_system_container: "{{ l_is_etcd_system_container or l_is_openvswitch_system_container or l_is_node_system_container or l_is_master_system_container }}"
- name: Validate python version
fail:
@@ -50,6 +52,13 @@
with_items: "{{ required_packages }}"
when: not l_is_atomic | bool
+- name: Ensure various deps for running system containers are installed
+ package: name={{ item }} state=present
+ with_items: "{{ required_system_containers_packages }}"
+ when:
+ - not l_is_atomic | bool
+ - l_any_system_container | bool
+
- name: Gather Cluster facts and set is_containerized if needed
openshift_facts:
role: common
diff --git a/roles/openshift_facts/vars/main.yml b/roles/openshift_facts/vars/main.yml
index 9c3110ff6..07f5100ad 100644
--- a/roles/openshift_facts/vars/main.yml
+++ b/roles/openshift_facts/vars/main.yml
@@ -5,3 +5,8 @@ required_packages:
- python-six
- PyYAML
- yum-utils
+
+required_system_containers_packages:
+ - atomic
+ - ostree
+ - runc