
Each CNF project now has a jarvis.yaml defining credentials for harbor and docker, kubeconfig, and certs. The existing ldap users are used in the jarvis.yaml for both the staging and non-staging phases of the CI. The kubeconfig and harbor-ca entries of the jarvis.yaml are populated during the 800 script and adds those entries as base64 encoded data so that the required format (indentations and spacing) is maintained. The Task-createProjectAccess then decodes the kubeconfig and harbor-ca and creates the secrets for them in the correct namespace. Secret creation all takes place in the Task-createProjectAccess. Change-Id: If0c243416323e36a6f7797d8d378961552193c0d
33 lines
1.3 KiB
YAML
33 lines
1.3 KiB
YAML
---
|
|
- hosts: localhost
|
|
tasks:
|
|
- name: Get list of objects
|
|
shell: "jq -c '.[]' {{ loop_source }}"
|
|
register: data
|
|
|
|
- set_fact:
|
|
async_batch_size: 2
|
|
stage: "default"
|
|
|
|
- name: Get list of internal staging repos
|
|
when: ( stage == "promote_chart")
|
|
shell: "jq -c '.[] | {repo: (\"https://{{ chart_registry_url }}/\"+.project+\"-staging\"), secret: \"{{ harbor_secret_pull_mounted_path }}\", name: (.project+\"-staging\")}' {{ loop_source }} | sort | uniq"
|
|
register: staging_internal_repos
|
|
|
|
- name: Get list of internal stable repos
|
|
when: ( stage == "promote_chart")
|
|
shell: "jq -c '.[] | {repo: (\"https://{{ chart_registry_url }}/\"+.project), secret: \"{{ harbor_secret_push_mounted_path }}\", name: .project}' {{ loop_source }} | sort | uniq"
|
|
register: internal_repos
|
|
|
|
- include_tasks: ./roles/charts/tasks/setup_helm_repo.yaml
|
|
when: ( stage == "promote_chart")
|
|
loop: "{{ staging_internal_repos.stdout_lines + internal_repos.stdout_lines}}"
|
|
vars:
|
|
repo: "{{ item }}"
|
|
|
|
- include_tasks: ./roles/promote/tasks/main.yaml
|
|
when: data.stdout_lines |length > 0
|
|
loop: "{{ data.stdout_lines | map('from_json') | batch(async_batch_size) | list }}"
|
|
loop_control:
|
|
loop_var: "items"
|