-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathmain.yml
More file actions
73 lines (53 loc) · 1.95 KB
/
main.yml
File metadata and controls
73 lines (53 loc) · 1.95 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
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
#VERSION: 0.0.3
---
- hosts: launched
sudo: yes
vars_files:
- vars.yml
tasks:
- name: update apt
apt: update_cache=yes
- name: ensure packages installed
apt: pkg={{ item }} state=latest
with_items:
- make
- build-essential
- tcl8.5
- name: download latest stable redis
get_url: url=http://download.redis.io/redis-stable.tar.gz dest=/tmp/redis-stable.tar.gz
- name: untar redis
command: tar zxf /tmp/redis-stable.tar.gz -C /tmp
- name: build redis
command: make -C /tmp/redis-stable
- name: create redis group
group: name=redis state=present system=yes
- name: create redis user
user: name=redis group=redis createhome=no shell=/bin/false system=yes state=present
- name: make sure that /etc/redis exists
file: path=/etc/redis state=directory mode=0755
- name: make sure that /var/db/redis exists
file: path=/var/db/redis state=directory mode=0755 group=redis owner=redis
- name: make sure redis.log file exists
copy: src=templates/redis.log dest=/var/log/redis.log owner=redis group=redis mode=0644
- name: copy upstart file
copy: src=templates/upstart.conf dest=/etc/init/redis.conf
- name: copy redis.conf file
copy: src=templates/redis.conf dest=/etc/redis/redis.conf group=redis owner=redis
- name: copy custom template
template: src=templates/redis.local.conf.j2 dest=/etc/redis/redis.local.conf group=redis owner=redis
- name: copy redis-local script
template: src=templates/redis-local.j2 dest=/usr/local/bin/redis-local mode=0755
- name: installing redis binaries
command: cp /tmp/redis-stable/src/{{ item }} /usr/local/bin
with_items:
- redis-server
- redis-cli
- redis-check-aof
- redis-check-dump
- name: cleaning up build files
command: rm -rf /tmp/{{ item }}
with_items:
- redis-stable
- redis-stable.tar.gz
- name: ensure redis service is restarted
service: name=redis state=restarted