-
Notifications
You must be signed in to change notification settings - Fork 2
/
pcd_system.yml
73 lines (54 loc) · 1.92 KB
/
pcd_system.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
##
# prepare|configure|deploy systems
#
# 1. (optionally) limit the hosts via --limit, and tasks via --tags
#
# e.g. ansible-playbook -i inventory/my.hosts pcd_system.yml \
# --limit=nashville-app-1.iceburg.net --tags=configure
#
# + `prepare` tasks typically handle ONE-TIME prerequisites such as setting
# the hostname, preparing ssh public key authentication and root user's key,
# ensure /etc/ansible metadirs, &c.
#
# + `configure` tasks typically execute more often, whenever
# configuration changes are made. E.g. change swap size
#
# + If no tags are passed, all tasks will be executed.
#
- name: "pcd system"
hosts: all
remote_user: root
gather_facts: no
vars:
# @todo amazon is deprecated, fix + test
pcd_supported_platforms: ['CentOS-7','CentOS-6','Debian-7','Debian-6']
pre_tasks:
- name: ensure ansible prerequisites are installed
script: roles/pcd-systems/ansible_prereqs.sh
register: script_result
changed_when: "'SUCCESS' in script_result.stdout"
- name: gather system facts
setup:
- set_fact: pcd_platform="{{ ansible_distribution }}-{{ ansible_distribution_major_version }}"
# ensure detected platform is supported
- fail: msg="warning! {{ pcd_platform }} is an untested platform!"
when: pcd_platform not in pcd_supported_platforms
tags: ['prepare','configure']
- name: group by platform
group_by: key="{{ pcd_platform }}"
tags: ['prepare','configure']
- name: "Debian Preparation"
hosts: Debian-7:Debian-6
remote_user: root
roles:
- {role: pcd-common, tags: ['prepare','configure']}
- pcd-systems/Debian
- pcd-systems/common
- name: "CentOS Preparation"
hosts: CentOS-7:CentOS-6
remote_user: root
roles:
- {role: pcd-common, tags: ['prepare','configure']}
- pcd-systems/CentOS
- pcd-systems/common