summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-03-06 16:08:46 -0500
committerThomas Wiest <twiest@users.noreply.github.com>2015-03-06 16:08:46 -0500
commitbea957eee4365566eeccbe7d95ab974cc2d4d1c7 (patch)
tree9e27179bc58b0788c3f779191b404e7089236d10 /roles
parent6c5323ad47662ca8ee647c2dd881025d3e66fd66 (diff)
parentf744401ae8b1968bc0d404f5cb5504c492a2f0aa (diff)
downloadopenshift-bea957eee4365566eeccbe7d95ab974cc2d4d1c7.tar.gz
openshift-bea957eee4365566eeccbe7d95ab974cc2d4d1c7.tar.bz2
openshift-bea957eee4365566eeccbe7d95ab974cc2d4d1c7.tar.xz
openshift-bea957eee4365566eeccbe7d95ab974cc2d4d1c7.zip
Merge pull request #98 from detiber/copyNotEnvKubeconfig
Do not set KUBECONFIG for root user
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_common/tasks/main.yml8
-rw-r--r--roles/openshift_master/tasks/main.yml21
-rw-r--r--roles/openshift_node/tasks/main.yml15
3 files changed, 36 insertions, 8 deletions
diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml
index 723bdd9fa..728bba4e4 100644
--- a/roles/openshift_common/tasks/main.yml
+++ b/roles/openshift_common/tasks/main.yml
@@ -7,14 +7,6 @@
- name: Configure local facts file
file: path=/etc/ansible/facts.d/ state=directory mode=0750
-- name: Add KUBECONFIG to .bash_profile for user root
- lineinfile:
- dest: /root/.bash_profile
- regexp: "KUBECONFIG="
- line: "export KUBECONFIG=/var/lib/openshift/openshift.local.certificates/admin/.kubeconfig"
- state: present
- insertafter: EOF
-
- name: Set common OpenShift facts
include: set_facts.yml
facts:
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index 2f8f8b950..58a8b85ba 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -51,7 +51,28 @@
- name: Start and enable openshift-master
service: name=openshift-master enabled=yes state=started
when: not openshift_master_manage_service_externally
+ register: result
+
+#TODO: remove this when origin PR #1204 has landed in OSE
+- name: need to pause here, otherwise we attempt to copy certificates generated by the master before they are generated
+ pause: seconds=30
+ when: result | changed
- name: Disable openshift-master if openshift-master is managed externally
service: name=openshift-master enabled=false
when: openshift_master_manage_service_externally
+
+# TODO: create an os_vars role that has generic env related config and move
+# the root kubeconfig setting there, cannot use dependencies to force ordering
+# with openshift_node and openshift_master because the way conditional
+# dependencies work with current ansible would also exclude the
+# openshift_common dependency.
+- name: Create .kube directory
+ file:
+ path: /root/.kube
+ state: directory
+ mode: 700
+- name: Configure root user kubeconfig
+ command: cp /var/lib/openshift/openshift.local.certificates/admin/.kubeconfig /root/.kube/.kubeconfig
+ args:
+ creates: /root/.kube/.kubeconfig
diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml
index de010bd0c..56858dbc3 100644
--- a/roles/openshift_node/tasks/main.yml
+++ b/roles/openshift_node/tasks/main.yml
@@ -62,6 +62,21 @@
service: name=openshift-node enabled=false
when: openshift_node_manage_service_externally
+# TODO: create an os_vars role that has generic env related config and move
+# the root kubeconfig setting there, cannot use dependencies to force ordering
+# with openshift_node and openshift_master because the way conditional
+# dependencies work with current ansible would also exclude the
+# openshift_common dependency.
+- name: Create .kube directory
+ file:
+ path: /root/.kube
+ state: directory
+ mode: 700
+- name: Configure root user kubeconfig
+ command: cp /var/lib/openshift/openshift.local.certificates/admin/.kubeconfig /root/.kube/.kubeconfig
+ args:
+ creates: /root/.kube/.kubeconfig
+
# TODO: expose openshift_register_node options to allow for overriding the
# defaults.
- name: Register node (if not already registered)