summaryrefslogtreecommitdiffstats
path: root/roles/openshift_serviceaccounts/tasks
diff options
context:
space:
mode:
authorJan Chaloupka <jchaloup@redhat.com>2017-02-11 10:32:29 +0100
committerGitHub <noreply@github.com>2017-02-11 10:32:29 +0100
commit3921f01be97ccfbb54e11666ce3647774c3fdbb9 (patch)
treefb49743460566722c42b30ec297f2f4e19d4a1eb /roles/openshift_serviceaccounts/tasks
parent5444c0f474f3701f22ae8392d1ac192403c8b5b7 (diff)
parentbadaa6dc09abfcbfb2770a2d2070c803a2aaaf03 (diff)
downloadopenshift-3921f01be97ccfbb54e11666ce3647774c3fdbb9.tar.gz
openshift-3921f01be97ccfbb54e11666ce3647774c3fdbb9.tar.bz2
openshift-3921f01be97ccfbb54e11666ce3647774c3fdbb9.tar.xz
openshift-3921f01be97ccfbb54e11666ce3647774c3fdbb9.zip
Merge pull request #3321 from ashcrow/oc-serviceaccount-module
WIP: oc serviceaccount now done via oc_serviceaccount module
Diffstat (limited to 'roles/openshift_serviceaccounts/tasks')
-rw-r--r--roles/openshift_serviceaccounts/tasks/main.yml20
1 files changed, 5 insertions, 15 deletions
diff --git a/roles/openshift_serviceaccounts/tasks/main.yml b/roles/openshift_serviceaccounts/tasks/main.yml
index d83ccf7de..1d570fa5b 100644
--- a/roles/openshift_serviceaccounts/tasks/main.yml
+++ b/roles/openshift_serviceaccounts/tasks/main.yml
@@ -1,21 +1,11 @@
---
-- name: test if service accounts exists
- command: >
- {{ openshift.common.client_binary }} get sa {{ item }} -n {{ openshift_serviceaccounts_namespace }}
- with_items: "{{ openshift_serviceaccounts_names }}"
- failed_when: false
- changed_when: false
- register: account_test
-
- name: create the service account
- shell: >
- echo {{ lookup('template', '../templates/serviceaccount.j2')
- | from_yaml | to_json | quote }} | {{ openshift.common.client_binary }}
- -n {{ openshift_serviceaccounts_namespace }} create -f -
- when: item.1.rc != 0
- with_together:
+ oc_serviceaccount:
+ name: "{{ item }}"
+ namespace: "{{ openshift_serviceaccounts_namespace }}"
+ state: present
+ with_items:
- "{{ openshift_serviceaccounts_names }}"
- - "{{ account_test.results }}"
- name: test if scc needs to be updated
command: >