From c2f3f81d926aacbd1fe973c36931dc5ad2ebe7c5 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 10 Nov 2015 08:20:24 -0400 Subject: Package the default ansible.cfg with atomic-openshift-utils. If this file exists on disk, the installer will use it if the user didn't specify an ansible config file on the CLI. Rename share directory to match the rpm name. (utils vs util) --- openshift-ansible.spec | 3 +++ utils/src/ooinstall/cli_installer.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openshift-ansible.spec b/openshift-ansible.spec index 10a53d921..646352961 100644 --- a/openshift-ansible.spec +++ b/openshift-ansible.spec @@ -82,6 +82,8 @@ pushd utils %{__python} setup.py install --skip-build --root %{buildroot} # Remove this line once the name change has happened mv -f %{buildroot}%{_bindir}/oo-install %{buildroot}%{_bindir}/atomic-openshift-installer +mkdir -p %{buildroot}%{_datadir}/atomic-openshift-utils/ +cp etc/ansible.cfg %{buildroot}%{_datadir}/atomic-openshift-utils/ansible.cfg popd # Base openshift-ansible files @@ -252,6 +254,7 @@ Atomic OpenShift Utilities includes %files -n atomic-openshift-utils %{python_sitelib}/ooinstall* %{_bindir}/atomic-openshift-installer +%{_datadir}/atomic-openshift-utils/ansible.cfg %changelog diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index a40ff5cfc..08c2439f7 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -11,7 +11,7 @@ from ooinstall import OOConfig from ooinstall.oo_config import Host from ooinstall.variants import find_variant, get_variant_version_combos -DEFAULT_ANSIBLE_CONFIG = '/usr/share/atomic-openshift-util/ansible.cfg' +DEFAULT_ANSIBLE_CONFIG = '/usr/share/atomic-openshift-utils/ansible.cfg' DEFAULT_PLAYBOOK_DIR = '/usr/share/ansible/openshift-ansible/' def validate_ansible_dir(path): -- cgit v1.2.3 From b0955d50b2beaa2b1e3937185f6d5e5337e1e87f Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 10 Nov 2015 09:10:58 -0400 Subject: Fix missing etcd_data_dir bug. A late change to original PR was not properly tested, there is a problem in the facts when upgrading where the deployment type is openshift-enterprise, and the system facts start reporting data_dir and config_base as referencing origin directories, which are not yet symlinked to their previous openshift variants. To correct we watch for a scenario where we evaluate these to origin directories, which don't exist, but the openshift ones do. (to allow for installation to still point at the origin variety) --- roles/openshift_facts/library/openshift_facts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 932bfd441..c108cd422 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -604,11 +604,17 @@ def set_deployment_facts_if_unset(facts): config_base = '/etc/origin' if deployment_type in ['enterprise', 'online']: config_base = '/etc/openshift' + # Handle upgrade scenarios when symlinks don't yet exist: + if not os.path.exists(config_base) and os.path.exists('/etc/openshift'): + config_base = '/etc/openshift' facts['common']['config_base'] = config_base if 'data_dir' not in facts['common']: data_dir = '/var/lib/origin' if deployment_type in ['enterprise', 'online']: data_dir = '/var/lib/openshift' + # Handle upgrade scenarios when symlinks don't yet exist: + if not os.path.exists(data_dir) and os.path.exists('/var/lib/openshift'): + data_dir = '/var/lib/openshift' facts['common']['data_dir'] = data_dir for role in ('master', 'node'): -- cgit v1.2.3 From fa67d37245d53f4ea7222b0d4d970ede48fee94b Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 10 Nov 2015 09:46:13 -0400 Subject: 1279734: Ensure services are enabled after upgrade. With the openshift to atomic-openshift renames, some services were not enabled after upgrade. Added enabled directives to all service restart lines in the upgrade playbook. --- playbooks/adhoc/upgrades/upgrade.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/adhoc/upgrades/upgrade.yml b/playbooks/adhoc/upgrades/upgrade.yml index 7ce2698db..30f911f6f 100644 --- a/playbooks/adhoc/upgrades/upgrade.yml +++ b/playbooks/adhoc/upgrades/upgrade.yml @@ -226,7 +226,7 @@ when: inventory_hostname != groups.masters.0 - name: Restart master services - service: name="{{ openshift.common.service_type}}-master" state=restarted + service: name="{{ openshift.common.service_type}}-master" enabled=yes state=restarted when: not openshift_master_ha | bool - name: Destroy cluster @@ -250,7 +250,7 @@ openshift_master_ha: "{{ groups['masters'] | length > 1 }}" tasks: - name: Start pcsd - service: name=pcsd state=started + service: name=pcsd enabled=yes state=started when: openshift_master_ha | bool - name: Re-create cluster @@ -281,7 +281,7 @@ - name: Upgrade node packages command: yum update -y {{ openshift.common.service_type }}-node{{ openshift_version }} - name: Restart node services - service: name="{{ openshift.common.service_type }}-node" state=restarted + service: name="{{ openshift.common.service_type }}-node" enabled=yes state=restarted - name: Update cluster policy and policy bindings hosts: masters[0] @@ -311,7 +311,7 @@ openshift_master_ha: "{{ groups['masters'] | length > 1 }}" tasks: - name: Restart master services - service: name="{{ openshift.common.service_type}}-master" state=restarted + service: name="{{ openshift.common.service_type}}-master" enabled=yes state=restarted when: not openshift_master_ha | bool - name: Restart cluster post reconcile -- cgit v1.2.3 From d9e8e0ea821a87c3eb924dc89f5cd8de40ce34c8 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 10 Nov 2015 09:51:02 -0400 Subject: 1279746: Fix leftover disabled features line in config template. --- roles/openshift_master/templates/master.yaml.v1.j2 | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/openshift_master/templates/master.yaml.v1.j2 b/roles/openshift_master/templates/master.yaml.v1.j2 index faf625e3c..bb12a0a0f 100644 --- a/roles/openshift_master/templates/master.yaml.v1.j2 +++ b/roles/openshift_master/templates/master.yaml.v1.j2 @@ -34,7 +34,6 @@ corsAllowedOrigins: disabledFeatures: {{ openshift.master.disabled_features | to_json }} {% endif %} {% if openshift.master.embedded_dns | bool %} -disabledFeatures: null dnsConfig: bindAddress: {{ openshift.master.bind_addr }}:{{ openshift.master.dns_port }} bindNetwork: tcp4 -- cgit v1.2.3 From 28d601beeebaacd5e79b3fec336a283c8bf20e68 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 10 Nov 2015 13:39:04 -0400 Subject: Add separate step to enable services during upgrade. Instead of combining this with tasks to restart services, add a separate started+enabled play for masters and nodes at the end of the playbook. --- playbooks/adhoc/upgrades/upgrade.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/playbooks/adhoc/upgrades/upgrade.yml b/playbooks/adhoc/upgrades/upgrade.yml index 30f911f6f..324f5fba3 100644 --- a/playbooks/adhoc/upgrades/upgrade.yml +++ b/playbooks/adhoc/upgrades/upgrade.yml @@ -226,7 +226,7 @@ when: inventory_hostname != groups.masters.0 - name: Restart master services - service: name="{{ openshift.common.service_type}}-master" enabled=yes state=restarted + service: name="{{ openshift.common.service_type}}-master" state=restarted when: not openshift_master_ha | bool - name: Destroy cluster @@ -281,7 +281,7 @@ - name: Upgrade node packages command: yum update -y {{ openshift.common.service_type }}-node{{ openshift_version }} - name: Restart node services - service: name="{{ openshift.common.service_type }}-node" enabled=yes state=restarted + service: name="{{ openshift.common.service_type }}-node" state=restarted - name: Update cluster policy and policy bindings hosts: masters[0] @@ -311,7 +311,7 @@ openshift_master_ha: "{{ groups['masters'] | length > 1 }}" tasks: - name: Restart master services - service: name="{{ openshift.common.service_type}}-master" enabled=yes state=restarted + service: name="{{ openshift.common.service_type}}-master" state=restarted when: not openshift_master_ha | bool - name: Restart cluster post reconcile @@ -389,3 +389,19 @@ openshift_deployment_type: "{{ deployment_type }}" roles: - openshift_examples + +- name: Ensure master services enabled + hosts: masters + vars: + openshift_master_ha: "{{ groups['masters'] | length > 1 }}" + tasks: + - name: Enable master services + service: name="{{ openshift.common.service_type}}-master" state=started enabled=yes + when: not openshift_master_ha | bool + +- name: Ensure node services enabled + hosts: nodes + tasks: + - name: Restart node services + service: name="{{ openshift.common.service_type }}-node" state=started enabled=yes + -- cgit v1.2.3