forked from tonykay/bad-ansible
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.yml
47 lines (42 loc) · 1003 Bytes
/
main.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
---
# Bad ansible! This playbook is an example of poor/bad practices!
# Bad practices may include:
#
# Poor formatting and structure
# Poor use of YAML - but good enough to parse
# Inconsistent style
# Incorrect use of modules
# Poor module choice
# Unclear names
# Hard coding / poor use of variables
# Roles - what are roles?
# Bare variables
# No use of handlers
- name: configuration
hosts: all
gather_facts: false # remove later! speeds up testing
become: true
tasks:
- name: enable repos
template:
src: /etc/yum.repos.d/open_three-tier-app.repo
dest: /etc/yum.repos.d/open_three-tier-app.repo
mode: 0644
- name: AppServers
hosts: apps
gather_facts: false
become: true
roles:
- AppServer
- name: Front End Servers
hosts: frontends
gather_facts: false # remove later! speeds up testing
become: true
roles:
- FEServer
- name: deploy postgres
gather_facts: false
become: true
hosts: appdbs
roles:
- DbServer