summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2015-10-20 10:34:12 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2015-10-20 10:34:12 -0400
commita6d3017291433413649c915cfb3de90b362175fa (patch)
treee0f9f9b4c0f0f5d88f576e0190f702293cb757be
parent205927e40513f9162523e1039d3f25d63ace5a1e (diff)
parented4f46169befecbbcbd646b5333d77add80e133f (diff)
downloadopenshift-a6d3017291433413649c915cfb3de90b362175fa.tar.gz
openshift-a6d3017291433413649c915cfb3de90b362175fa.tar.bz2
openshift-a6d3017291433413649c915cfb3de90b362175fa.tar.xz
openshift-a6d3017291433413649c915cfb3de90b362175fa.zip
Merge pull request #589 from sdodson/issue585
Lookup ansible_ssh_user group for kubeconfig perms
-rw-r--r--roles/openshift_master/tasks/main.yml8
1 files changed, 6 insertions, 2 deletions
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index fa12005ab..73c04cb08 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -169,13 +169,17 @@
shell: echo {{ openshift_master_cluster_password | quote }} | passwd --stdin hacluster
when: install_result | changed
+- name: Lookup default group for ansible_ssh_user
+ command: "/usr/bin/id -g {{ ansible_ssh_user }}"
+ register: _ansible_ssh_user_gid
+
- name: Create the client config dir(s)
file:
path: "~{{ item }}/.kube"
state: directory
mode: 0700
owner: "{{ item }}"
- group: "{{ item }}"
+ group: "{{ 'root' if item == 'root' else _ansible_ssh_user_gid.stdout }}"
with_items:
- root
- "{{ ansible_ssh_user }}"
@@ -196,7 +200,7 @@
state: file
mode: 0700
owner: "{{ item }}"
- group: "{{ item }}"
+ group: "{{ 'root' if item == 'root' else _ansible_ssh_user_gid.stdout }}"
with_items:
- root
- "{{ ansible_ssh_user }}"