-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.yml
52 lines (45 loc) · 1.59 KB
/
example.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
---
include:
- lib/arch_base.inc.yml
hosts:
hostname:
ip: hostname.com
password: abc
wants:
# [taskname, options]
- [set_hostname, hostname.com]
- [set_locale, en_US.UTF-8, de, Europe/Berlin]
- apache2
hostname.user:
ip: hostname.com
user: "@" # localuser
# no password -> ssh key will be used
wants:
- vimrc
tasks:
apache2:
install:
# if state check fails, task will be executed in order: pre, cp, post
# every file in the cp section will also be handled as a state check
# if no state check is specified, task will be executed every time
state: test -e /usr/bin/apachectl
# pacman macro turns into -> pacman -Syu (see lib/arch_base.inc.yml)
pre: (($pacman apache php php-apache
post:
- systemctl enable httpd.service
- systemctl start httpd.service
config:
pre: systemctl stop httpd.service
cp:
apache2/httpd.conf: [ /etc/httpd/conf/httpd.conf, "root:root", 644 ]
# if you put a @ in front of the local fname, that file will be parse
# through ERB, this allows for dynamic configuration files.
# You f.e. check the host.hostname and disable/enable a part of the config
"@apache2/httpd-vhosts.conf:" [ /etc/httpd/conf/extra/httpd-vhosts.conf, "root:root", 644 ]
apache2/php.ini: [ /etc/php/php.ini, "root:root", 644 ]
post: systemctl start httpd.service
vimrc:
config:
cp:
vim/vimrc: [ ~/.vimrc, "@", 644 ]
# vim: syntax=yaml ts=2 sw=2 expandtab