geerlingguy / ansible-role-redis

Ansible Role - Redis
https://galaxy.ansible.com/geerlingguy/redis/
MIT License
254 stars 197 forks source link

Allow arbitrary extra configs #35

Closed emmetog closed 4 years ago

emmetog commented 6 years ago

Allows arbitrary extra configs.

My use case was configuring redis in cluster mode where I need cluster-enabled yes, slaveof, masterof and related configs.

Until this gets merged the contents of this PR are available in galaxy here: https://galaxy.ansible.com/emmetog/ansible_role_redis

Fixes #28

oldskool commented 6 years ago

This is kind of why you can define redis_includes: https://github.com/geerlingguy/ansible-role-redis/blob/master/templates/redis.conf.j2#L46

Just add a step in your playbook that puts a file with additional config values on your server. For example:

- name: Add additional Redis configuration
  lineinfile:
    path: /etc/redis/mystuff.conf
    line: '{{ item }}'
    create: yes
    owner: redis
    group: redis
    mode: 0640
  with_items:
    - 'cluster-enabled yes'

Then you can define this in your playbook:

redis_includes:
  - /etc/redis/mystuff.conf

And it will include your additional config. Given, it's a little more work to setup. But it's already possible with the current role.

stale[bot] commented 4 years ago

This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark pull requests as stale.

stale[bot] commented 4 years ago

This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.