Re: [ansible-project] replace spaces in filenames

2022-03-17 Thread Todd Lewis
There are accepted patches in the pipeline which add an "--all" parameter to the `rename` command, so you can replace all the spaces in one go instead of just the first one. Alas, that has not made it to a released version yet. Soon, though, I hope. On Thursday, March 17, 2022 at 4:41:27 PM UTC

Re: [ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread Todd Lewis
As to "why the ansible team has decided that become keywords cannot affect include_vars", I rather doubt it's ever come up before. Internally, Ansible does *lots* of including/importing vars files. I imagine it evolved as a simple way to let the user pick some snowflake that wasn't one of the

Re: [ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread Todd Lewis
This slurp worked for me: |- name: Slurp the file vars: ansible_become: yes ansible_become_method: sudo ansible_become_user: root slurp: src: "{{ restricted_file }}" delegate_to: "{{ controller_host }}" register: slop - name: Set a fact set_fact: slick: "{{ slop.content | b64decode | from_yaml

Re: [ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread jean-christophe manciot
@uto...@gmail.com I just need to let the user running the playbook access files which cannot be accessed to any other user (except root of course). I'm very surprised that this limitation exist with that module. @Brian Coca I just don't understand why the ansible team has decided that become ke

Re: [ansible-project] replace spaces in filenames

2022-03-17 Thread Brian Coca
yes, but for that specific task i would use the `rename` command with expressions -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread Brian Coca
The 'usable' part is badly phrased, it won't error (yet) with become settings (from config/cli/keywords or vars) but it ignores them > Are you implying that it is not possible to include a vars file on the > controller that require higher privileges than the user's permissions running > the play

[ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread Todd Lewis
Although your initial post amply demonstrates the problem you ran into, we can surmise that what you're trying to accomplish is more interesting. Can we step back a bit and maybe up to a higher level and explore your actual use case? (I have a feeling the answer is going to involve ansible-vault

[ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread Todd Lewis
"Is usable alongside become keywords" is a description of the "becomes" attribute. The key point for your case is the red "none" in the "Support" column, which together means that no amount of "become" shenanigans is going to affect the behavior of include_vars. Interpretation of the "Attribute

[ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread Todd Lewis
Yes, I implied exactly that. I should have stated it explicitly. (Also, I think it's true, but Ansible has surprised me more than once before.) On Thursday, March 17, 2022 at 3:02:56 PM UTC-4 actionm...@gmail.com wrote: > Are you implying that it is not possible to include a vars file on the >

[ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread jean-christophe manciot
Also, what does "Is usable alongside become keywords" mean? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To v

[ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread jean-christophe manciot
Are you implying that it is not possible to include a vars file on the controller that require higher privileges than the user's permissions running the playbook? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this grou

[ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread Todd Lewis
The "become" bits have to do with privilege escalation for Ansible tasks that run on the target hosts. Including/importing vars and friends happen on the Ansible controller, not the target hosts. It doesn't matter that your target host and your Ansible controller are the same host. Controller bi

[ansible-project] Re: How to use include_vars with a file needing elevated privileges

2022-03-17 Thread jean-christophe manciot
It seems to be a tricky one. I am using ansible core 2.12.3. Does @Brian Coca have any suggestion? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-pr

[ansible-project] How to use include_vars with a file needing elevated privileges

2022-03-17 Thread jean-christophe manciot
Let's suppose I run a playbook as a non-root user and one task needs to include a vars file with only root permissions. The ansible.builtin.include_vars official doc states that:the 'become

[ansible-project] replace spaces in filenames

2022-03-17 Thread dulhaver via Ansible Project
hi everybody, I have a situation where I need to replace spaces in filenames on a large scale. Is there any way to do this with Ansible? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emai

Re: [ansible-project] Ansible Asynchronous actions

2022-03-17 Thread Vladimir Botka
On Wed, 16 Mar 2022 23:40:57 -0700 (PDT) Dip Giri wrote: > How to hide FAILED - RETRYING logs from async_status Use callback community.general.diy. For example - async_status: jid: "{{ output.ansible_job_id }}" register: job_result until: job_result.finished delay: