geerlingguy / ansible-role-redis

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

Add replication support #30

Closed Lusitaniae closed 4 years ago

Lusitaniae commented 6 years ago

Hi @geerlingguy,

Can we merge this? We can configure the node as slave and what password to use to authenticate with master.

oldskool commented 6 years ago

Why not define redis_includes instead: 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 Redis replication configuration
  lineinfile:
    path: /etc/redis/replication.conf
    line: '{{ item }}'
    create: yes
    owner: redis
    group: redis
    mode: 0640
  with_items:
    - 'slaveof 192.168.0.1'
    - 'masterauth foo'

Then you can define this in your playbook:

redis_includes:
  - /etc/redis/replication.conf

And it will include your additional config and you're good to go.

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.

Lusitaniae commented 4 years ago

still valid

stale[bot] commented 4 years ago

This issue is no longer marked for closure.

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.

Lusitaniae commented 4 years ago

Still relevant

stale[bot] commented 4 years ago

This issue is no longer marked for closure.

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.