summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2015-11-03 12:34:05 -0400
committerDevan Goodwin <dgoodwin@redhat.com>2015-11-03 12:34:05 -0400
commit74420660b1b12a00392a6d88a257e0cfe1b0a08e (patch)
treeb6196be2f31248a5126de598b0139f3c32ca902f
parent6b03fcb185c7f37e258dd34ca8b70d5c124cabba (diff)
downloadopenshift-74420660b1b12a00392a6d88a257e0cfe1b0a08e.tar.gz
openshift-74420660b1b12a00392a6d88a257e0cfe1b0a08e.tar.bz2
openshift-74420660b1b12a00392a6d88a257e0cfe1b0a08e.tar.xz
openshift-74420660b1b12a00392a6d88a257e0cfe1b0a08e.zip
Move config upgrade to correct place, fix node facts.
-rw-r--r--playbooks/adhoc/upgrades/upgrade.yml29
-rw-r--r--playbooks/common/openshift-cluster/config.yml6
-rw-r--r--utils/src/ooinstall/install_transactions.py2
3 files changed, 24 insertions, 13 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
diff --git a/utils/src/ooinstall/install_transactions.py b/utils/src/ooinstall/install_transactions.py
index e71bc183b..0754b8ab6 100644
--- a/utils/src/ooinstall/install_transactions.py
+++ b/utils/src/ooinstall/install_transactions.py
@@ -127,7 +127,7 @@ def run_main_playbook(hosts, hosts_to_run_on):
def run_ansible(playbook, inventory, env_vars):
- return subprocess.call(['ansible-playbook', '-v',
+ return subprocess.call(['ansible-playbook',
'--inventory-file={}'.format(inventory),
playbook],
env=env_vars)