Git Product home page Git Product logo

Comments (5)

ishanjainn avatar ishanjainn commented on June 8, 2024

@gardar any thoughts on this?

from grafana-ansible-collection.

j-karls avatar j-karls commented on June 8, 2024

As a second option to this, I would love an example of how one might include this role in another playbook and skip the grafana_install stages. I cannot for the life of me figure out how this is possible.

If invoked with --skip-tags "grafana_install", it also skips all of the preflight,configure,dashboard tasks, etc.
If invoked with the reverse of --tags "grafana_preflight,grafana_configure,grafana_dashboard", it still doesn't run the "include_task" tasks, because those themselves are not tagged - they only tag their included tasks if they are first run.
If invoked in this same way but where I also do an args: apply: tags: grafana_configure, then it will add the "grafana_configure" tag to all included tasks - and run all of them - even the ones I intended to skip.

EDIT: Naturally I would figure it out the second I got frustrated enough to post here. The missing ingredient was "untagged". The command:
ansible-playbook -i inventories/hosts playbooks/my_specific_grafana_install.yml --tags "grafana_preflight,grafana_configure,grafana_datasources,grafana_notifications,grafana_dashboards,untagged"

And in my playbook something like this:

  • hosts: server
    collections:
    • grafana.grafana
      tasks:
    • import_role:
      name: grafana.grafana.grafana

from grafana-ansible-collection.

ishanjainn avatar ishanjainn commented on June 8, 2024

Apologies for the late reply but glad you were able to make it work
Ill see if I can add this an example

from grafana-ansible-collection.

j-karls avatar j-karls commented on June 8, 2024

The feature request is still valid. This is an extremely annoying workaround, since it doesn't play nicely with running my playbook from within another playbook (do_site.yml that calls install_grafana, which installs grafana in my own way and then calls the official role). My ansible-playbook command will have to define all tags that I have to use for all roles that I include, otherwise it will silently skip those. It would be much better if Grafana's ansible role simply contained a way to provide your own install / offline support.

from grafana-ansible-collection.

ishanjainn avatar ishanjainn commented on June 8, 2024

Hey @j-karls, Do you want to raise a PR for your proposed changes?

from grafana-ansible-collection.

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.