ansible/playbooks/groups/koji-hub.yml

79 lines
2 KiB
YAML

# create a new koji hub server system
# NOTE: should be used with --limit most of the time
# NOTE: most of these vars_path come from group_vars/koji-hub or from hostvars
- name: make koji hub
hosts: koji-stg:koji01.phx2.fedoraproject.org:koji02.phx2.fedoraproject.org
user: root
gather_facts: False
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
tasks:
- include: "{{ tasks }}/virt_instance_create.yml"
handlers:
- include: "{{ handlers }}/restart_services.yml"
# Once the instance exists, configure it.
- name: make koji_hub server system
hosts: koji-stg:koji01.phx2.fedoraproject.org:koji02.phx2.fedoraproject.org
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: "{{ tasks }}/apache.yml"
roles:
- base
- rkhunter
- nagios_client
- hosts
- fas_client
- builder_repo
- collectd/base
- fedmsg/base
- koji_hub
- { role: koji_builder, when: env == "staging" }
- { role: nfs/server, when: env == "staging" }
- { role: keepalived, when: env != "staging" }
- role: nfs/client
mnt_dir: '/mnt/fedora_koji'
nfs_src_dir: 'fedora_koji'
when: env != 'staging'
- sudo
tasks:
- include: "{{ tasks }}/yumrepos.yml"
- include: "{{ tasks }}/2fa_client.yml"
- include: "{{ tasks }}/motd.yml"
handlers:
- include: "{{ handlers }}/restart_services.yml"
- name: Start the kojid builder daemon, but only on staging.
# Really -- this should never be set for prod.
hosts: koji-stg
user: root
gather_facts: True
# XXX - should these just be included in koji_builder and koji_hub roles?
tasks:
- name: make sure kojid is running
service: name=kojid state=running
tags:
- kojid
- name: make sure kojira is running
service: name=kojira state=running
tags:
- kojira