Comments (10)
From your description, the problem does not seem to be related directly to the role and more of an environment issue.
Right now it's hard to provide any guidance - as a lot of information is missing. Especially having the full text output of a run with ANSIBLE_DEBUG=true
.
If you are failing with setting ANSIBLE_DEBUG=true
might I suggest that you just edit the role locally and set no_log=false
manually on the task?
from ansible-role-promtail.
I'll try and get some more debug information.
from ansible-role-promtail.
This is the output from that task when no_log=false
from ansible-role-promtail.
So it seems like the delegate_to: localhost
was the issue that I was having when using version 1.21.0. When I comment that part out. It works as expected.
I see 1.22.0 that part was changed. So I'll test that out and report back
EDITIED: The latest version causes another issue
Seems like delegate_to doesn't work will with become: true
with the module.
from ansible-role-promtail.
This seems still to be more of an issue with your environment / playbook. The role will not per-default elevate the privileges for the preflight tasks - please see: https://github.com/patrickjahns/ansible-role-promtail/blob/master/tasks/main.yml#L1-L22
Please share your playbook and the way you are executing your playbook - the core cause for this is most likely there
Can I also ask you, to share any issues as plaintext instead of screenshots. Screenshots are hard to read when it's text, as it is cropped to fit into size and makes it very uncomfortable to read. Thank you
from ansible-role-promtail.
Can I also ask you, to share any issues as plaintext instead of screenshots. Screenshots are hard to read when it's text, as it is cropped to fit into size and makes it very uncomfortable to read. Thank you
Sorry about that. Will do plaintext going forth.
Please share your playbook and the way you are executing your playbook - the core cause for this is most likely there
So the playbook is pretty simple. I'm just running this with packer with the ansible provider. When the provider ssh into the system. It is as a non-root user
, since root user ssh is locked down. I use ansible become
to allow that user to become root before it executes the playbook. It's able to do that since that ssh user is allowed sudo privs
The problem I think is happening is that since part of the task in the role is delegated to localhost
. Ansible is trying to run sudo on my local machine which it can't so it fails to run the task. I opened a PR that fixed my problem by not escalating the user for that task but I can just leave it in my fork if it's not what you desired.
Playbook
---
- name: Setup promtail
hosts: all
become: true
vars_files:
- ./vars/default.yml
roles:
- { role: promtail, tags: promtail }
default.yml
promtail_version: latest
promtail_log_level: debug
promtail_loki_server_url: https://my.domainname.com
promtail_config_scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
host: "{{ ansible_hostname }}"
__path__: /var/log/*log
packer config
provisioner "ansible" {
playbook_file = "./ansible/site.yml"
user = "provisioner"
roles_path = "./ansible/roles"
galaxy_file = "./ansible/requirements.yml"
galaxy_force_install = true
use_proxy = false
}
EDITIED:
- added packer config and link to packer ansible docs
from ansible-role-promtail.
Thank you for all the information ❤️
As I've suspected, you are forcing become: true
on all tasks with your current playbook. As the role already takes care of requesting elevated privileges only for tasks it requires sudo rights, it wouldn't be required to set this on the playbook level.
Can you try running the playbook without it:
---
- name: Setup promtail
hosts: all
vars_files:
- ./vars/default.yml
roles:
- { role: promtail, tags: promtail }
from ansible-role-promtail.
thats good to know. Some roles required me to elevate to root before running. Running this role without root worked. So I'll just separate out those roles into another step.
Thanks for the help.
from ansible-role-promtail.
Happy to hear that it's now working for you as intended 👍 . Thank you very much for the open communication and collaboration on this issue
from ansible-role-promtail.
thank you for a great role.
from ansible-role-promtail.
Related Issues (20)
- Support pipeline_stages HOT 3
- run_once causes failures when not all nodes in batch get promtail
- Make LimitNOFILE in systemd service configurable HOT 5
- Unable to run the role without enabling and starting the promtail service HOT 2
- Reenable version check for default tests
- 1.19.1 no longer works: user promtail is currently used by process 546 HOT 4
- Update release pipeline (before Jun 23)
- Add variable (list) for additional command line arguments/flags passed to promtail HOT 1
- promtail_config_expand_env variable is wrong by default HOT 1
- unable to parse syslog config receiver
- Automatic publishing to Ansible Galaxy is currently broken
- Support arbitrary options in the configuration file HOT 3
- [Question] Is ansible-lint being used? HOT 1
- set acl for read rights HOT 3
- Remove update_cache or make it optional HOT 3
- Cannot pull latest version HOT 3
- Ability to disable checksum check HOT 3
- latest Tag: failing at downloading SHA256SUMS HOT 3
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-promtail.