Git Product home page Git Product logo

Comments (5)

ansibot avatar ansibot commented on June 23, 2024

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

from ansible.

mattclay avatar mattclay commented on June 23, 2024

Hi!

Thanks very much for your submission to Ansible. It means a lot to us that you've taken time to contribute.

Unfortunately, we're not sure if we want this feature in the program, and I don't want this to seem confrontational.
Our reasons for this are:

  • You could use a variable for hosts. There are various ways it can be set, including through set_fact in a previous play, or using vars on the task that imports the playbook.
  • For cases where import_playbook doesn't provide the options needed, you can invoke ansible-playbook as a task instead.

However, we're absolutely always up for discussion.
Because this project is very active, we're unlikely to see comments made on closed tickets and we lock them after some time.
If you or anyone else has any further questions, please let us know by using any of the communication methods listed in the page below:

In the future, sometimes starting a discussion on the development list prior to implementing
a feature can make getting things included a little easier, but it's not always necessary.

Thank you once again for this and your interest in Ansible!

from ansible.

s-hertel avatar s-hertel commented on June 23, 2024

I have a playbook for deploying all web servers, but normally I don't want to deploy them all at the same time. That's why I always use a limit with -l such as ansible-playbook webserver.yml -l dev so that only the dev servers are deployed.

@RayJin2000 since you mention using --limit, setting hosts to something like "{{ ansible_limit | default(yourdefault) }}" might be a good option. https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html#term-ansible_limit

from ansible.

RayJin2000 avatar RayJin2000 commented on June 23, 2024

@s-hertel you mean i can do this:

- import_playbook: databases.yml
  vars:
    ansible_limit: prod

from ansible.

bcoca avatar bcoca commented on June 23, 2024

no, ansilbe_limit is not 'settable' , it always reflects the command line

you can have the databases.yml:

- hosts: ' {{ target| default("all") }}'
...

and then

- import_playbook: databases.yml
  vars:
    target: prod

from ansible.

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.