summaryrefslogtreecommitdiffstats
path: root/roles/openshift_hosted/tasks
diff options
context:
space:
mode:
authorJan Chaloupka <jchaloup@redhat.com>2017-02-09 13:50:29 +0100
committerJan Chaloupka <jchaloup@redhat.com>2017-02-10 12:15:58 +0100
commitb0f065dde8ddf14a8712a769152e63faea6688a3 (patch)
tree08be052eea6c179e6267588c6fc347a7387a3c5c /roles/openshift_hosted/tasks
parentfc96d8d22f6c277b599e6e2fa4e9cc06814a9460 (diff)
downloadopenshift-b0f065dde8ddf14a8712a769152e63faea6688a3.tar.gz
openshift-b0f065dde8ddf14a8712a769152e63faea6688a3.tar.bz2
openshift-b0f065dde8ddf14a8712a769152e63faea6688a3.tar.xz
openshift-b0f065dde8ddf14a8712a769152e63faea6688a3.zip
Replace service account secrets handling with oc_serviceaccount_secret module
Diffstat (limited to 'roles/openshift_hosted/tasks')
-rw-r--r--roles/openshift_hosted/tasks/registry/secure.yml10
-rw-r--r--roles/openshift_hosted/tasks/registry/storage/object_storage.yml22
2 files changed, 12 insertions, 20 deletions
diff --git a/roles/openshift_hosted/tasks/registry/secure.yml b/roles/openshift_hosted/tasks/registry/secure.yml
index d87a3847c..84b69d94c 100644
--- a/roles/openshift_hosted/tasks/registry/secure.yml
+++ b/roles/openshift_hosted/tasks/registry/secure.yml
@@ -54,10 +54,12 @@
failed_when: "'already exists' not in create_registry_certificates_secret.stderr and create_registry_certificates_secret.rc != 0"
- name: "Add the secret to the registry's pod service accounts"
- command: >
- {{ openshift.common.client_binary }} secrets add {{ item }} registry-certificates
- --config={{ openshift_hosted_kubeconfig }}
- -n default
+ oc_serviceaccount_secret:
+ service_account: "{{ item }}"
+ secret: registry-certificates
+ namespace: default
+ kubeconfig: "{{ openshift_hosted_kubeconfig }}"
+ state: present
with_items:
- registry
- default
diff --git a/roles/openshift_hosted/tasks/registry/storage/object_storage.yml b/roles/openshift_hosted/tasks/registry/storage/object_storage.yml
index e56a68e27..15128784e 100644
--- a/roles/openshift_hosted/tasks/registry/storage/object_storage.yml
+++ b/roles/openshift_hosted/tasks/registry/storage/object_storage.yml
@@ -53,23 +53,13 @@
create -f -
when: secrets.rc == 1
-- name: Determine if service account contains secrets
- command: >
- {{ openshift.common.client_binary }}
- --config={{ openshift_hosted_kubeconfig }}
- --namespace={{ openshift.hosted.registry.namespace | default('default') }}
- get serviceaccounts registry
- -o jsonpath='{.secrets[?(@.name=="{{ registry_config_secret_name }}")].name}'
- register: serviceaccount
- changed_when: false
-
- name: Add secrets to registry service account
- command: >
- {{ openshift.common.client_binary }}
- --config={{ openshift_hosted_kubeconfig }}
- --namespace={{ openshift.hosted.registry.namespace | default('default') }}
- secrets add serviceaccount/registry secrets/{{ registry_config_secret_name }}
- when: serviceaccount.stdout == ''
+ oc_serviceaccount_secret:
+ service_account: registry
+ secret: "{{ registry_config_secret_name }}"
+ namespace: "{{ openshift.hosted.registry.namespace | default('default') }}"
+ kubeconfig: "{{ openshift_hosted_kubeconfig }}"
+ state: present
- name: Determine if deployment config contains secrets
command: >