Git Product home page Git Product logo

Comments (4)

ansibot avatar ansibot commented on June 9, 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.

bcoca avatar bcoca commented on June 9, 2024

so, what you want is to insert an 'intermediate play'?

- hosts: normalplay
...

- hosts: localhost
  gather_facts: false
  tasks:
    - dotheonethingonce:
...
- hosts: normalplay
...

from ansible.

RobinR1 avatar RobinR1 commented on June 9, 2024

Then I would have to split the role into 3 parts ? a role for the part before the download of the software, the actual download, and then a role for the part after the download. This is not feasible for us as we want to have one single role for each piece of software we want to deploy/configure. Splitting this role up would make it much more (user) error prone since it would be inconsistent to how all our other roles work.

Meanwhile I have found that it is solved by using include_tasks instead of using import_tasks for the download part (in the full role the download part was already a separate yaml file imported into main.yaml using import_tasks. Changing this to include_tasks makes the tasks in that file run only on all active, not skipped targets, hence run_once on the actual download is then executed on the first not skipped target.
But as include_tasks doesn't support delegation and such, I had to bring that over to all tasks in the separate tasks file,

So I finally managed to work around the issue. But I still think it is undesirable behavior of run_once to only try to execute the task on the first target in the list and not run at all if that target just so happens to be skipped.

Another thing I would like to see improved, and that would have prevented this problem from happening, is that if in a play a role has conditions, the targets that should skip the role, are removed from the list specifically for that role, so they just skip that role instead of skipping each individual task in the role. That would decrease the amount of logging Ansible generates here daily considerably. Not really a showstopper but that would, in my opinion, be a lot cleaner. (We also had problems with the amount of logging in earlier versions of AWX causing it to lose track of running tasks with too much logging and even tasks suddenly terminating due to it..., but luckily that seems to be solved in more recent versions)

from ansible.

mkrizek avatar mkrizek commented on June 9, 2024

Thank you very much for your interest in Ansible. We have no plans to implement this feature at this time. However we would review a pull request if anyone is interested in implementing the feature.

If you have further questions please stop by IRC or the mailing list:

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.