Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run the role without enabling and starting the promtail service #131

Open
rplevka opened this issue Nov 10, 2022 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@rplevka
Copy link
Contributor

rplevka commented Nov 10, 2022

I'm trying to use the tags to only perform promtail installation, without having the defined systemd service enabled or started
(using promtail_install tags).

The problem is, that the tasks responsible for defining the systemd service and promtail config (that are tagged by promtail_install) notify a handler, that enables and (re)starts the service (regardless of being tagged).

Looks like this is a current ansible limitation.
The workaround might be to use when clauses around the tasks and handler that would check some variable, e.g. promtail_service_start

my use case:
I'm including this role in a play, that creates an OSP instance image. I need the promtail to be ready but not started/enabled, as users will pass their custom enable_promtail flag together with their own scrape configs.

@patrickjahns
Copy link
Owner

I've been thinking through this - especially in terms of using the role in the build process of VM images. Your proposal makes sense - would you be up for creating a PR.
It would be great, if you could create a test-case in https://github.com/patrickjahns/ansible-role-promtail/tree/master/molecule so that your scenario run is covered in the future

@rplevka
Copy link
Contributor Author

rplevka commented Nov 22, 2022

Hi,
thank you for considering this. Unfortunately my time to work on this is quite limited, I had to provide a solution in our project, so I actually decided to write my own, separate roles to handle this (install, deploy).

I can't promise anything, but I'll try to get something together (after I do a bit of studying around molecule).

@patrickjahns patrickjahns added the enhancement New feature or request label May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants