-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.provision.yml
56 lines (51 loc) · 1.82 KB
/
example.provision.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
################################################################################
# provision.yml
#
# Server provisioning script
#
# USAGE
#
# 1. Copy this file outside the provision repository
# 2. Name it provision.yml
# 3. Create a folder called provision_tasks
# 4. Copy example.dev_tasks.yml and example.prod_tasks.yml into provision_tasks
# as dev_tasks.yml and prod_tasks.yml respectively.
# 5. Optionally, create a folder called provision_overrides to contain
# environment specific variables (dev_vars.yml or prod_vars.yml).
# 6. To execute:
# ansible-playbook provision.yml --extra-vars="hosts={string} user={string} base_path={path} server_type={string: dev|prod}"
#
################################################################################
---
- hosts: $hosts
user: $user
sudo: True
gather_facts: no # Disable for vagrant boxes to save time
vars:
# Base path for includes and files
# Must be set to absolute path of playbooks directory
base: $base_path
# Set the server environment to dev or prod
env: $server_type
vars_files:
- $base/apache/vars.yml
- $base/mysql/vars.yml
- $base/php/vars.yml
- $base/varnish/vars.yml
- $base/jenkins/vars.yml
# Enable for variable overrides for the current environment
#- provision_overrides/${env}_vars.yml
tasks:
# -= REQUIRED =-
- include: $base/common/setup.yml
# Load tasks specific to an environment
- include: provision_tasks/${env}_tasks.yml
handlers:
# Include all handlers even if some of these packages are not installed
- include: $base/apache/handler.yml
- include: $base/mysql/handler.yml
- include: $base/drush/handler.yml
- include: $base/mongodb/handler.yml
- include: $base/tools/handler.yml
- include: $base/varnish/handler.yml
- include: $base/jenkins/handler.yml