additional course material RH294
Olaf Bohlen
2020-08-20 1de6236f80a879ca110981fe0e5c0c05c521225b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
# Variable setup.
- name: Include OS-specific variables.
  include_vars: "{{ ansible_os_family }}.yml"
 
- name: Define redis_package.
  set_fact:
    redis_package: "{{ __redis_package }}"
  when: redis_package is not defined
 
# Setup/install tasks.
- include_tasks: setup-RedHat.yml
  when: ansible_os_family == 'RedHat'
 
- include_tasks: setup-Debian.yml
  when: ansible_os_family == 'Debian'
 
- include_tasks: setup-Archlinux.yml
  when: ansible_os_family == 'Archlinux'
 
- name: Ensure Redis is configured.
  template:
    src: redis.conf.j2
    dest: "{{ redis_conf_path }}"
    mode: 0644
  notify: restart redis
 
- name: Ensure Redis is running and enabled on boot.
  service: "name={{ redis_daemon }} state=started enabled=yes"