-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.yml
More file actions
46 lines (33 loc) · 1.34 KB
/
setup.yml
File metadata and controls
46 lines (33 loc) · 1.34 KB
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
---
- hosts: nodes
sudo: yes
vars:
# schedule is fed directly to cron
schedule: '*/15 * * * *'
# User to run ansible-pull as from cron
cron_user: root
# File that ansible will use for logs
logfile: /var/log/ansible-pull.log
# Directory to where repository will be cloned
workdir: /var/lib/ansible/local
# Repository to check out
# repo must contain a local.yml file at top level
#repo_url: git://github.com/sfromm/ansible-playbooks.git
repo_url: git://github.com/andybavier/gee-ansible-pull.git
tasks:
- name: Add ansible reop
apt_repository: repo="ppa:ansible/ansible"
- name: Update apt cache
apt: update_cache=yes
- name: Install ansible
apt: name=ansible state=latest
- name: Create local directory to work from
file: path={{workdir}} state=directory owner=root group=root mode=0751
- name: Pull repo to get github.com host key (workaround)
git: repo={{ repo_url }}
dest=/tmp/trash
accept_hostkey=True
- name: Create crontab entry to clone/pull git repository
template: src=templates/etc/cron.d/ansible-pull.j2 dest=/etc/cron.d/ansible-pull owner=root group=root mode=0644
- name: Create logrotate entry for ansible-pull.log
template: src=templates/etc/logrotate.d/ansible-pull.j2 dest=/etc/logrotate.d/ansible-pull owner=root group=root mode=0644