-
Notifications
You must be signed in to change notification settings - Fork 2
/
pcd_service.yml
32 lines (28 loc) · 1013 Bytes
/
pcd_service.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
---
##
# prepare|configure|deploy a service
#
# 1. specify the service to apply by passing the PCD_ROLE variable
#
# 2. -optionally- limit the hosts via --limit, and tasks via --tags
#
# e.g. ansible-playbook -i inventory/my.hosts pcd_service.yml \
# --limit=dbservers --tags=configure -e PCD_ROLE=mysql
#
# + `prepare` tasks typically handle ONE-TIME prerequisites such as
# dependency installations, user account creations, database setup, &c.
#
# + `configure` tasks typically execute more often, whenever
# configuration changes are made. E.g. to update a cron schedule
#
# + If no tags are passed, all tasks will be executed.
#
- name: "pcd application"
hosts: all
remote_user: root
pre_tasks:
fail: msg="Please specify the role to execute by passing the PCD_ROLE variable"
when: PCD_ROLE is not defined
roles:
- {role: pcd-common, tags: ['prepare','configure','deploy']}
- {role: pcd-services/{{ PCD_ROLE }}, when: PCD_ROLE is defined }