summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-02-28 16:32:38 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2016-03-03 09:05:42 -0500
commit7d561bd252a4ddc9e204f31144fbed7fecd99bff (patch)
tree372252fd59dfa4e1f576e54977375621858281d0 /playbooks
parent6b25d27ca4ad9458688902d0c3e7c3a9c7b9c15d (diff)
downloadopenshift-7d561bd252a4ddc9e204f31144fbed7fecd99bff.tar.gz
openshift-7d561bd252a4ddc9e204f31144fbed7fecd99bff.tar.bz2
openshift-7d561bd252a4ddc9e204f31144fbed7fecd99bff.tar.xz
openshift-7d561bd252a4ddc9e204f31144fbed7fecd99bff.zip
Correctly set the image tag for containerized installs (and upgrades)
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/adhoc/uninstall.yml1
-rw-r--r--playbooks/common/openshift-cluster/upgrades/files/ensure_system_units_have_version.sh3
-rw-r--r--playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh20
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/containerized_upgrade.yml4
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml9
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/upgrade.yml9
6 files changed, 10 insertions, 36 deletions
diff --git a/playbooks/adhoc/uninstall.yml b/playbooks/adhoc/uninstall.yml
index ac25c14dd..ec5f6e39e 100644
--- a/playbooks/adhoc/uninstall.yml
+++ b/playbooks/adhoc/uninstall.yml
@@ -193,6 +193,7 @@
- /etc/sysconfig/atomic-openshift-node
- /etc/sysconfig/openshift-master
- /etc/sysconfig/openshift-node
+ - /etc/sysconfig/openvswitch
- /etc/sysconfig/origin-master
- /etc/sysconfig/origin-master-api
- /etc/sysconfig/origin-master-controllers
diff --git a/playbooks/common/openshift-cluster/upgrades/files/ensure_system_units_have_version.sh b/playbooks/common/openshift-cluster/upgrades/files/ensure_system_units_have_version.sh
index eb51ce6b2..239f43314 100644
--- a/playbooks/common/openshift-cluster/upgrades/files/ensure_system_units_have_version.sh
+++ b/playbooks/common/openshift-cluster/upgrades/files/ensure_system_units_have_version.sh
@@ -32,7 +32,7 @@ add_image_version_to_unit () {
fi
}
-for unit_file in $(ls /etc/systemd/system/${SERVICE_TYPE}*.service | head -n1); do
+for unit_file in $(ls /etc/systemd/system/${SERVICE_TYPE}*.service); do
unit_name=$(basename -s .service ${unit_file})
add_image_version_to_sysconfig $VERSION $unit_name
add_image_version_to_unit $DEPLOYMENT_TYPE $unit_file
@@ -41,7 +41,6 @@ done
if [ -e /etc/sysconfig/openvswitch ]; then
add_image_version_to_sysconfig $VERSION openvswitch
else
- # TODO: add this to config.yml
echo IMAGE_VERSION=${VERSION} > /etc/sysconfig/openvswitch
fi
if ! grep EnvironmentFile /etc/systemd/system/openvswitch.service > /dev/null; then
diff --git a/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh b/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
index e06f7958f..a2a9579b5 100644
--- a/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
+++ b/playbooks/common/openshift-cluster/upgrades/files/rpm_versions.sh
@@ -1,23 +1,7 @@
#!/bin/bash
-while getopts ":c" opt; do
- case $opt in
- c)
- echo "-c was triggered!" >&2
- containerized="TRUE"
- ;;
- \?)
- echo "Invalid option: -$OPTARG" >&2
- ;;
- esac
-done
-
-if [ "${containerized}" == "TRUE" ] ; then
- docker exec atomic-openshift-master rpm -q atomic-openshift
-else
- 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' ' ')
-fi
+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' ' ')
echo "---"
echo "curr_version: ${installed}"
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/containerized_upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/containerized_upgrade.yml
index 9cda5c9a4..3687beb36 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/containerized_upgrade.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/containerized_upgrade.yml
@@ -1,6 +1,2 @@
- name: Update system_units
script: ../files/ensure_system_units_have_version.sh {{ openshift.common.service_type }} {{ openshift.common.deployment_type }} {{ g_new_version }}
-
-- name: Ensure python-yaml present for config upgrade
- action: "{{ ansible_pkg_mgr }} name=PyYAML state=present"
- when: not openshift.common.is_atomic | bool
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 a1d3ac5cc..64d8597a5 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
@@ -7,11 +7,6 @@
roles:
- openshift_facts
-- name: Load openshift_facts
- hosts: oo_masters_to_config:oo_nodes_to_config:oo_etcd_to_config:oo_lb_to_config
- roles:
- - openshift_facts
-
- name: Evaluate additional groups for upgrade
hosts: localhost
connection: local
@@ -35,9 +30,9 @@
tasks:
- fail:
msg: >
- This upgrade is only supported for origin, openshift-enterprise, and online
+ This upgrade is only supported for atomic-enterprise, origin, openshift-enterprise, and online
deployment types
- when: deployment_type not in ['origin','openshift-enterprise', 'online']
+ when: deployment_type not in ['atomic-enterprise', 'origin','openshift-enterprise', 'online']
- fail:
msg: >
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 3ef9a207a..9e6696eb2 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
@@ -11,8 +11,6 @@
###############################################################################
- name: Upgrade master container
hosts: oo_masters_to_config
- roles:
- - openshift_cli
tasks:
- include: rpm_upgrade.yml component=master
when: not openshift.common.is_containerized | bool
@@ -56,8 +54,6 @@
###############################################################################
- name: Upgrade nodes
hosts: oo_nodes_to_config
- roles:
- - openshift_facts
tasks:
- include: rpm_upgrade.yml
vars:
@@ -68,7 +64,8 @@
- include: containerized_upgrade.yml
when: openshift.common.is_containerized | bool
- - name: Restart node service
+ # This will restart the node
+ - name: Restart openvswitch service
service: name="{{ openshift.common.service_type }}-node" state=restarted
- set_fact:
@@ -97,6 +94,8 @@
###############################################################################
- name: Reconcile Cluster Roles and Cluster Role Bindings and Security Context Constraints
hosts: oo_masters_to_config
+ roles:
+ - { role: openshift_cli, image_tag: "v{{ g_new_version }}" }
vars:
origin_reconcile_bindings: "{{ deployment_type == 'origin' and g_new_version | version_compare('1.0.6', '>') }}"
ent_reconcile_bindings: true