summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/adhoc/upgrades/upgrade.yml29
-rw-r--r--playbooks/common/openshift-cluster/config.yml6
2 files changed, 23 insertions, 12 deletions
diff --git a/playbooks/adhoc/upgrades/upgrade.yml b/playbooks/adhoc/upgrades/upgrade.yml
index 6cb6803a9..6e7292da1 100644
--- a/playbooks/adhoc/upgrades/upgrade.yml
+++ b/playbooks/adhoc/upgrades/upgrade.yml
@@ -40,15 +40,6 @@
- name: Generate etcd backup
command: etcdctl backup --data-dir={{ openshift.master.etcd_data_dir }} --backup-dir={{ openshift.common.data_dir }}/etcd-backup-{{ timestamp }}
-- name: Update 3.0 configuration to 3.1
- hosts: masters
- tasks:
- tasks:
- - debug: var=openshift_master_config_dir
- - name: Upgrade configuration.
- openshift_upgrade_config: from_version=3.0 to_version=3.1 role=master
- - fail: All done for now.
-
- name: Upgrade base package on masters
hosts: masters
roles:
@@ -77,6 +68,8 @@
yum: pkg=kernel state=latest
- name: Upgrade master packages
yum: pkg={{ openshift.common.service_type }}-master{{ openshift_version }} state=latest
+ - name: Upgrade master configuration.
+ openshift_upgrade_config: from_version=3.0 to_version=3.1 role=master
- name: Restart master services
service: name="{{ openshift.common.service_type}}-master" state=restarted
@@ -84,12 +77,30 @@
hosts: nodes
vars:
openshift_version: "{{ openshift_pkg_version | default('') }}"
+ roles:
+ - openshift_facts
tasks:
- name: Upgrade node packages
yum: pkg={{ openshift.common.service_type }}-node{{ openshift_version }} state=latest
- name: Restart node services
service: name="{{ openshift.common.service_type }}-node" state=restarted
+- name: Evaluate oo_first_master
+ hosts: localhost
+ vars:
+ g_masters_group: "{{ 'masters' }}"
+ tasks:
+ - name: display all variables set for the current host
+ debug:
+ var: hostvars[inventory_hostname]
+ - name: Evaluate oo_first_master
+ add_host:
+ name: "{{ groups[g_masters_group][0] }}"
+ groups: oo_first_master
+ ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
+ ansible_sudo: "{{ g_sudo | default(omit) }}"
+ when: g_masters_group in groups and (groups[g_masters_group] | length) > 0
+
- name: Determine new master version
hosts: oo_first_master
tasks:
diff --git a/playbooks/common/openshift-cluster/config.yml b/playbooks/common/openshift-cluster/config.yml
index 4c74f96db..e6bf41ae4 100644
--- a/playbooks/common/openshift-cluster/config.yml
+++ b/playbooks/common/openshift-cluster/config.yml
@@ -4,15 +4,15 @@
gather_facts: no
tasks:
- fail:
- msg: This playbook rquires g_etcd_group to be set
+ msg: This playbook requires g_etcd_group to be set
when: g_etcd_group is not defined
- fail:
- msg: This playbook rquires g_masters_group to be set
+ msg: This playbook requires g_masters_group to be set
when: g_masters_group is not defined
- fail:
- msg: This playbook rquires g_nodes_group to be set
+ msg: This playbook requires g_nodes_group to be set
when: g_nodes_group is not defined
- name: Evaluate oo_etcd_to_config