mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
migrated notes from infra/hosts motd changes; excluding CSI infos removed csi_* vars from group_vars; converted csi_purpose & csi_relationship into notes fixed merge conflicts minor changes; var updating YAMLs & playbooks udpated YAMLs & playbooks again updated correctly; buildhw.yml fixing merge conflicts dest added in motd.yml
77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
# database server system in AWS for machines hosted in AWS
|
|
# NOTE: most of these vars_path come from group_vars/backup_server or from hostvars
|
|
|
|
# Once the instance exists, configure it.
|
|
|
|
---
|
|
- name: Check/create instance
|
|
hosts: db.stg.aws.fedoraproject.org
|
|
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 }}/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: db.stg.aws.fedoraproject.org
|
|
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"
|
|
|
|
- name: Configure server
|
|
hosts: db.stg.aws.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_vars: dir=/srv/web/infra/ansible/vars/all/ ignore_files=README
|
|
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
|
|
- dnf:
|
|
name:
|
|
- langpacks-en
|
|
- glibc-all-langpacks
|
|
state: latest
|
|
- ansible.builtin.systemd_service:
|
|
daemon_reload: true
|
|
|
|
roles:
|
|
- base
|
|
- rkhunter
|
|
# - {role: ipa/client, when: env == "staging"}
|
|
# - nagios_client
|
|
# - zabbix/zabbix_agent
|
|
- hosts
|
|
- postgresql_server
|
|
# - collectd/base
|
|
# - collectd/postgres # This requires a 'databases' var to be set in host_vars
|
|
- sudo
|
|
|
|
handlers:
|
|
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|