80394811f0
This change updates the json_to_dhall task to provides a better failure message. This change also refactors the CR spec transformation using jinja combinaison filter to be able to use the raw spec directly. Finally this change removes a copy of the spec from the local playbook by using the flat cr_spec file directly. Change-Id: I6ed5c6746f01a8a277d50bdef317e56dfde5f66d
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
# Run operator role locally, without the operator-framework using:
|
|
# ansible-playbook playbooks/files/local.yaml
|
|
# Add '-e k8s_state=absent' to remove resources
|
|
|
|
- hosts: localhost
|
|
gather_facts: no
|
|
vars:
|
|
zuul_app_path: ../../conf/zuul
|
|
meta:
|
|
name: zuul
|
|
namespace: default
|
|
spec: "{{ lookup('file', './cr_spec.yaml') | from_yaml }}"
|
|
pre_tasks:
|
|
- name: "Create necessary secrets"
|
|
k8s:
|
|
namespace: "{{ meta.namespace }}"
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: "{{ item.name }}"
|
|
stringData:
|
|
id_rsa: "{{ item.content }}"
|
|
main.yaml: "{{ item.content }}"
|
|
nodepool.yaml: "{{ item.content }}"
|
|
loop:
|
|
- name: executor-ssh-key
|
|
file: id_rsa
|
|
content: "{{ lookup('file', '~/.ssh/id_rsa') }}"
|
|
- name: zuul-yaml-conf
|
|
file: main.yaml
|
|
content: |
|
|
- tenant:
|
|
name: local
|
|
source:
|
|
opendev.org:
|
|
config-projects:
|
|
- zuul/zuul-base-jobs
|
|
untrusted-projects:
|
|
- zuul/zuul-jobs
|
|
- name: nodepool-yaml-conf
|
|
file: nodepool.yaml
|
|
content: |
|
|
labels:
|
|
- name: pod-centos
|
|
min-ready: 1
|
|
providers:
|
|
- name: kube-cluster
|
|
driver: openshiftpods
|
|
context: local
|
|
max-pods: 15
|
|
pools:
|
|
- name: default
|
|
labels:
|
|
- name: pod-centos
|
|
image: quay.io/software-factory/pod-centos-7
|
|
python-path: /bin/python2
|
|
|
|
roles:
|
|
- zuul
|