ansible/playbooks/groups/buildvm.yml
Ryan Lerch 2cf38c1f17 [yaml-lint] fix yamllint errors and warnings on plabooks
Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2024-11-25 19:04:25 +10:00

140 lines
4.9 KiB
YAML

# create a new koji builder
# NOTE: should be used with --limit most of the time
# NOTE: make sure there is room/space for this builder on the buildvmhost
# NOTE: most of these vars_path come from group_vars/buildvm or from hostvars
---
- import_playbook: "/srv/web/infra/ansible/playbooks/include/virt-create.yml"
vars:
myhosts: "buildvm:buildvm_stg:buildvm_aarch64:buildvm_ppc64le:buildvm_ppc64le_stg:buildvm_aarch64_stg:buildvm_s390x_kvm"
- name: make koji builder(s)
hosts: buildvm:buildvm_stg:buildvm_aarch64:buildvm_ppc64le:buildvm_ppc64le_stg:buildvm_aarch64_stg:buildvm_s390x:buildvm_s390x_stg
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
pre_tasks:
- include_vars: dir=/srv/web/infra/ansible/vars/all/ ignore_files=README
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
roles:
- base
- hosts
- {
role: nfs/client,
mnt_dir: "/mnt/fedora_koji",
nfs_src_dir: "{{ koji_hub_nfs }}",
when: "env == 'staging' or createrepo or 'runroot' in group_names and not inventory_hostname.startswith('buildvm-s390x')",
}
- ipa/client
- role: sudo
when: not inventory_hostname.startswith('bkernel') and env == 'production'
- koji_builder
- role: nfs/client
mnt_dir: '/mnt/koji/ostree'
nfs_src_dir: 'fedora_ostree_content/ostree'
when: env != 'staging' and 'runroot' in group_names and not inventory_hostname.startswith('buildvm-s390x')
- role: nfs/client
mnt_dir: '/mnt/koji/compose/ostree'
nfs_src_dir: 'fedora_ostree_content/compose/ostree'
when: env != 'staging' and 'runroot' in group_names and not inventory_hostname.startswith('buildvm-s390x')
- role: nfs/client
mnt_dir: '/mnt/koji/ostree'
nfs_src_dir: 'fedora_ostree_content_stg/ostree'
when: env == 'staging' and 'runroot' in group_names and not inventory_hostname.startswith('buildvm-s390x')
- role: nfs/client
mnt_dir: '/mnt/koji/compose/ostree'
nfs_src_dir: 'fedora_ostree_content_stg/compose/ostree'
when: env == 'staging' and 'runroot' in group_names and not inventory_hostname.startswith('buildvm-s390x')
- role: keytab/service
kt_location: /etc/kojid/kojid.keytab
service: compile
- role: btrfs
btrfs_balance_period: weekly
# push built Flatpaks to candidate registry
- role: login-registry
candidate_registry: "candidate-registry.fedoraproject.org"
candidate_registry_osbs_username: "{{candidate_registry_osbs_prod_username}}"
candidate_registry_osbs_password: "{{candidate_registry_osbs_prod_password}}"
when: env == "production"
- role: login-registry
candidate_registry: "candidate-registry.stg.fedoraproject.org"
candidate_registry_osbs_username: "{{candidate_registry_osbs_stg_username}}"
candidate_registry_osbs_password: "{{candidate_registry_osbs_stg_password}}"
when: env == "staging"
tasks:
- import_tasks: "{{ tasks_path }}/motd.yml"
when: not inventory_hostname.startswith('bkernel') and env == 'production'
# - name: make sure kojid is running
# service: name=kojid state=started enabled=yes
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: configure varnish cache
hosts: buildvm-s390x-24.s390.fedoraproject.org:buildvm-s390x-01.stg.s390.fedoraproject.org:buildvm-s390x-14.s390.fedoraproject.org
tags:
- varnish
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
roles:
- varnish
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: configure sshfs on buildvm-s390x
hosts: buildvm-s390x-11.s390.fedoraproject.org:buildvm-s390x-12.s390.fedoraproject.org:buildvm-s390x-13.s390.fedoraproject.org
tags:
- sshfs
user: root
gather_facts: true
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
tasks:
- name: Put sshfs key in place
copy:
src="{{ private }}/files/releng/sshkeys/primary-s390x-sshfs{{ '-staging' if env == 'staging' else '' }}"
dest="/etc/primary-s390x-sshfs"
owner=root group=root mode=0600
tags:
- sshfs
- name: Install sshfs
package: name=sshfs
state=present
tags:
- sshfs
- name: Add /mnt/fedora_koji sshfs
mount: path="/mnt/fedora_koji"
state=present
fstype=fuse.sshfs
src="root@koji01{{ env_suffix }}.iad2.fedoraproject.org:/mnt/fedora_koji"
opts="noauto,_netdev,ServerAliveInterval=20,IdentityFile=/etc/primary-s390x-sshfs"
tags:
- sshfs
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"