ansible/playbooks/groups/mirrormanager.yml
2015-09-03 20:48:37 +00:00

100 lines
2.5 KiB
YAML

- include: "/srv/web/infra/ansible/playbooks/include/virt-create.yml myhosts=mm:mm-stg"
- name: make the boxe be real for real
hosts: mm;mm-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
roles:
- base
- rkhunter
- nagios_client
- hosts
- fas_client
- sudo
- collectd/base
- { role: openvpn/client, when: env != "staging" and inventory_hostname.startswith('mm-frontend') }
- { role: nfs/client, when: inventory_hostname.startswith('mm-backend01'), mnt_dir: '/srv/pub', nfs_src_dir: 'fedora_ftp/fedora.redhat.com/pub' }
tasks:
- include: "{{ tasks }}/yumrepos.yml"
- include: "{{ tasks }}/2fa_client.yml"
- include: "{{ tasks }}/motd.yml"
handlers:
- include: "{{ handlers }}/restart_services.yml"
- name: Deploy the backend
hosts: mm-backend;mm-backend-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
roles:
- mirrormanager/backend
- s3-mirror
handlers:
- include: "{{ handlers }}/restart_services.yml"
- name: Deploy the crawler
hosts: mm-crawler;mm-crawler-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
roles:
- mirrormanager/crawler
- { role: rsyncd,
when: env != "staging" }
- { role: openvpn/client, when: datacenter != "phx2" }
handlers:
- include: "{{ handlers }}/restart_services.yml"
- name: Deploy the frontend (web-app)
hosts: mm-frontend;mm-frontend-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
roles:
- mirrormanager/frontend2
handlers:
- include: "{{ handlers }}/restart_services.yml"
# Do this one last, since the mirrormanager user needs to exist so that it can
# own the fedmsg certs we put in place here.
- name: Put fedmsg stuff in place
hosts: mm;mm-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
roles:
- fedmsg/base
handlers:
- include: "{{ handlers }}/restart_services.yml"