diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2016-03-15 08:35:12 -0400 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2016-03-15 08:35:12 -0400 |
commit | 3f89e247c1e1e200567a69f7c41a24ac345440e9 (patch) | |
tree | 1ca8a6366338d20dfb3b7d318e7863dc0d8342c3 /roles | |
parent | c633ce7b8707f311763fa4b707f1ea159265c7d4 (diff) | |
parent | 856e565421eadbca74fa3d5f5adcc477792f6dc0 (diff) | |
download | openshift-3f89e247c1e1e200567a69f7c41a24ac345440e9.tar.gz openshift-3f89e247c1e1e200567a69f7c41a24ac345440e9.tar.bz2 openshift-3f89e247c1e1e200567a69f7c41a24ac345440e9.tar.xz openshift-3f89e247c1e1e200567a69f7c41a24ac345440e9.zip |
Merge pull request #1602 from detiber/oc_client_tweak
perform oc client config tasks only once when ansible_ssh_user is root
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_master/tasks/main.yml | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml index 759cda7d0..1f499dc93 100644 --- a/roles/openshift_master/tasks/main.yml +++ b/roles/openshift_master/tasks/main.yml @@ -319,6 +319,9 @@ changed_when: false register: _ansible_ssh_user_gid +- set_fact: + client_users: "{{ [ansible_ssh_user, 'root'] | unique }}" + - name: Create the client config dir(s) file: path: "~{{ item }}/.kube" @@ -326,9 +329,7 @@ mode: 0700 owner: "{{ item }}" group: "{{ 'root' if item == 'root' else _ansible_ssh_user_gid.stdout }}" - with_items: - - root - - "{{ ansible_ssh_user }}" + with_items: client_users # TODO: Update this file if the contents of the source file are not present in # the dest file, will need to make sure to ignore things that could be added @@ -336,9 +337,7 @@ command: cp {{ openshift_master_config_dir }}/admin.kubeconfig ~{{ item }}/.kube/config args: creates: ~{{ item }}/.kube/config - with_items: - - root - - "{{ ansible_ssh_user }}" + with_items: client_users - name: Update the permissions on the admin client config(s) file: @@ -347,6 +346,4 @@ mode: 0700 owner: "{{ item }}" group: "{{ 'root' if item == 'root' else _ansible_ssh_user_gid.stdout }}" - with_items: - - root - - "{{ ansible_ssh_user }}" + with_items: client_users |