GithubHelp home page GithubHelp logo

Comments (6)

sylvek avatar sylvek commented on August 20, 2024

after reading sources, but it's possible to have both on the same host…

…
- include: server.yml
  when: not redis_sentinel
  tags:
    - config

- include: sentinel.yml
  when: redis_sentinel
  tags:
    - config
…

from ansible-redis.

DavidWittman avatar DavidWittman commented on August 20, 2024

@sylvek The idea here is that you can run this role twice if you wish to install Sentinel and Server on the same host. Here's a very basic example:

- hosts: all
  roles:
    - role: DavidWittman.redis
    - role: DavidWittman.redis
      redis_sentinel: true

This is how it has worked for a long time, and I don't see any compelling reason for changing it right now. If you have some particular issue with this method (other than it changes the way you're doing things now), let me know and I'll be happy to review. In the meantime, I'm going to close this issue for now.

from ansible-redis.

sylvek avatar sylvek commented on August 20, 2024

Thank you!

from ansible-redis.

mcheriyath avatar mcheriyath commented on August 20, 2024

My apologies for adding a comment to the closed task.

@DavidWittman Can you please let me know how should I pass the tags while I run the playbook to achieve this?

Is it like the below?
ansible-playbook -i /etc/ansible/hosts redis.yml --tags download,install,config

from ansible-redis.

mcheriyath avatar mcheriyath commented on August 20, 2024

I have figured it out.

As @sylvek mentions, First run should have all the tasks mentioned including the redis_sentinel_monitors[redis-sentinel] and then in the second run we need to comment out the redis-sentinal host part and re-run the same.

The playbook can be run without passing any tags.
ansible-playbook -i /etc/ansible/hosts redis.yml

@DavidWittman Thanks for this Amazing ansible role!

from ansible-redis.

wesgarrison avatar wesgarrison commented on August 20, 2024

Here's the syntax I needed to get it working:

- hosts: all
  roles:
    - role: DavidWittman.redis
      vars:
        redis_sentinel: false

    - role: DavidWittman.redis
      vars:
        redis_sentinel: true

This should also work, depending on your version of ansible.

roles:
  - { role: DavidWittman.redis, vars: { redis_sentinel: "false" } }
  - { role: DavidWittman.redis, vars: { redis_sentinel: "true" } }

from ansible-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.