-
Notifications
You must be signed in to change notification settings - Fork 1
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 #7 from Respheal/master
Cleanup pass
- Loading branch information
Showing
7 changed files
with
108 additions
and
39 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
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
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
--- | ||
- name: (RedHat 7) Install Remi repo | ||
when: ansible_distribution_major_version == '7' | ||
package: | ||
name: 'https://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm' | ||
name: "https://rpms.remirepo.net/enterprise/remi-release-7.rpm" | ||
state: present | ||
when: ansible_distribution_major_version == "7" | ||
|
||
- name: (RedHat 7) Install Redis | ||
when: ansible_distribution_major_version == '7' | ||
package: | ||
name: "{{ redis_packages }}" | ||
enablerepo: "remi" | ||
state: present | ||
register: redis_installed | ||
when: ansible_distribution_major_version == "7" |
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,78 @@ | ||
--- | ||
|
||
- name: (Debian) Include os_family vars | ||
include_vars: Debian.yml | ||
when: ansible_os_family == "Debian" | ||
|
||
- name: Set lists of required variables | ||
set_fact: | ||
redis_required_strings: | ||
- redis_conf | ||
- redis_daemon | ||
- redis_conf_bind | ||
- redis_conf_daemonize | ||
- redis_conf_supervised | ||
- redis_conf_pidfile | ||
- redis_conf_logfile | ||
- redis_conf_maxmemory | ||
- redis_conf_maxmemory_policy | ||
redis_required_ints: | ||
- redis_conf_timeout | ||
required_lists: | ||
- redis_packages | ||
|
||
- name: Check required Redis variables (strings) | ||
fail: | ||
msg: | | ||
Invalid value for variable for '{{ item }}': {{ lookup('vars', item) }} | ||
Supported types : String | ||
Supported values : Any non-null string | ||
when: >- | ||
lookup('vars', item) is not string | ||
or lookup('vars', item) == 0 | ||
with_items: "{{ redis_required_strings }}" | ||
|
||
- name: Check required Redis variables (integers) | ||
fail: | ||
msg: | | ||
Invalid value for variable for '{{ item }}': {{ lookup('vars', item) }} | ||
Supported types : Integer | ||
Supported values : A number between 0-65535 | ||
when: >- | ||
lookup('vars', item)|int < 0 | ||
or lookup('vars', item)|int > 65535 | ||
with_items: "{{ redis_required_ints }}" | ||
|
||
- name: Check required Redis variables (lists) | ||
fail: | ||
msg: | | ||
Invalid value for variable for '{{ item }}': {{ lookup('vars', item) }} | ||
Supported types : List, string | ||
Supported values : Any non-null list or string | ||
when: >- | ||
lookup('vars', item) is not iterable | ||
or lookup('vars', item) == 0 | ||
with_items: "{{ required_lists }}" | ||
|
||
- name: Check variable 'systemd_restart_setting' | ||
fail: | ||
msg: | | ||
Invalid value for variable 'systemd_restart_setting': '{{ systemd_restart_setting }}' | ||
Supported types : String | ||
Supported values : "no", "on-success", "on-failure", "on-abnormal", | ||
"on-watchdog", "on-abort", "always" | ||
failed_when: >- | ||
systemd_restart_setting not in | ||
['no', 'on-success', 'on-failure', 'on-abnormal', | ||
'on-watchdog', 'on-abort', 'always'] | ||
or systemd_restart_setting is not string | ||
or systemd_restart_setting == 0 | ||
when: >- | ||
(redis_systemd_restart is defined | ||
and redis_systemd_restart) | ||
or (systemd_restart is defined | ||
and systemd_restart) |
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
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
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