2019-12-05 12:16:37 +00:00
|
|
|
---
|
|
|
|
- hosts: webservers
|
|
|
|
name: Provision the webserver machines
|
|
|
|
become: true
|
|
|
|
|
|
|
|
roles:
|
|
|
|
- role: geerlingguy.apache
|
|
|
|
tags: [web]
|
|
|
|
- role: geerlingguy.mysql
|
|
|
|
tags: [mysql]
|
|
|
|
- role: geerlingguy.php-versions
|
|
|
|
tags: [php]
|
|
|
|
- role: geerlingguy.php
|
|
|
|
tags: [php]
|
|
|
|
- role: geerlingguy.php-mysql
|
|
|
|
tags: [php, mysql]
|
|
|
|
- role: geerlingguy.composer
|
|
|
|
tags: [php, composer]
|
|
|
|
|
|
|
|
vars_files:
|
|
|
|
- vars/provision_vault.yml
|
|
|
|
- vars/vars.yml
|
|
|
|
- vars/provision_vars.yml
|
|
|
|
|
|
|
|
tasks:
|
2020-06-16 20:53:44 +00:00
|
|
|
- name: Install base packages
|
|
|
|
apt:
|
|
|
|
name: [zip]
|
|
|
|
state: present
|
|
|
|
|
2019-12-05 12:16:37 +00:00
|
|
|
- name: Create a database
|
|
|
|
mysql_db:
|
|
|
|
name: '{{ database_name }}'
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Add the database user
|
|
|
|
mysql_user:
|
|
|
|
name: '{{ database_user }}'
|
|
|
|
password: '{{ database_password }}'
|
|
|
|
priv: '*.*:ALL'
|
|
|
|
state: present
|