ansible-redis icon indicating copy to clipboard operation
ansible-redis copied to clipboard

add support for install in LXC containers

Open siavashsardari opened this issue 4 years ago • 2 comments

Running Redis inside LXC containers requires Redis config which basically tell systemd that the service is running in an unprivileged env and cannot use private devices.

siavashsardari avatar Jan 18 '21 08:01 siavashsardari

@DavidWittman please consider merging this change as this is solves a major problem with this role.

Migsi avatar May 18 '21 10:05 Migsi

@siavashsardari @Migsi i have a semi related issue, just in terms of needing to be able to modify the systemd template. I like the idea of having opinionated defaults, but i can't really think of a good solution to expose modifications i need. Exposing more systemd variables seems like a never ending task. Like in my case, i also need to define specific After= targets as well.

This seems a bit rigid, but even if there was an option to provide your own template, it would basically invalidate/NOOP role variables which seems dangerous.

- name: create redis systemd service
  template:
    src: "{{ item }}"
    dest: /etc/systemd/system/{{ redis_service_name }}.service
    mode: 0644
  with_first_found:
    - files:
      - "{{ ansible_os_family }}/redis.service.j2"
      - default/redis.service.j2
      paths:
        - ../templates
  register: redis_unit_file
  when: redis_as_service and ansible_service_mgr|default() == "systemd"

rromanchuk avatar May 23 '21 02:05 rromanchuk