diff --git a/ansible1/playbook-develop-ubuntu.yml b/ansible1/playbook-develop-ubuntu.yml index b39b14544..bbd4a7897 100644 --- a/ansible1/playbook-develop-ubuntu.yml +++ b/ansible1/playbook-develop-ubuntu.yml @@ -7,3 +7,4 @@ roles: # - packages - postgresql + - redis diff --git a/ansible1/roles/redis/handlers/main.yml b/ansible1/roles/redis/handlers/main.yml new file mode 100644 index 000000000..bc131de72 --- /dev/null +++ b/ansible1/roles/redis/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: Restart Redis + service: + name: redis-server + state: restarted diff --git a/ansible1/roles/redis/tasks/main.yml b/ansible1/roles/redis/tasks/main.yml new file mode 100644 index 000000000..ed1d84f25 --- /dev/null +++ b/ansible1/roles/redis/tasks/main.yml @@ -0,0 +1,32 @@ +--- +- name: Update apt-get repo and cache + apt: + update_cache: yes + +- name: Install redis + apt: + name: redis-server + state: present + +- name: Update redis configuration + lineinfile: + path: /etc/redis/redis.conf + regexp: "^protected-mode" + line: "protected-mode no" + state: present + backup: yes + +- name: Bind default address + lineinfile: + path: /etc/redis/redis.conf + regexp: "^bind" + line: "bind 0.0.0.0 ::1" + state: present + backup: yes + notify: Restart redis + +- name: Start redis + service: + name: redis-server + state: started + enabled: yes