...
|
...
|
@@ -13,6 +13,10 @@ |
|
|
stat: path=/Data/local/redis/bin/redis-server
|
|
|
register: redis_binary
|
|
|
|
|
|
- name: Check if twemproxy already installed
|
|
|
stat: path=/Data/local/twemproxy/sbin/nutcracker
|
|
|
register: nutcracker_binary
|
|
|
|
|
|
- name: Upload redis source package
|
|
|
copy:
|
|
|
src: "redis-3.2.12.tar.gz"
|
...
|
...
|
@@ -20,6 +24,13 @@ |
|
|
mode: 0755
|
|
|
when: redis_binary.stat.exists == False
|
|
|
|
|
|
- name: Upload twemproxy source package
|
|
|
copy:
|
|
|
src: "nutcracker-0.4.1.tar.gz"
|
|
|
dest: "/root/nutcracker-0.4.1.tar.gz"
|
|
|
mode: 0755
|
|
|
when: nutcracker_binary.stat.exists == False
|
|
|
|
|
|
- name: Decompress and install redis
|
|
|
shell: cd /root/ && mkdir -p /Data/local/ && tar -zxvf redis-3.2.12.tar.gz && cd redis-3.2.12 && make && make PREFIX=/Data/local/redis install && mkdir -p /Data/local/redis/conf /Data/logs/redis/ /Data/local/redis/data
|
|
|
when: redis_binary.stat.exists == False
|
...
|
...
|
@@ -37,19 +48,15 @@ |
|
|
state: installed
|
|
|
update_cache: yes
|
|
|
|
|
|
- name: Check if twemproxy already installed
|
|
|
stat: path=/Data/local/twemproxy/sbin/nutcracker
|
|
|
register: nutcracker_binary
|
|
|
|
|
|
- name: Download latest twemproxy
|
|
|
git:
|
|
|
repo: https://github.com/twitter/twemproxy.git
|
|
|
dest: /root/twemproxy
|
|
|
accept_hostkey: true
|
|
|
when: nutcracker_binary.stat.exists == False
|
|
|
#- name: Download latest twemproxy
|
|
|
# git:
|
|
|
# repo: https://github.com/twitter/twemproxy.git
|
|
|
# dest: /root/twemproxy
|
|
|
# accept_hostkey: true
|
|
|
# when: nutcracker_binary.stat.exists == False
|
|
|
|
|
|
- name: Install twemproxy
|
|
|
shell: cd /root/twemproxy && autoreconf268 -ivf && ./configure --prefix=/Data/local/twemproxy && make && make install && mkdir -p /Data/local/twemproxy/conf
|
|
|
shell: cd /root/ && tar -zxvf nutcracker-0.4.1.tar.gz && cd nutcracker-0.4.1 && autoreconf268 -ivf && ./configure --prefix=/Data/local/twemproxy && make && make install && mkdir -p /Data/local/twemproxy/conf
|
|
|
when: nutcracker_binary.stat.exists == False
|
|
|
|
|
|
- name: Update twemproxy configuration file
|
...
|
...
|
|