zuul-operator/playbooks/zuul-operator-functional/tasks/create_config.yaml

91 lines
2.3 KiB
YAML

- name: create config directory
command: "git clone git://{{ cluster_ip }}:{{ git_server_port }}/config"
args:
chdir: "{{ git_root.path }}"
- name: copy config content
copy:
dest: "{{ git_root.path }}/config/{{ item.name }}"
content: "{{ item.content }}"
loop:
- name: zuul.yaml
content: |
- pipeline:
name: periodic
manager: independent
trigger:
timer:
- time: '* * * * * *'
- nodeset:
name: pod-fedora
nodes:
- name: container
label: pod-fedora-34
- nodeset:
name: ubuntu-focal
nodes:
- name: ubuntu-focal
label: ubuntu-focal
- job:
name: test-pod
run: test-pod.yaml
# skip zuul-base-jobs for now as it doesn't work with kubectl
roles:
- zuul: zuul/zuul-jobs
parent: null
nodeset: pod-fedora
- job:
name: test-static-node
run: test-static-node.yaml
roles:
- zuul: zuul/zuul-jobs
parent: null
nodeset: ubuntu-focal
- project:
periodic:
jobs:
- test-pod
- test-static-node
- name: test-pod.yaml
content: |
- hosts: localhost
tasks:
- name: check job volume
stat:
path: /system-dbus
register: _job_volume
failed_when: not _job_volume.stat.isdir
- hosts: container
tasks:
- include_role:
name: start-zuul-console
- debug: msg='Demo job is running on container'
- shell: id
- pause: seconds=30
- name: test-static-node.yaml
content: |
- hosts: all
tasks:
- include_role:
name: start-zuul-console
- debug: msg='Demo job is running on static node'
- shell: id
- pause: seconds=30
- name: commit config
shell: |
set -x
git add *.yaml
git commit -m 'Setup config project' || true
git push --set-upstream git://{{ cluster_ip }}:{{ git_server_port }}/config master
args:
chdir: "{{ git_root.path }}/config"