fedora-ansible/playbooks/groups/download.yml

80 lines
3.3 KiB
YAML

- import_playbook: "/srv/web/infra/ansible/playbooks/include/virt-create.yml myhosts=download_ibiblio:download_cc_rdu:download_iad2"
- name: Download servers
hosts: download
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:
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: post-initial-steps
hosts: download
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
- collectd/base
- apache
- download
- rsyncd
- { role: nfs/client, when: datacenter == "phx2", mnt_dir: '/srv/pub', nfs_src_dir: 'fedora_ftp/fedora.redhat.com/pub' }
- { role: nfs/client, when: datacenter == "phx2", mnt_dir: '/mnt/koji/compose', nfs_src_dir: 'fedora_koji/koji/compose' } # needed for internal sync
- { role: nfs/client, when: datacenter == "iad2" or datacenter == "rdu", mnt_dir: '/srv/pub', nfs_src_dir: 'fedora_ftp/fedora.redhat.com/pub' }
- { role: nfs/client, when: datacenter == "iad2", mnt_dir: '/mnt/koji/compose', nfs_src_dir: 'fedora_koji/koji/compose' } # needed for internal sync
- sudo
- { role: openvpn/client, when: vpn == True }
pre_tasks:
- include_vars: dir=/srv/web/infra/ansible/vars/all/ ignore_files=README
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
tasks:
- import_tasks: "{{ tasks_path }}/2fa_client.yml"
- import_tasks: "{{ tasks_path }}/motd.yml"
- name: put in script for syncing on download-ib01
copy: src="{{ files }}/download/sync-up-downloads.sh.ib01" dest=/usr/local/bin/sync-up-downloads owner=root group=root mode=755
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: put in script for syncing on download-ib01
copy: src="{{ files }}/download/sync-up-other.sh.ib01" dest=/usr/local/bin/sync-up-other owner=root group=root mode=755
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: put in cron job for syncing
copy: src="{{ files }}/download/download-sync.cron.ib01" dest=/etc/cron.d/download-sync owner=root group=root mode=644
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: put in last sync scrypt for download-ib01
copy: src="{{ files}}/download/last-sync" dest=/usr/local/bin/last-sync mode=0755
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: install bc so last-sync works.
package: name=bc state=present
when: inventory_hostname == 'download-ib01.fedoraproject.org'
- name: put in script for syncing on download-cc-rdu01
copy: src="{{ files }}/download/sync-up-downloads.sh.cc-rdu01" dest=/usr/local/bin/sync-up-downloads owner=root group=root mode=755
when: inventory_hostname == 'download-cc-rdu01.fedoraproject.org'
- name: put in cron job for syncing
copy: src="{{ files }}/download/download-sync.cron.ib01" dest=/etc/cron.d/download-sync owner=root group=root mode=644
when: inventory_hostname == 'download-cc-rdu01.fedoraproject.org'
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"