-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from StackStorm/add_redis
Updates to install redis, so can be used as coordination backend
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Install redis | ||
become: yes | ||
package: | ||
name: "{{ redis_package }}" | ||
state: present | ||
register: _task | ||
retries: 5 | ||
delay: 3 | ||
until: _task is succeeded | ||
tags: redis | ||
|
||
- name: Allow redis to be controlled by systemd | ||
become: yes | ||
lineinfile: | ||
dest: /etc/redis/redis.conf | ||
line: supervised systemd | ||
tags: redis | ||
when: ansible_facts.os_family == 'Debian' and ansible_facts.distribution_major_version != "16" | ||
|
||
- name: Change bind to be ipv4 only if needed | ||
become: yes | ||
lineinfile: | ||
dest: "{{ '/etc/redis.conf' if ansible_facts.os_family == 'RedHat' else '/etc/redis/redis.conf' }}" | ||
line: "bind 127.0.0.1" | ||
regexp: '^bind ' | ||
tags: redis | ||
when: (ansible_facts["all_ipv6_addresses"] | length == 0) | ||
|
||
- name: Ensure redis service is enabled and running | ||
become: yes | ||
service: | ||
name: redis | ||
enabled: yes | ||
state: started | ||
tags: redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Name of redis package to install | ||
redis_package: "{{ 'redis' if ansible_facts.os_family == 'RedHat' else 'redis-server' }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,12 @@ st2_config: {} | |
# password: random-password123 | ||
# messaging: | ||
# url: amqp://st2:[email protected]:5672// | ||
# In StackStorm > 3.4 then redis client libraries are included in the ST2 | ||
# package. And therefore redis can be automatically used by setting st2_config | ||
# as follows | ||
#st2_config: | ||
# coordination: | ||
# url: redis://127.0.0.1:6379 | ||
|
||
# System user from which st2 will execute local/remote shell actions | ||
st2_system_user: stanley | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters