Forráskód Böngészése

Merge pull request #1030 from jtslear/make-examples-optional

Make the install of openshift_examples optional
Brenton Leanhardt 9 éve
szülő
commit
b10f66a278

+ 3 - 0
inventory/byo/hosts.aep.example

@@ -21,6 +21,9 @@ ansible_ssh_user=root
 # deployment type valid values are origin, online, atomic-enterprise, and openshift-enterprise
 # deployment type valid values are origin, online, atomic-enterprise, and openshift-enterprise
 deployment_type=atomic-enterprise
 deployment_type=atomic-enterprise
 
 
+# Install the openshift examples
+#openshift_install_examples=true
+
 # Enable cluster metrics
 # Enable cluster metrics
 #use_cluster_metrics=true
 #use_cluster_metrics=true
 
 

+ 3 - 0
inventory/byo/hosts.origin.example

@@ -21,6 +21,9 @@ ansible_ssh_user=root
 # deployment type valid values are origin, online, atomic-enterprise and openshift-enterprise
 # deployment type valid values are origin, online, atomic-enterprise and openshift-enterprise
 deployment_type=origin
 deployment_type=origin
 
 
+# Install the openshift examples
+#openshift_install_examples=true
+
 # Enable cluster metrics
 # Enable cluster metrics
 #use_cluster_metrics=true
 #use_cluster_metrics=true
 
 

+ 3 - 0
inventory/byo/hosts.ose.example

@@ -21,6 +21,9 @@ ansible_ssh_user=root
 # deployment type valid values are origin, online, atomic-enterprise, and openshift-enterprise
 # deployment type valid values are origin, online, atomic-enterprise, and openshift-enterprise
 deployment_type=openshift-enterprise
 deployment_type=openshift-enterprise
 
 
+# Install the openshift examples
+#openshift_install_examples=true
+
 # Enable cluster metrics
 # Enable cluster metrics
 #use_cluster_metrics=true
 #use_cluster_metrics=true
 
 

+ 2 - 1
playbooks/common/openshift-master/config.yml

@@ -341,7 +341,8 @@
   roles:
   roles:
   - role: openshift_master_cluster
   - role: openshift_master_cluster
     when: openshift_master_ha | bool and openshift.master.cluster_method == "pacemaker"
     when: openshift_master_ha | bool and openshift.master.cluster_method == "pacemaker"
-  - openshift_examples
+  - role: openshift_examples
+    when: openshift.common.install_examples | bool
   - role: openshift_cluster_metrics
   - role: openshift_cluster_metrics
     when: openshift.common.use_cluster_metrics | bool
     when: openshift.common.use_cluster_metrics | bool
   - role: openshift_manageiq
   - role: openshift_manageiq

+ 1 - 0
roles/openshift_common/tasks/main.yml

@@ -14,6 +14,7 @@
       cluster_id: "{{ openshift_cluster_id | default('default') }}"
       cluster_id: "{{ openshift_cluster_id | default('default') }}"
       debug_level: "{{ openshift_debug_level | default(2) }}"
       debug_level: "{{ openshift_debug_level | default(2) }}"
       hostname: "{{ openshift_hostname | default(None) }}"
       hostname: "{{ openshift_hostname | default(None) }}"
+      install_examples: "{{ openshift_install_examples | default(True) }}"
       ip: "{{ openshift_ip | default(None) }}"
       ip: "{{ openshift_ip | default(None) }}"
       public_hostname: "{{ openshift_public_hostname | default(None) }}"
       public_hostname: "{{ openshift_public_hostname | default(None) }}"
       public_ip: "{{ openshift_public_ip | default(None) }}"
       public_ip: "{{ openshift_public_ip | default(None) }}"

+ 8 - 1
roles/openshift_examples/README.md

@@ -11,6 +11,13 @@ ansible.
 Requirements
 Requirements
 ------------
 ------------
 
 
+Facts
+-----
+
+| Name                       | Default Value | Description                            |
+-----------------------------|---------------|----------------------------------------|
+| openshift_install_examples | true          | Runs the role with the below variables |
+
 Role Variables
 Role Variables
 --------------
 --------------
 
 
@@ -32,7 +39,7 @@ Example Playbook
 TODO
 TODO
 ----
 ----
 Currently we use `oc create -f` against various files and we accept non zero return code as a success
 Currently we use `oc create -f` against various files and we accept non zero return code as a success
-if (and only iff) stderr also contains the string 'already exists'. This means that if one object in the file exists already
+if (and only if) stderr also contains the string 'already exists'. This means that if one object in the file exists already
 but others fail to create you won't be aware of the failure. This also means that we do not currently support
 but others fail to create you won't be aware of the failure. This also means that we do not currently support
 updating existing objects.
 updating existing objects.
 
 

+ 1 - 0
roles/openshift_facts/library/openshift_facts.py

@@ -1057,6 +1057,7 @@ class OpenShiftFacts(object):
         common['client_binary'] = 'oc' if os.path.isfile('/usr/bin/oc') else 'osc'
         common['client_binary'] = 'oc' if os.path.isfile('/usr/bin/oc') else 'osc'
         common['admin_binary'] = 'oadm' if os.path.isfile('/usr/bin/oadm') else 'osadm'
         common['admin_binary'] = 'oadm' if os.path.isfile('/usr/bin/oadm') else 'osadm'
         common['dns_domain'] = 'cluster.local'
         common['dns_domain'] = 'cluster.local'
+        common['install_examples'] = True
         defaults['common'] = common
         defaults['common'] = common
 
 
         if 'master' in roles:
         if 'master' in roles: