ansible/site.yml

74 lines
2.3 KiB
YAML
Raw Normal View History

2020-10-17 00:21:57 -05:00
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
2020-10-17 01:00:06 -05:00
---
2020-10-17 18:06:35 -05:00
# Preambulatory system configuration
2020-10-17 00:21:57 -05:00
- hosts: all
roles:
- role: common
2020-10-17 01:00:06 -05:00
tags: [ common ]
- role: ansible-pull
tags: [ ansible, common ]
2020-10-17 18:06:35 -05:00
# Database servers
- hosts: db1.test.desu.ltd
roles:
2020-10-29 21:02:02 -05:00
- role: postgresql
2020-10-28 21:56:12 -05:00
vars:
2020-10-29 20:39:59 -05:00
postgresql_global_config_options:
- option: listen_addresses
value: "*"
2020-10-28 21:56:12 -05:00
postgresql_hba_entries:
2020-10-29 20:39:59 -05:00
- { type: local, database: all, user: postgres, auth_method: peer }
- { type: local, database: all, user: all, auth_method: peer }
- { type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5 }
- { type: host, database: all, user: all, address: '::1/128', auth_method: md5 }
2020-10-28 21:56:12 -05:00
# Just allow all access on this block.
# When rolling out to our new env, I'll allow by particular IP alone
- { type: host, database: all, user: all, address: '192.168.0.0/16', auth_method: md5 }
2020-10-29 20:39:59 -05:00
postgresql_users:
- name: gitea
password: "{{ secret_gitea_db_pass }}"
postgresql_databases:
- name: gitea
owner: gitea
2020-10-28 21:56:12 -05:00
become: yes
2020-10-17 18:06:35 -05:00
tags: [ db, psql ]
# Webservers
- hosts: web1.test.desu.ltd
roles:
2020-10-29 21:02:02 -05:00
- role: apache
2020-10-29 20:39:59 -05:00
vars:
apache_mods_enabled:
- proxy.load
- proxy_http.load
apache_vhosts:
- servername: git.test.desu.ltd
extra_parameters: |
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://127.0.0.1:3000/ nocanon retry=1
2020-10-28 21:56:12 -05:00
become: yes
2020-10-17 18:06:35 -05:00
tags: [ web, apache ]
2020-10-29 21:02:02 -05:00
- role: php
2020-10-28 21:56:12 -05:00
become: yes
2020-10-17 18:06:35 -05:00
tags: [ web, php ]
2020-10-29 20:39:59 -05:00
- role: gitea
vars:
2020-10-29 20:53:12 -05:00
# Look and feel
gitea_app_name: "Git Desu"
# Core config
2020-10-29 20:39:59 -05:00
gitea_db_type: postgres
gitea_db_host: 192.168.122.169:5432
gitea_db_name: gitea
gitea_db_user: gitea
gitea_db_password: "{{ secret_gitea_db_pass }}"
gitea_http_domain: git.test.desu.ltd
gitea_oauth2_enabled: no
gitea_root_url: http://git.test.desu.ltd
gitea_shell: "/bin/bash"
gitea_ssh_domain: git.test.desu.ltd
gitea_ssh_port: 22
gitea_start_ssh: no
gitea_user: git
become: yes
tags: [ web, gitea ]