summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.tito/packages/openshift-ansible2
-rw-r--r--filter_plugins/oo_filters.py28
-rw-r--r--inventory/byo/hosts.aep.example3
-rw-r--r--inventory/byo/hosts.origin.example3
-rw-r--r--inventory/byo/hosts.ose.example3
-rw-r--r--openshift-ansible.spec36
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml36
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml27
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_minor/pre.yml2
-rw-r--r--playbooks/common/openshift-master/config.yml2
-rw-r--r--playbooks/common/openshift-node/config.yml2
-rw-r--r--roles/fluentd_master/tasks/main.yml57
-rw-r--r--roles/fluentd_master/templates/kubernetes.conf.j29
-rw-r--r--roles/fluentd_node/tasks/main.yml57
-rw-r--r--roles/fluentd_node/templates/kubernetes.conf.j253
-rw-r--r--roles/fluentd_node/templates/td-agent.j22
-rw-r--r--roles/openshift_common/tasks/main.yml1
-rw-r--r--roles/openshift_examples/files/examples/v1.1/infrastructure-templates/enterprise/metrics-deployer.yaml2
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py27
-rw-r--r--roles/openshift_master/tasks/main.yml32
-rw-r--r--roles/openshift_master/tasks/set_loopback_context.yml31
-rw-r--r--roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j23
-rw-r--r--roles/openshift_persistent_volumes/templates/persistent-volume.yml.j23
23 files changed, 150 insertions, 271 deletions
diff --git a/.tito/packages/openshift-ansible b/.tito/packages/openshift-ansible
index bfc9e0962..d176e08c5 100644
--- a/.tito/packages/openshift-ansible
+++ b/.tito/packages/openshift-ansible
@@ -1 +1 @@
-3.0.39-1 ./
+3.0.40-1 ./
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index 450101785..dcda14c63 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -670,6 +670,33 @@ class FilterModule(object):
return rpms_31
+ @staticmethod
+ def oo_pods_match_component(pods, deployment_type, component):
+ """ Filters a list of Pods and returns the ones matching the deployment_type and component
+ """
+ if not isinstance(pods, list):
+ raise errors.AnsibleFilterError("failed expects to filter on a list")
+ if not isinstance(deployment_type, basestring):
+ raise errors.AnsibleFilterError("failed expects deployment_type to be a string")
+ if not isinstance(component, basestring):
+ raise errors.AnsibleFilterError("failed expects component to be a string")
+
+ image_prefix = 'openshift/origin-'
+ if deployment_type in ['enterprise', 'online', 'openshift-enterprise']:
+ image_prefix = 'openshift3/ose-'
+ elif deployment_type == 'atomic-enterprise':
+ image_prefix = 'aep3_beta/aep-'
+
+ matching_pods = []
+ image_regex = image_prefix + component + r'.*'
+ for pod in pods:
+ for container in pod['spec']['containers']:
+ if re.search(image_regex, container['image']):
+ matching_pods.append(pod)
+ break # stop here, don't add a pod more than once
+
+ return matching_pods
+
def filters(self):
""" returns a mapping of filters to methods """
return {
@@ -696,4 +723,5 @@ class FilterModule(object):
"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,
+ "oo_pods_match_component": self.oo_pods_match_component,
}
diff --git a/inventory/byo/hosts.aep.example b/inventory/byo/hosts.aep.example
index ca625d956..a2e1708d4 100644
--- a/inventory/byo/hosts.aep.example
+++ b/inventory/byo/hosts.aep.example
@@ -89,9 +89,6 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
#osm_mcs_labels_per_project=5
#osm_uid_allocator_range='1000000000-1999999999/10000'
-# Configure Fluentd
-#use_fluentd=true
-
# Enable cockpit
#osm_use_cockpit=true
#
diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example
index 7eeb9ef37..de1d0f88b 100644
--- a/inventory/byo/hosts.origin.example
+++ b/inventory/byo/hosts.origin.example
@@ -94,9 +94,6 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
#osm_mcs_labels_per_project=5
#osm_uid_allocator_range='1000000000-1999999999/10000'
-# Configure Fluentd
-#use_fluentd=true
-
# Enable cockpit
#osm_use_cockpit=true
#
diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example
index 26caba36a..c80be574f 100644
--- a/inventory/byo/hosts.ose.example
+++ b/inventory/byo/hosts.ose.example
@@ -89,9 +89,6 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
#osm_mcs_labels_per_project=5
#osm_uid_allocator_range='1000000000-1999999999/10000'
-# Configure Fluentd
-#use_fluentd=true
-
# Enable cockpit
#osm_use_cockpit=true
#
diff --git a/openshift-ansible.spec b/openshift-ansible.spec
index b6efaafdb..7c7fb399c 100644
--- a/openshift-ansible.spec
+++ b/openshift-ansible.spec
@@ -5,7 +5,7 @@
}
Name: openshift-ansible
-Version: 3.0.39
+Version: 3.0.40
Release: 1%{?dist}
Summary: Openshift and Atomic Enterprise Ansible
License: ASL 2.0
@@ -259,6 +259,40 @@ Atomic OpenShift Utilities includes
%changelog
+* Thu Feb 11 2016 Brenton Leanhardt <bleanhar@redhat.com> 3.0.40-1
+- Bug 1306665 - [metrics] update metrics-deployer template to use latest image
+ versions (bleanhar@redhat.com)
+- Add organizations attribute to github identity provider (jdetiber@redhat.com)
+- use correct dict key (jdiaz@redhat.com)
+- handle being passed an empty group list (jdiaz@redhat.com)
+- fix default value (jdetiber@redhat.com)
+- removed notscheduleable trigger, it just makes noise in its current
+ incarnation (sten@redhat.com)
+- trigger on two successive bad pid counts (jdiaz@redhat.com)
+- added nodes not ready and nodes not schedulable triggers (sten@redhat.com)
+- Enable selection of kubeproxy mode (vishal.patil@nuagenetworks.net)
+- add default storage plugins to 'origin' deployment_type
+ (rvanveelen@tremorvideo.com)
+- added nodes not ready and nodes not schedulable triggers (sten@redhat.com)
+- Don't mask master service on atomic. (abutcher@redhat.com)
+- update defaults and examples w/ iscsi plugin (rvanveelen@tremorvideo.com)
+- add iscsi storage_plugin dependency (rvanveelen@tremorvideo.com)
+- Add gte check for 3.2, update version checks to gte (jdetiber@redhat.com)
+- Specify default namespace when creating router (pat2man@gmail.com)
+- add missing connection:local (jdetiber@redhat.com)
+- consolidate oo_first_master post-config a bit, fix some roles that use
+ openshift_facts without declaring a dependency (jdetiber@redhat.com)
+- openshift_serviceaccounts updates (jdetiber@redhat.com)
+- Fix infra_node deployment (jdetiber@redhat.com)
+- changed registry checks to alert based on number of registries with problems
+ (sten@redhat.com)
+- Fix a bug with existing CNAME records (rharriso@redhat.com)
+- Fix HA typo in example AEP/OSE/Origin inventories (adellape@redhat.com)
+- Updated the key for app create (kwoodson@redhat.com)
+- Add missing atomic- and openshift-enterprise (pep@redhat.com)
+- Fix enabling iptables for latest rhel versions (jdetiber@redhat.com)
+- Make pod_eviction_timeout configurable from cli (jawed.khelil@amadeus.com)
+
* 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)
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 342a12810..3f5c37dde 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
@@ -74,6 +74,11 @@
- set_fact:
g_new_version: "{{ g_aos_versions.curr_version.split('-', 1).0 if g_aos_versions.avail_version is none else g_aos_versions.avail_version.split('-', 1).0 }}"
+ when: openshift_pkg_version is not defined
+
+ - set_fact:
+ g_new_version: "{{ openshift_pkg_version | replace('-','') }}"
+ when: openshift_pkg_version is defined
- fail:
msg: This playbook requires Origin 1.0.6 or later
@@ -567,46 +572,55 @@
- role: openshift_examples
openshift_examples_import_command: replace
pre_tasks:
- - name: Check for default router
+ - name: Collect all routers
command: >
- {{ oc_cmd }} get -n default dc/router
- register: _default_router
+ {{ oc_cmd }} get pods --all-namespaces -l 'router' -o json
+ register: all_routers
failed_when: false
changed_when: false
+ - set_fact: haproxy_routers="{{ (all_routers.stdout | from_json)['items'] | oo_pods_match_component(openshift_deployment_type, 'haproxy-router') | oo_select_keys_from_list(['metadata']) }}"
+ when: all_routers.rc == 0
+
+ - set_fact: haproxy_routers=[]
+ when: all_routers.rc != 0
+
- name: Check for allowHostNetwork and allowHostPorts
- when: _default_router.rc == 0
+ when: all_routers.rc == 0
shell: >
{{ oc_cmd }} get -o yaml scc/privileged | /usr/bin/grep -e allowHostPorts -e allowHostNetwork
register: _scc
- name: Grant allowHostNetwork and allowHostPorts
when:
- - _default_router.rc == 0
+ - all_routers.rc == 0
- "'false' in _scc.stdout"
command: >
{{ oc_cmd }} patch scc/privileged -p
'{"allowHostPorts":true,"allowHostNetwork":true}' --api-version=v1
- name: Update deployment config to 1.0.4/3.0.1 spec
- when: _default_router.rc == 0
+ when: all_routers.rc == 0
command: >
- {{ oc_cmd }} patch dc/router -p
+ {{ oc_cmd }} patch dc/{{ item['labels']['deploymentconfig'] }} -p
'{"spec":{"strategy":{"rollingParams":{"updatePercent":-10},"spec":{"serviceAccount":"router","serviceAccountName":"router"}}}}'
--api-version=v1
+ with_items: haproxy_routers
- name: Switch to hostNetwork=true
- when: _default_router.rc == 0
+ when: all_routers.rc == 0
command: >
- {{ oc_cmd }} patch dc/router -p '{"spec":{"template":{"spec":{"hostNetwork":true}}}}'
+ {{ oc_cmd }} patch dc/{{ item['labels']['deploymentconfig'] }} -p '{"spec":{"template":{"spec":{"hostNetwork":true}}}}'
--api-version=v1
+ with_items: haproxy_routers
- name: Update router image to current version
- when: _default_router.rc == 0
+ when: all_routers.rc == 0
command: >
- {{ oc_cmd }} patch dc/router -p
+ {{ oc_cmd }} patch dc/{{ item['labels']['deploymentconfig'] }} -p
'{"spec":{"template":{"spec":{"containers":[{"name":"router","image":"{{ router_image }}"}]}}}}'
--api-version=v1
+ with_items: haproxy_routers
- name: Check for default registry
command: >
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml
index d8336fcae..d7a2ac405 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml
@@ -20,13 +20,27 @@
- role: openshift_examples
openshift_examples_import_command: replace
pre_tasks:
- - name: Check for default router
+ - name: Collect all routers
command: >
- {{ oc_cmd }} get -n default dc/router
- register: _default_router
+ {{ oc_cmd }} get pods --all-namespaces -l 'router' -o json
+ register: all_routers
failed_when: false
changed_when: false
+ - set_fact: haproxy_routers="{{ (all_routers.stdout | from_json)['items'] | oo_pods_match_component(openshift_deployment_type, 'haproxy-router') | oo_select_keys_from_list(['metadata']) }}"
+ when: all_routers.rc == 0
+
+ - set_fact: haproxy_routers=[]
+ when: all_routers.rc != 0
+
+ - name: Update router image to current version
+ when: all_routers.rc == 0
+ command: >
+ {{ oc_cmd }} patch dc/{{ item['labels']['deploymentconfig'] }} -p
+ '{"spec":{"template":{"spec":{"containers":[{"name":"router","image":"{{ router_image }}"}]}}}}'
+ --api-version=v1
+ with_items: haproxy_routers
+
- name: Check for default registry
command: >
{{ oc_cmd }} get -n default dc/docker-registry
@@ -34,13 +48,6 @@
failed_when: false
changed_when: false
- - name: Update router image to current version
- when: _default_router.rc == 0
- command: >
- {{ oc_cmd }} patch dc/router -p
- '{"spec":{"template":{"spec":{"containers":[{"name":"router","image":"{{ router_image }}"}]}}}}'
- --api-version=v1
-
- name: Update registry image to current version
when: _default_registry.rc == 0
command: >
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_minor/pre.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_minor/pre.yml
index 91780de09..12b9c84d3 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_minor/pre.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_minor/pre.yml
@@ -41,7 +41,7 @@
g_new_service_name: "{{ 'origin' if deployment_type =='origin' else 'atomic-openshift' }}"
- name: Determine available versions
- script: ../files/versions.sh {{ g_new_service_name }} openshift
+ script: ../files/versions.sh {{ g_new_service_name }}
register: g_versions_result
- set_fact:
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml
index bba53151a..77edbd1a6 100644
--- a/playbooks/common/openshift-master/config.yml
+++ b/playbooks/common/openshift-master/config.yml
@@ -352,8 +352,6 @@
roles:
- openshift_master
- role: nickhammond.logrotate
- - role: fluentd_master
- when: openshift.common.use_fluentd | bool
- role: nuage_master
when: openshift.common.use_nuage | bool
post_tasks:
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml
index 01e637f7a..56d30e9b9 100644
--- a/playbooks/common/openshift-node/config.yml
+++ b/playbooks/common/openshift-node/config.yml
@@ -217,8 +217,6 @@
- role: nuage_node
when: openshift.common.use_nuage | bool
- role: nickhammond.logrotate
- - role: fluentd_node
- when: openshift.common.use_fluentd | bool
tasks:
- name: Create group for deployment type
group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }}
diff --git a/roles/fluentd_master/tasks/main.yml b/roles/fluentd_master/tasks/main.yml
deleted file mode 100644
index 32f972f0a..000000000
--- a/roles/fluentd_master/tasks/main.yml
+++ /dev/null
@@ -1,57 +0,0 @@
----
-- fail:
- msg: "fluentd master is not yet supported on atomic hosts"
- when: openshift.common.is_atomic | bool
-
-# TODO: Update fluentd install and configuration when packaging is complete
-- name: download and install td-agent
- action: "{{ ansible_pkg_mgr }} name='http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm' state=present"
- when: not openshift.common.is_atomic | bool
-
-- name: Verify fluentd plugin installed
- command: '/opt/td-agent/embedded/bin/gem query -i fluent-plugin-kubernetes'
- register: _fluent_plugin_check
- failed_when: false
- changed_when: false
-
-- name: install Kubernetes fluentd plugin
- command: '/opt/td-agent/embedded/bin/gem install fluent-plugin-kubernetes'
- when: _fluent_plugin_check.rc == 1
-
-- name: Creates directories
- file:
- path: "{{ item }}"
- state: directory
- group: 'td-agent'
- owner: 'td-agent'
- mode: 0755
- with_items: ['/etc/td-agent/config.d']
-
-- name: Add include to td-agent configuration
- lineinfile:
- dest: '/etc/td-agent/td-agent.conf'
- regexp: '^@include config.d'
- line: '@include config.d/*.conf'
- state: present
-
-- name: install Kubernetes fluentd configuration file
- template:
- src: kubernetes.conf.j2
- dest: /etc/td-agent/config.d/kubernetes.conf
- group: 'td-agent'
- owner: 'td-agent'
- mode: 0444
-
-- name: wait for etcd to start up
- wait_for: port=4001 delay=10
- when: embedded_etcd | bool
-
-- name: wait for etcd peer to start up
- wait_for: port=7001 delay=10
- when: embedded_etcd | bool
-
-- name: ensure td-agent is running
- service:
- name: 'td-agent'
- state: started
- enabled: yes
diff --git a/roles/fluentd_master/templates/kubernetes.conf.j2 b/roles/fluentd_master/templates/kubernetes.conf.j2
deleted file mode 100644
index 7b5c86062..000000000
--- a/roles/fluentd_master/templates/kubernetes.conf.j2
+++ /dev/null
@@ -1,9 +0,0 @@
-<match kubernetes.**>
- type file
- path /var/log/td-agent/containers.log
- time_slice_format %Y%m%d
- time_slice_wait 10m
- time_format %Y%m%dT%H%M%S%z
- compress gzip
- utc
-</match>
diff --git a/roles/fluentd_node/tasks/main.yml b/roles/fluentd_node/tasks/main.yml
deleted file mode 100644
index 9fd908687..000000000
--- a/roles/fluentd_node/tasks/main.yml
+++ /dev/null
@@ -1,57 +0,0 @@
----
-- fail:
- msg: "fluentd node is not yet supported on atomic hosts"
- when: openshift.common.is_atomic | bool
-
-# TODO: Update fluentd install and configuration when packaging is complete
-- name: download and install td-agent
- action: "{{ ansible_pkg_mgr }} name='http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm' state=present"
- when: not openshift.common.is_atomic | bool
-
-- name: Verify fluentd plugin installed
- command: '/opt/td-agent/embedded/bin/gem query -i fluent-plugin-kubernetes'
- register: _fluent_plugin_check
- failed_when: false
- changed_when: false
-
-- name: install Kubernetes fluentd plugin
- command: '/opt/td-agent/embedded/bin/gem install fluent-plugin-kubernetes'
- when: _fluent_plugin_check.rc == 1
-
-- name: Override td-agent configuration file
- template:
- src: td-agent.j2
- dest: /etc/sysconfig/td-agent
- group: 'td-agent'
- owner: 'td-agent'
- mode: 0444
-
-- name: Creates directories
- file:
- path: "{{ item }}"
- state: directory
- group: 'td-agent'
- owner: 'td-agent'
- mode: 0755
- with_items: ['/etc/td-agent/config.d', '/var/log/td-agent/tmp']
-
-- name: Add include to td-agent configuration
- lineinfile:
- dest: '/etc/td-agent/td-agent.conf'
- regexp: '^@include config.d'
- line: '@include config.d/*.conf'
- state: present
-
-- name: install Kubernetes fluentd configuration file
- template:
- src: kubernetes.conf.j2
- dest: /etc/td-agent/config.d/kubernetes.conf
- group: 'td-agent'
- owner: 'td-agent'
- mode: 0444
-
-- name: ensure td-agent is running
- service:
- name: 'td-agent'
- state: started
- enabled: yes
diff --git a/roles/fluentd_node/templates/kubernetes.conf.j2 b/roles/fluentd_node/templates/kubernetes.conf.j2
deleted file mode 100644
index 5f1eecb20..000000000
--- a/roles/fluentd_node/templates/kubernetes.conf.j2
+++ /dev/null
@@ -1,53 +0,0 @@
-<source>
- type tail
- path /var/lib/docker/containers/*/*-json.log
- pos_file /var/log/td-agent/tmp/fluentd-docker.pos
- time_format %Y-%m-%dT%H:%M:%S
- tag docker.*
- format json
- read_from_head true
-</source>
-
-<match docker.var.lib.docker.containers.*.*.log>
- type kubernetes
- container_id ${tag_parts[5]}
- tag docker.${name}
-</match>
-
-<match kubernetes>
- type copy
-
- <store>
- type forward
- send_timeout 60s
- recover_wait 10s
- heartbeat_interval 1s
- phi_threshold 16
- hard_timeout 60s
- log_level trace
- require_ack_response true
- heartbeat_type tcp
-
- <server>
- name {{groups['oo_first_master'][0]}}
- host {{hostvars[groups['oo_first_master'][0]].openshift.common.hostname}}
- port 24224
- weight 60
- </server>
-
- <secondary>
- type file
- path /var/log/td-agent/forward-failed
- </secondary>
- </store>
-
- <store>
- type file
- path /var/log/td-agent/containers.log
- time_slice_format %Y%m%d
- time_slice_wait 10m
- time_format %Y%m%dT%H%M%S%z
- compress gzip
- utc
- </store>
-</match>
diff --git a/roles/fluentd_node/templates/td-agent.j2 b/roles/fluentd_node/templates/td-agent.j2
deleted file mode 100644
index 7245e11ec..000000000
--- a/roles/fluentd_node/templates/td-agent.j2
+++ /dev/null
@@ -1,2 +0,0 @@
-DAEMON_ARGS=
-TD_AGENT_ARGS="/usr/sbin/td-agent --log /var/log/td-agent/td-agent.log --use-v1-config"
diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml
index 06e2c0878..a2fcff507 100644
--- a/roles/openshift_common/tasks/main.yml
+++ b/roles/openshift_common/tasks/main.yml
@@ -29,7 +29,6 @@
use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(None) }}"
sdn_network_plugin_name: "{{ os_sdn_network_plugin_name | default(None) }}"
deployment_type: "{{ openshift_deployment_type }}"
- use_fluentd: "{{ openshift_use_fluentd | default(None) }}"
use_flannel: "{{ openshift_use_flannel | default(None) }}"
use_nuage: "{{ openshift_use_nuage | default(None) }}"
use_manageiq: "{{ openshift_use_manageiq | default(None) }}"
diff --git a/roles/openshift_examples/files/examples/v1.1/infrastructure-templates/enterprise/metrics-deployer.yaml b/roles/openshift_examples/files/examples/v1.1/infrastructure-templates/enterprise/metrics-deployer.yaml
index ddd9f2f75..be999bd1a 100644
--- a/roles/openshift_examples/files/examples/v1.1/infrastructure-templates/enterprise/metrics-deployer.yaml
+++ b/roles/openshift_examples/files/examples/v1.1/infrastructure-templates/enterprise/metrics-deployer.yaml
@@ -85,7 +85,7 @@ parameters:
-
description: 'Specify version for metrics components; e.g. for "openshift/origin-metrics-deployer:v1.1", set version "v1.1"'
name: IMAGE_VERSION
- value: "3.1.0"
+ value: "3.1.1"
-
description: "Internal URL for the master, for authentication retrieval"
name: MASTER_URL
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 5f5c5c788..25b9534dd 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -304,23 +304,6 @@ def normalize_provider_facts(provider, metadata):
facts = normalize_openstack_facts(metadata, facts)
return facts
-def set_fluentd_facts_if_unset(facts):
- """ Set fluentd facts if not already present in facts dict
- dict: the facts dict updated with the generated fluentd facts if
- missing
- Args:
- facts (dict): existing facts
- Returns:
- dict: the facts dict updated with the generated fluentd
- facts if they were not already present
-
- """
- if 'common' in facts:
- if 'use_fluentd' not in facts['common']:
- use_fluentd = False
- facts['common']['use_fluentd'] = use_fluentd
- return facts
-
def set_flannel_facts_if_unset(facts):
""" Set flannel facts if not already present in facts dict
dict: the facts dict updated with the flannel facts if
@@ -525,10 +508,11 @@ def set_url_facts_if_unset(facts):
ports[prefix]))
- r_lhn = "{0}:{1}".format(api_hostname, ports['api']).replace('.', '-')
+ r_lhn = "{0}:{1}".format(hostname, ports['api']).replace('.', '-')
+ r_lhu = "system:openshift-master/{0}:{1}".format(api_hostname, ports['api']).replace('.', '-')
facts['master'].setdefault('loopback_cluster_name', r_lhn)
facts['master'].setdefault('loopback_context_name', "default/{0}/system:openshift-master".format(r_lhn))
- facts['master'].setdefault('loopback_user', "system:openshift-master/{0}".format(r_lhn))
+ facts['master'].setdefault('loopback_user', r_lhu)
prefix_hosts = [('console', api_hostname), ('public_console', api_public_hostname)]
for prefix, host in prefix_hosts:
@@ -736,9 +720,9 @@ def set_version_facts_if_unset(facts):
version_gte_3_1_1_or_1_1_1 = LooseVersion(version) >= LooseVersion('1.1.1')
version_gte_3_2_or_1_2 = LooseVersion(version) >= LooseVersion('1.1.2')
else:
- version_gte_3_1_or_1_1 = LooseVersion(version) >= LooseVersion('3.1.0')
+ version_gte_3_1_or_1_1 = LooseVersion(version) >= LooseVersion('3.0.2.905')
version_gte_3_1_1_or_1_1_1 = LooseVersion(version) >= LooseVersion('3.1.1')
- version_gte_3_2_or_1_2 = LooseVersion(version) >= LooseVersion('3.2.0')
+ version_gte_3_2_or_1_2 = LooseVersion(version) >= LooseVersion('3.1.1.901')
else:
version_gte_3_1_or_1_1 = True
version_gte_3_1_1_or_1_1_1 = True
@@ -1171,7 +1155,6 @@ class OpenShiftFacts(object):
facts['current_config'] = get_current_config(facts)
facts = set_url_facts_if_unset(facts)
facts = set_project_cfg_facts_if_unset(facts)
- facts = set_fluentd_facts_if_unset(facts)
facts = set_flannel_facts_if_unset(facts)
facts = set_nuage_facts_if_unset(facts)
facts = set_node_schedulability(facts)
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index 3613808b6..4aede31f6 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -240,36 +240,8 @@
- restart master api
- restart master controllers
-- name: Test local loopback context
- command: >
- {{ openshift.common.client_binary }} config view
- --config={{ openshift_master_loopback_config }}
- changed_when: false
- register: loopback_config
-
-- command: >
- {{ openshift.common.client_binary }} config set-cluster
- --certificate-authority={{ openshift_master_config_dir }}/ca.crt
- --embed-certs=true --server={{ openshift.master.loopback_api_url }}
- {{ openshift.master.loopback_cluster_name }}
- --config={{ openshift_master_loopback_config }}
- when: loopback_context_string not in loopback_config.stdout
- register: set_loopback_cluster
-
-- command: >
- {{ openshift.common.client_binary }} config set-context
- --cluster={{ openshift.master.loopback_cluster_name }}
- --namespace=default --user={{ openshift.master.loopback_user }}
- {{ openshift.master.loopback_context_name }}
- --config={{ openshift_master_loopback_config }}
- when: set_loopback_cluster | changed
- register: set_loopback_context
-
-- command: >
- {{ openshift.common.client_binary }} config use-context {{ openshift.master.loopback_context_name }}
- --config={{ openshift_master_loopback_config }}
- when: set_loopback_context | changed
- register: set_current_context
+- include: set_loopback_context.yml
+ when: openshift.common.version_gte_3_2_or_1_2
- name: Start and enable master
service: name={{ openshift.common.service_type }}-master enabled=yes state=started
diff --git a/roles/openshift_master/tasks/set_loopback_context.yml b/roles/openshift_master/tasks/set_loopback_context.yml
new file mode 100644
index 000000000..9c3fb31dc
--- /dev/null
+++ b/roles/openshift_master/tasks/set_loopback_context.yml
@@ -0,0 +1,31 @@
+---
+- name: Test local loopback context
+ command: >
+ {{ openshift.common.client_binary }} config view
+ --config={{ openshift_master_loopback_config }}
+ changed_when: false
+ register: loopback_config
+
+- command: >
+ {{ openshift.common.client_binary }} config set-cluster
+ --certificate-authority={{ openshift_master_config_dir }}/ca.crt
+ --embed-certs=true --server={{ openshift.master.loopback_api_url }}
+ {{ openshift.master.loopback_cluster_name }}
+ --config={{ openshift_master_loopback_config }}
+ when: loopback_context_string not in loopback_config.stdout
+ register: set_loopback_cluster
+
+- command: >
+ {{ openshift.common.client_binary }} config set-context
+ --cluster={{ openshift.master.loopback_cluster_name }}
+ --namespace=default --user={{ openshift.master.loopback_user }}
+ {{ openshift.master.loopback_context_name }}
+ --config={{ openshift_master_loopback_config }}
+ when: set_loopback_cluster | changed
+ register: set_loopback_context
+
+- command: >
+ {{ openshift.common.client_binary }} config use-context {{ openshift.master.loopback_context_name }}
+ --config={{ openshift_master_loopback_config }}
+ when: set_loopback_context | changed
+ register: set_current_context
diff --git a/roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2 b/roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2
index 58b3e1c67..d40417a9a 100644
--- a/roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2
+++ b/roles/openshift_persistent_volumes/templates/persistent-volume-claim.yml.j2
@@ -3,7 +3,8 @@ apiVersion: "v1"
kind: "List"
items:
{% for claim in persistent_volume_claims %}
-- kind: "PersistentVolumeClaim"
+- apiVersion: "v1"
+ kind: "PersistentVolumeClaim"
metadata:
name: "{{ claim.name }}"
spec:
diff --git a/roles/openshift_persistent_volumes/templates/persistent-volume.yml.j2 b/roles/openshift_persistent_volumes/templates/persistent-volume.yml.j2
index 5714b6b0d..877e88002 100644
--- a/roles/openshift_persistent_volumes/templates/persistent-volume.yml.j2
+++ b/roles/openshift_persistent_volumes/templates/persistent-volume.yml.j2
@@ -3,7 +3,8 @@ apiVersion: v1
kind: List
items:
{% for volume in persistent_volumes %}
-- kind: PersistentVolume
+- apiVersion: v1
+ kind: PersistentVolume
metadata:
name: "{{ volume.name }}"
spec: