summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_docker/defaults/main.yml2
-rw-r--r--roles/openshift_docker/tasks/main.yml20
-rw-r--r--roles/openshift_docker_facts/tasks/main.yml2
l---------roles/openshift_examples/files/examples/latest2
-rw-r--r--roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-ephemeral-template.json12
-rw-r--r--roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-persistent-template.json2
-rw-r--r--roles/openshift_examples/files/examples/v1.2/db-templates/mysql-ephemeral-template.json2
-rw-r--r--roles/openshift_examples/files/examples/v1.2/db-templates/postgresql-ephemeral-template.json2
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp-mysql.json18
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp.json2
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer-mysql.json18
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer.json2
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/django-postgresql.json18
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/django.json2
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-ephemeral-template.json10
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-persistent-template.json8
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs-mongodb.json20
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs.json2
-rw-r--r--roles/openshift_examples/files/examples/v1.2/quickstart-templates/rails-postgresql.json18
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py2
-rw-r--r--roles/openshift_node/handlers/main.yml7
-rw-r--r--roles/openshift_node/tasks/systemd_units.yml2
-rw-r--r--roles/rhel_subscribe/tasks/main.yml11
23 files changed, 137 insertions, 47 deletions
diff --git a/roles/openshift_docker/defaults/main.yml b/roles/openshift_docker/defaults/main.yml
new file mode 100644
index 000000000..aebef75d6
--- /dev/null
+++ b/roles/openshift_docker/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+upgrading: False
diff --git a/roles/openshift_docker/tasks/main.yml b/roles/openshift_docker/tasks/main.yml
index 4e5cec82f..9c5887f76 100644
--- a/roles/openshift_docker/tasks/main.yml
+++ b/roles/openshift_docker/tasks/main.yml
@@ -2,20 +2,32 @@
# It's important that we don't explicitly pull this image here. Otherwise we
# could result in upgrading a preinstalled environment. We'll have to set
# openshift_image_tag correctly for upgrades.
+- set_fact:
+ is_containerized: "{{ openshift.common.is_containerized | default(False) | bool }}"
+ # Does the host already have an image tag fact, used to determine if it's a new node
+ # in non-upgrade scenarios:
+ has_image_tag_fact: "{{ hostvars[inventory_hostname].openshift.docker.openshift_image_tag is defined }}"
+
- name: Set version when containerized
command: >
docker run --rm {{ openshift.common.cli_image }} version
register: cli_image_version
- when: openshift.common.is_containerized is defined and openshift.common.is_containerized | bool and openshift_image_tag is not defined
+ when: is_containerized | bool and openshift_image_tag is not defined and (upgrading | bool or not has_image_tag_fact | bool)
+
+# Use the pre-existing image tag from system facts if present, and we're not upgrading.
+# Ignores explicit openshift_image_tag if it's in the inventory, as this isn't an upgrade.
+- set_fact:
+ l_image_tag: "{{ hostvars[inventory_hostname].openshift.docker.openshift_image_tag }}"
+ when: is_containerized | bool and not upgrading | bool and has_image_tag_fact | bool
- set_fact:
l_image_tag: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0:2] | join('-') if openshift.common.deployment_type == 'origin' else
cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0] }}"
- when: openshift.common.is_containerized is defined and openshift.common.is_containerized | bool and openshift_image_tag is not defined
+ when: is_containerized | bool and openshift_image_tag is not defined and (upgrading | bool or not has_image_tag_fact | bool)
- set_fact:
l_image_tag: "{{ openshift_image_tag }}"
- when: openshift.common.is_containerized is defined and openshift.common.is_containerized | bool and openshift_image_tag is defined
+ when: is_containerized | bool and openshift_image_tag is defined and (upgrading | bool or not has_image_tag_fact | bool)
- name: Set post docker install facts
openshift_facts:
@@ -26,4 +38,4 @@
local_facts:
openshift_image_tag: "{{ l_image_tag | default(None) }}"
openshift_version: "{{ l_image_tag.split('-')[0] | oo_image_tag_to_rpm_version if l_image_tag is defined else '' }}"
- when: openshift.common.is_containerized is defined and openshift.common.is_containerized | bool
+ when: is_containerized | bool
diff --git a/roles/openshift_docker_facts/tasks/main.yml b/roles/openshift_docker_facts/tasks/main.yml
index 3acd2bba8..0e51fd16f 100644
--- a/roles/openshift_docker_facts/tasks/main.yml
+++ b/roles/openshift_docker_facts/tasks/main.yml
@@ -35,7 +35,7 @@
docker_options: >
--insecure-registry={{ openshift.docker.hosted_registry_network }}
{{ openshift.docker.options | default ('') }}
- when: openshift.docker.hosted_registry_insecure | default(False) | bool
+ when: openshift.docker.hosted_registry_insecure | default(False) | bool and openshift.docker.hosted_registry_network is defined
- set_fact:
docker_options: "{{ openshift.docker.options | default(omit) }}"
diff --git a/roles/openshift_examples/files/examples/latest b/roles/openshift_examples/files/examples/latest
index 634650e09..f7e713306 120000
--- a/roles/openshift_examples/files/examples/latest
+++ b/roles/openshift_examples/files/examples/latest
@@ -1 +1 @@
-v1.1 \ No newline at end of file
+v1.2 \ No newline at end of file
diff --git a/roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-ephemeral-template.json
index 227c8d30e..0e618624b 100644
--- a/roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-ephemeral-template.json
+++ b/roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-ephemeral-template.json
@@ -54,7 +54,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"mongodb"
],
@@ -96,7 +96,7 @@
"timeoutSeconds": 1,
"initialDelaySeconds": 3,
"exec": {
- "command": [ "/bin/sh", "-i", "-c", "mongostat --host 127.0.0.1 -u admin -p $MONGODB_ADMIN_PASSWORD -n 1 --noheaders"]
+ "command": [ "/bin/sh", "-i", "-c", "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""]
}
},
"livenessProbe": {
@@ -125,10 +125,10 @@
}
],
"resources": {
- "limits": {
- "memory": "${MEMORY_LIMIT}"
- }
- },
+ "limits": {
+ "memory": "${MEMORY_LIMIT}"
+ }
+ },
"volumeMounts": [
{
"name": "${DATABASE_SERVICE_NAME}-data",
diff --git a/roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-persistent-template.json b/roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-persistent-template.json
index 70c906f8e..07290b1ea 100644
--- a/roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-persistent-template.json
+++ b/roles/openshift_examples/files/examples/v1.2/db-templates/mongodb-persistent-template.json
@@ -113,7 +113,7 @@
"timeoutSeconds": 1,
"initialDelaySeconds": 3,
"exec": {
- "command": [ "/bin/sh", "-i", "-c", "mongostat --host 127.0.0.1 -u admin -p $MONGODB_ADMIN_PASSWORD -n 1 --noheaders"]
+ "command": [ "/bin/sh", "-i", "-c", "mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p $MONGODB_PASSWORD --eval=\"quit()\""]
}
},
"livenessProbe": {
diff --git a/roles/openshift_examples/files/examples/v1.2/db-templates/mysql-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.2/db-templates/mysql-ephemeral-template.json
index f4c118052..1457d288c 100644
--- a/roles/openshift_examples/files/examples/v1.2/db-templates/mysql-ephemeral-template.json
+++ b/roles/openshift_examples/files/examples/v1.2/db-templates/mysql-ephemeral-template.json
@@ -54,7 +54,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"mysql"
],
diff --git a/roles/openshift_examples/files/examples/v1.2/db-templates/postgresql-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.2/db-templates/postgresql-ephemeral-template.json
index c14f3c3df..39a71f25c 100644
--- a/roles/openshift_examples/files/examples/v1.2/db-templates/postgresql-ephemeral-template.json
+++ b/roles/openshift_examples/files/examples/v1.2/db-templates/postgresql-ephemeral-template.json
@@ -54,7 +54,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"postgresql"
],
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp-mysql.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp-mysql.json
index 922e5bed8..370b8c764 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp-mysql.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp-mysql.json
@@ -166,7 +166,7 @@
"containers": [
{
"name": "cakephp-mysql-example",
- "image": "cakephp-mysql-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
@@ -276,7 +276,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"mysql"
],
@@ -303,15 +303,27 @@
}
},
"spec": {
+ "volumes": [
+ {
+ "name": "data",
+ "emptyDir": {}
+ }
+ ],
"containers": [
{
"name": "mysql",
- "image": "mysql",
+ "image": " ",
"ports": [
{
"containerPort": 3306
}
],
+ "volumeMounts": [
+ {
+ "name": "data",
+ "mountPath": "/var/lib/mysql/data"
+ }
+ ],
"readinessProbe": {
"timeoutSeconds": 1,
"initialDelaySeconds": 5,
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp.json
index 780faec55..dbf570f1f 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/cakephp.json
@@ -155,7 +155,7 @@
"containers": [
{
"name": "cakephp-example",
- "image": "cakephp-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer-mysql.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer-mysql.json
index c0fc02ae4..3b738480d 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer-mysql.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer-mysql.json
@@ -152,7 +152,7 @@
"containers": [
{
"name": "dancer-mysql-example",
- "image": "dancer-mysql-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
@@ -250,7 +250,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"mysql"
],
@@ -277,15 +277,27 @@
}
},
"spec": {
+ "volumes": [
+ {
+ "name": "data",
+ "emptyDir": {}
+ }
+ ],
"containers": [
{
"name": "mysql",
- "image": "mysql",
+ "image": " ",
"ports": [
{
"containerPort": 3306
}
],
+ "volumeMounts": [
+ {
+ "name": "data",
+ "mountPath": "/var/lib/mysql/data"
+ }
+ ],
"readinessProbe": {
"timeoutSeconds": 1,
"initialDelaySeconds": 5,
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer.json
index 1ea5a21a0..852f20102 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/dancer.json
@@ -155,7 +155,7 @@
"containers": [
{
"name": "dancer-example",
- "image": "dancer-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/django-postgresql.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/django-postgresql.json
index 844201e7c..f044152b3 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/django-postgresql.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/django-postgresql.json
@@ -158,7 +158,7 @@
"containers": [
{
"name": "django-psql-example",
- "image": "django-psql-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
@@ -260,7 +260,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"postgresql"
],
@@ -287,10 +287,16 @@
}
},
"spec": {
+ "volumes": [
+ {
+ "name": "data",
+ "emptyDir": {}
+ }
+ ],
"containers": [
{
"name": "postgresql",
- "image": "postgresql",
+ "image": " ",
"ports": [
{
"containerPort": 5432
@@ -310,6 +316,12 @@
"value": "${DATABASE_NAME}"
}
],
+ "volumeMounts": [
+ {
+ "name": "data",
+ "mountPath": "/var/lib/pgsql/data"
+ }
+ ],
"readinessProbe": {
"timeoutSeconds": 1,
"initialDelaySeconds": 5,
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/django.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/django.json
index 38ef694f8..5740ee963 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/django.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/django.json
@@ -158,7 +158,7 @@
"containers": [
{
"name": "django-example",
- "image": "django-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-ephemeral-template.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-ephemeral-template.json
index e464b5971..67fce4a46 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-ephemeral-template.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-ephemeral-template.json
@@ -5,7 +5,7 @@
"name": "jenkins-ephemeral",
"creationTimestamp": null,
"annotations": {
- "description": "Jenkins service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
+ "description": "Jenkins service, without persistent storage.\nThe username is 'admin' and the tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.\nWARNING: Any data stored will be lost upon pod destruction. Only use this template for testing",
"iconClass": "icon-jenkins",
"tags": "instant-app,jenkins"
}
@@ -71,7 +71,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"jenkins"
],
@@ -102,7 +102,7 @@
"containers": [
{
"name": "jenkins",
- "image": "${JENKINS_IMAGE}",
+ "image": "JENKINS_IMAGE",
"readinessProbe": {
"timeoutSeconds": 3,
"initialDelaySeconds": 3,
@@ -113,7 +113,7 @@
},
"livenessProbe": {
"timeoutSeconds": 3,
- "initialDelaySeconds": 30,
+ "initialDelaySeconds": 60,
"httpGet": {
"path": "/login",
"port": 8080
@@ -182,7 +182,7 @@
{
"name": "JENKINS_PASSWORD",
"displayName": "Jenkins Password",
- "description": "Password for the Jenkins user.",
+ "description": "Password for the Jenkins 'admin' user.",
"generate": "expression",
"value": "password"
}
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-persistent-template.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-persistent-template.json
index 0d8dcffa1..ef04b4482 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-persistent-template.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/jenkins-persistent-template.json
@@ -5,7 +5,7 @@
"name": "jenkins-persistent",
"creationTimestamp": null,
"annotations": {
- "description": "Jenkins service, with persistent storage. You must have persistent volumes available in your cluster to use this template.",
+ "description": "Jenkins service, with persistent storage.\nThe username is 'admin' and the tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.\nYou must have persistent volumes available in your cluster to use this template.",
"iconClass": "icon-jenkins",
"tags": "instant-app,jenkins"
}
@@ -119,7 +119,7 @@
"containers": [
{
"name": "jenkins",
- "image": "${JENKINS_IMAGE}",
+ "image": "JENKINS_IMAGE",
"readinessProbe": {
"timeoutSeconds": 3,
"initialDelaySeconds": 3,
@@ -130,7 +130,7 @@
},
"livenessProbe": {
"timeoutSeconds": 3,
- "initialDelaySeconds": 30,
+ "initialDelaySeconds": 60,
"httpGet": {
"path": "/login",
"port": 8080
@@ -199,7 +199,7 @@
{
"name": "JENKINS_PASSWORD",
"displayName": "Jenkins Password",
- "description": "Password for the Jenkins user.",
+ "description": "Password for the Jenkins 'admin' user.",
"generate": "expression",
"value": "password"
},
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs-mongodb.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs-mongodb.json
index 661bcbb69..4b64bd463 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs-mongodb.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs-mongodb.json
@@ -164,7 +164,7 @@
"containers": [
{
"name": "nodejs-mongodb-example",
- "image": "nodejs-mongodb-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
@@ -258,7 +258,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"mongodb"
],
@@ -288,7 +288,7 @@
"containers": [
{
"name": "mongodb",
- "image": "mongodb",
+ "image": " ",
"ports": [
{
"containerPort": 27017
@@ -330,6 +330,20 @@
"limits": {
"memory": "${MEMORY_MONGODB_LIMIT}"
}
+ },
+ "volumeMounts": [
+ {
+ "name": "${DATABASE_SERVICE_NAME}-data",
+ "mountPath": "/var/lib/mongodb/data"
+ }
+ ]
+ }
+ ],
+ "volumes": [
+ {
+ "name": "${DATABASE_SERVICE_NAME}-data",
+ "emptyDir": {
+ "medium": ""
}
}
]
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs.json
index 0518dfac7..0adb02a46 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/nodejs.json
@@ -164,7 +164,7 @@
"containers": [
{
"name": "nodejs-example",
- "image": "nodejs-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
diff --git a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/rails-postgresql.json b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/rails-postgresql.json
index 6292cf3e7..82dd757ec 100644
--- a/roles/openshift_examples/files/examples/v1.2/quickstart-templates/rails-postgresql.json
+++ b/roles/openshift_examples/files/examples/v1.2/quickstart-templates/rails-postgresql.json
@@ -169,7 +169,7 @@
"containers": [
{
"name": "rails-postgresql-example",
- "image": "rails-postgresql-example",
+ "image": " ",
"ports": [
{
"containerPort": 8080
@@ -287,7 +287,7 @@
{
"type": "ImageChange",
"imageChangeParams": {
- "automatic": false,
+ "automatic": true,
"containerNames": [
"postgresql"
],
@@ -314,10 +314,16 @@
}
},
"spec": {
+ "volumes": [
+ {
+ "name": "data",
+ "emptyDir": {}
+ }
+ ],
"containers": [
{
"name": "postgresql",
- "image": "postgresql",
+ "image": " ",
"ports": [
{
"containerPort": 5432
@@ -337,6 +343,12 @@
"port": 5432
}
},
+ "volumeMounts": [
+ {
+ "name": "data",
+ "mountPath": "/var/lib/pgsql/data"
+ }
+ ],
"env": [
{
"name": "POSTGRESQL_USER",
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index f8e447b84..b13343776 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -1712,7 +1712,7 @@ class OpenShiftFacts(object):
set_node_ip=False)
if 'docker' in roles:
- docker = dict(disable_push_dockerhub=False)
+ docker = dict(disable_push_dockerhub=False, hosted_registry_insecure=True)
version_info = get_docker_version_info()
if version_info is not None:
docker['api_version'] = version_info['api_version']
diff --git a/roles/openshift_node/handlers/main.yml b/roles/openshift_node/handlers/main.yml
index 1a1dc8ede..df3f6ee65 100644
--- a/roles/openshift_node/handlers/main.yml
+++ b/roles/openshift_node/handlers/main.yml
@@ -1,8 +1,9 @@
---
+- name: restart openvswitch
+ service: name=openvswitch state=restarted
+ when: not (ovs_service_status_changed | default(false) | bool)
+
- name: restart node
service: name={{ openshift.common.service_type }}-node state=restarted
when: not (node_service_status_changed | default(false) | bool)
-- name: restart openvswitch
- service: name=openvswitch state=restarted
- when: not (ovs_service_status_changed | default(false) | bool)
diff --git a/roles/openshift_node/tasks/systemd_units.yml b/roles/openshift_node/tasks/systemd_units.yml
index be4b4ed61..f3262803a 100644
--- a/roles/openshift_node/tasks/systemd_units.yml
+++ b/roles/openshift_node/tasks/systemd_units.yml
@@ -14,6 +14,8 @@
dest: /etc/sysconfig/openvswitch
when: openshift.common.is_containerized | bool
register: install_ovs_sysconfig
+ notify:
+ - restart openvswitch
- name: Install OpenvSwitch docker service file
template:
diff --git a/roles/rhel_subscribe/tasks/main.yml b/roles/rhel_subscribe/tasks/main.yml
index 85e17ff9d..343020dce 100644
--- a/roles/rhel_subscribe/tasks/main.yml
+++ b/roles/rhel_subscribe/tasks/main.yml
@@ -37,8 +37,19 @@
register: openshift_pool_id
changed_when: False
+- name: Determine if OpenShift Pool Already Attached
+ command: subscription-manager list --consumed --matches="{{ rhel_subscription_pool }}" --pool-only
+ register: openshift_pool_attached
+ changed_when: False
+ when: openshift_pool_id.stdout == ''
+
+- fail:
+ msg: "Unable to find pool matching {{ rhel_subscription_pool }} in available or consumed pools"
+ when: openshift_pool_id.stdout == '' and openshift_pool_attached is defined and openshift_pool_attached.stdout == ''
+
- name: Attach to OpenShift Pool
command: subscription-manager subscribe --pool {{ openshift_pool_id.stdout_lines[0] }}
+ when: openshift_pool_id.stdout != ''
- include: enterprise.yml
when: deployment_type in [ 'enterprise', 'atomic-enterprise', 'openshift-enterprise' ] and