-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.yml
85 lines (75 loc) · 2.04 KB
/
local.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
74
75
76
77
78
79
80
81
82
83
84
85
---
- hosts: localhost
connection: local
become: true
vars_files:
- vars.yml
pre_tasks:
- name: Create directories
file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: 0664
loop:
- /var/log/ibl
- /var/log/ibl/one_more
- /some_mount_dir
- name: Create log file
file:
path: /var/log/ibl/ansible-pull.log
owner: root
group: root
mode: 0664
tasks:
- name: Ensure a job runs every 15 minutes. Creates an entry like "15 * * * * ls -alh > /dev/null"
cron:
name: "check dirs"
minute: "15"
job: "ls -alh > /dev/null"
- name: Schedule an ansible-pull every 15 minutes, log to /var/log/ibl/ansible-pull.log
cron:
name: "ansible-pull job"
minute: "15"
job: "/usr/bin/ansible-pull --only-if-changed --url https://github.com/micheleangelofabbri/ansible-test.git >> /var/log/ibl/ansible-pull.log"
- name: Add a user account with a specific uid and a primary group of 'sudo'
user:
name: new_user
comment: Some new user account
uid: 1077
group: sudo
createhome: yes # Defaults to yes
home: /home/new_user # Defaults to /home/<username>
- name: Remove the user 'johndoe'
user:
name: johndoe
state: absent
remove: yes
- name: Install Apache
apt:
name: apache2
update_cache: yes
state: latest
- name: Create document root
file:
path: "/var/www/{{ http_host }}"
state: directory
owner: "{{ app_user }}"
mode: '0755'
- name: Mount and bind a volume
ansible.posix.mount:
path: /system/new_volume/some_mount_dir
src: /some_mount_dir
opts: bind
state: mounted
fstype: none
handlers:
- name: Reload Apache
service:
name: apache2
state: reloaded
- name: Restart Apache
service:
name: apache2
state: restarted