1
0
pet-project-server/ansible/configuration.yml

104 lines
2.4 KiB
YAML

---
- hosts: all
become: true
vars:
from_vagrant: no
deploy_user: deployer
apps:
notes:
name: notes
dbname: notes_db
dbuser: notes_user
dbpassword: Sf6tp6LKeCyrjVZ2YGKYUd
timezone: UTC
# nginx settings
nginx_remove_default_vhost: true
# php settings
php_version: '7.1'
php_packages:
- php7.1
- php7.1-curl
- php7.1-gd
- php7.1-fpm
- php7.1-mbstring
- php7.1-xml
- php7.1-intl
- php7.1-zip
- php7.1-mysql
php_webserver_daemon: nginx
php_enable_php_fpm: true
php_date_timezone: '{{ timezone }}'
# mysql settings
mysql_databases:
- name: '{{ apps.notes.dbname }}'
mysql_users:
- name: '{{ apps.notes.dbuser }}'
host: '127.0.0.1'
password: '{{ apps.notes.dbpassword }}'
priv: '{{ apps.notes.dbname }}.*:ALL'
pre_tasks:
- name: Ensure that PHP PPA is added.
apt_repository: repo=ppa:ondrej/php state=present
- name: Update apt cache
apt: update_cache=yes
- name: Install system packages
apt: pkg={{ item }} state=latest
with_items:
- curl
- git
- make
- python-software-properties
- wget
- zip
- name: Add deploy user
user:
name: '{{ deploy_user }}'
groups: www-data
roles:
- yatesr.timezone
- geerlingguy.nginx
- geerlingguy.php-versions
- geerlingguy.php
- geerlingguy.mysql
- role: static-site
static_site_name: anwinged
static_site_domain: anwinged.ru
- role: static-site
static_site_name: s2photo
static_site_domain: s2photo.ru
- role: symfony-app
app_name: notes
app_user: notes_owner
app_user_ssh_keys: ['{{ lookup("file", "av_id_rsa.pub") }}']
app_domains: ['notes.anwinged.ru']
app_cert: yes
app_cert_type: 'letsencrypt'
app_cert_email: anwinged@ya.ru
app_envs:
NOTES_SECRET_TOKEN: qJqFNP5B9RP2EfqgpTPyZe
NOTES_DATABASE_HOST: 127.0.0.1
NOTES_DATABASE_PORT: 3306
NOTES_DATABASE_NAME: '{{ apps.notes.dbname }}'
NOTES_DATABASE_USER: '{{ apps.notes.dbuser }}'
NOTES_DATABASE_PASSWORD: '{{ apps.notes.dbpassword }}'
NOTES_MAILER_HOST: smtp.timeweb.ru
NOTES_MAILER_PORT: 25
NOTES_MAILER_USER: noreply@anwinged.ru
NOTES_MAILER_PASSWORD: C5DkD5gs
SYMFONY_ENV: prod