Skip to content

Commit e029579

Browse files
author
Alan Christie
committed
- Updated to use SA and non-admin user
(i.e. latest squonk templates)
1 parent 9b485e0 commit e029579

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

openshift/ansible/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Before running the playbook: -
1313
1. You have installed Ansible (any version from 2.5)
1414
1. The `oc` command-set is available to you as a user
1515
1. An OpenShift cluster has been installed
16-
1. There is an `admin` user known to the cluster
16+
1. There is a suitable user known to the cluster
1717
1. You have setup your own `setenv.sh`
1818
(typically in Squonk's `openshift/templates`)
1919
and you have run `source setenv.sh` using it.

openshift/ansible/group_vars/all.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22

3-
oc_admin: "{{ ansible_env.OC_ADMIN }}"
4-
oc_admin_password: "{{ ansible_env.OC_ADMIN_PASSWORD }}"
3+
oc_user: "{{ ansible_env.OC_USER }}"
4+
oc_user_password: "{{ ansible_env.OC_USER_PASSWORD }}"
55
oc_master_hostname: "{{ ansible_env.OC_MASTER_HOSTNAME }}"
66
oc_project: "{{ ansible_env.OC_PROJECT }}"
7+
oc_project_sa: "{{ ansible_env.OC_PROJECT_SA }}"
78
oc_pipelines_sd_poster_image_tag: "{{ ansible_env.OC_PIPELINES_SD_POSTER_IMAGE_TAG }}"
89

910
# Various retry timeouts (seconds)...

openshift/ansible/roles/pipelines/tasks/main.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# and then remove any existing poster job
55
# before deploying a new one (and waiting for completion).
66

7-
- name: Login (admin)
8-
shell: oc login {{ oc_master_hostname }} -u {{ oc_admin }} -p {{ oc_admin_password }}
7+
- name: Login (user)
8+
shell: oc login {{ oc_master_hostname }} -u {{ oc_user }} -p {{ oc_user_password }}
99
changed_when: False
1010

1111
- name: Move to Squonk Project
@@ -25,6 +25,7 @@
2525
shell: >
2626
oc process
2727
-f {{ role_path }}/{{ t_dir }}/post-service-descriptors.yaml
28+
-p POSTER_SA={{ oc_project_sa }}
2829
-p POSTER_IMAGE_TAG={{ oc_pipelines_sd_poster_image_tag }}
2930
| oc create -f -
3031

openshift/templates/post-service-descriptors.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ parameters:
1919

2020
- name: POSTER_IMAGE_TAG
2121
value: latest
22+
- name: POSTER_SA
23+
value: squonk
2224

2325
objects:
2426

@@ -29,6 +31,7 @@ objects:
2931
spec:
3032
template:
3133
spec:
34+
serviceAccountName: ${POSTER_SA}
3235

3336
initContainers:
3437
- image: yauritux/busybox-curl

0 commit comments

Comments
 (0)