mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
---
|
|
- name: Check/create instance
|
|
hosts: copr_back_dev_aws:copr_back_aws
|
|
user: root
|
|
gather_facts: false
|
|
|
|
vars_files:
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
- /srv/private/ansible/vars.yml
|
|
|
|
handlers:
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
|
|
|
tasks:
|
|
# - import_tasks: "{{ tasks_path }}/persistent_cloud.yml"
|
|
# when: datacenter != 'aws'
|
|
|
|
- import_tasks: "{{ tasks_path }}/aws_cloud.yml"
|
|
when: datacenter == 'aws'
|
|
|
|
- import_tasks: "{{ tasks_path }}/swap.yml"
|
|
when:
|
|
- datacenter == 'aws'
|
|
- swap_file_size_mb is defined
|
|
|
|
- name: Cloud basic setup
|
|
hosts: copr_back_dev_aws:copr_back_aws
|
|
user: root
|
|
gather_facts: true
|
|
vars_files:
|
|
- /srv/web/infra/ansible/vars/global.yml
|
|
- /srv/private/ansible/vars.yml
|
|
|
|
pre_tasks:
|
|
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
|
|
|
|
|
|
tasks:
|
|
- import_tasks: "{{ tasks_path }}/cloud_setup_basic.yml"
|
|
|
|
# this should be set to ansible_hostname
|
|
# - name: "set hostname (required by some services, at least postfix need it)"
|
|
# hostname: name="{{copr_hostbase}}.cloud.fedoraproject.org"
|
|
# when: env != 'production'
|
|
|
|
- name: Provision instance
|
|
hosts: copr_back_dev_aws:copr_back_aws
|
|
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 are run first, before tasks, regardless of where you place them here.
|
|
roles:
|
|
- copr/pre
|
|
- base
|
|
- nagios_client
|
|
- zabbix/zabbix_agent
|
|
- copr/backend
|
|
- role: messaging/base
|
|
when: copr_messaging
|
|
# storinator is being moved to rdu3
|
|
# - role: rsnapshot-push
|
|
# when: env == "production"
|
|
- role: log-detective-backup
|
|
when: env == "production"
|