Browse Source

Merge pull request #854 from dgoodwin/pkg-ansible-cfg

Package the default ansible.cfg with atomic-openshift-utils.
Brenton Leanhardt 9 years ago
parent
commit
12affae521

+ 3 - 0
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

+ 17 - 1
playbooks/adhoc/upgrades/upgrade.yml

@@ -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
@@ -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
+

+ 6 - 0
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'):

+ 0 - 1
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

+ 1 - 1
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):