Files
fedora-infra_ansible/playbooks/groups/ipsilon.yml
2020-10-15 18:51:12 +02:00

99 lines
2.3 KiB
YAML

- import_playbook: "/srv/web/infra/ansible/playbooks/include/virt-create.yml myhosts=ipsilon:ipsilon_stg"
# This next block configures IPA, it only needs to be run on one member of the cluster
- name: setup IPA
hosts: ipa[0]:ipa_stg[0]
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
tasks:
- name: Add the ipsilon HBAC service in IPA
ipahbacsvc:
name: ipsilon
description: Ipsilon authentication service
ipaadmin_password: "{{ ipa_admin_password }}"
tags:
- ipsilon
- name: Allow login through ipsilon
ipahbacrule:
name: ipsilon
description: Login through ipsilon
hbacsvc:
- ipsilon
usercategory: all
host: "{{ (env == 'production')|ternary(groups['ipsilon'], groups['ipsilon_stg']) }}"
ipaadmin_password: "{{ ipa_admin_password }}"
tags:
- ipsilon
- name: make the box be real
hosts: ipsilon:ipsilon_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
vars:
ipsilon_db_host: "db-fas01{{ env_suffix }}.iad2.fedoraproject.org"
roles:
- base
- rkhunter
- nagios_client
- hosts
- rsyncd
- sudo
- { role: openvpn/client,
when: env != "staging" }
- mod_wsgi
- role: keytab/service
owner_user: apache
owner_group: apache
service: HTTP
host: "id.stg.fedoraproject.org"
when: env == "staging"
- role: keytab/service
owner_user: apache
owner_group: apache
service: HTTP
host: "id.fedoraproject.org"
when: env == "production"
pre_tasks:
- import_tasks: "{{ tasks_path }}/yumrepos.yml"
tasks:
- import_tasks: "{{ tasks_path }}/motd.yml"
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"
- name: deploy ipsilon itself
hosts: ipsilon:ipsilon_stg
user: root
gather_facts: True
vars_files:
- /srv/web/infra/ansible/vars/global.yml
- "/srv/private/ansible/vars.yml"
- "{{ vars_path }}/{{ ansible_distribution }}.yml"
vars:
ipsilon_db_host: "db-fas01{{ env_suffix }}.iad2.fedoraproject.org"
roles:
- ipsilon
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"