summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/old_style_cache_plugins/setup_redis_cache.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/old_style_cache_plugins/setup_redis_cache.yml')
-rw-r--r--test/integration/targets/old_style_cache_plugins/setup_redis_cache.yml51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/integration/targets/old_style_cache_plugins/setup_redis_cache.yml b/test/integration/targets/old_style_cache_plugins/setup_redis_cache.yml
new file mode 100644
index 0000000..8aad37a
--- /dev/null
+++ b/test/integration/targets/old_style_cache_plugins/setup_redis_cache.yml
@@ -0,0 +1,51 @@
+---
+- hosts: localhost
+ vars:
+ make: "{{ ( ansible_distribution != 'FreeBSD' ) | ternary('make', 'gmake') }}"
+ tasks:
+ - name: name ensure make is available
+ command: "which {{ make }}"
+ register: has_make
+ ignore_errors: yes
+
+ - command: apk add --no-cache make
+ when: "has_make is failed and ansible_distribution == 'Alpine'"
+ become: yes
+
+ - package:
+ name: "{{ make }}"
+ state: present
+ become: yes
+ when: "has_make is failed and ansible_distribution != 'Alpine'"
+
+ - name: get the latest stable redis server release
+ get_url:
+ url: http://download.redis.io/redis-stable.tar.gz
+ dest: ./
+
+ - name: unzip download
+ unarchive:
+ src: redis-stable.tar.gz
+ dest: ./
+
+ - command: "{{ make }}"
+ args:
+ chdir: redis-stable
+
+ - name: copy the executable into the path
+ copy:
+ src: "redis-stable/src/{{ item }}"
+ dest: /usr/local/bin/
+ mode: 755
+ become: yes
+ loop:
+ - redis-server
+ - redis-cli
+
+ - name: start the redis server in the background
+ command: redis-server --daemonize yes
+
+ - name: install dependency for the cache plugin
+ pip:
+ name: redis>2.4.5
+ state: present