Re: [ansible-project] hostvars vs lookup(vars)

2024-03-25 Thread Rob Wagner
I think I got it. Thanks Brian On Thu, Mar 21, 2024 at 9:50 AM Brian Coca wrote: > Both are valid approaches but do different things, hostvars will > provide a untemplated subset of what you can get through the vars > lookups for the case of 'inventory_hostname', but the lookups do not >

Re: [ansible-project] interpolation of loop variables

2024-03-19 Thread Rob Wagner
Got it, I’ll use the lookup. Thanks Brian > On Mar 18, 2024, at 10:36 AM, Brian Coca wrote: > > `vars` was undocumented and for internal use, we stopped using it > internally but have been unable to remove it (and save many resources) > because people keep using(abusing) it. > > Soon we will

Re: [ansible-project] interpolation of loop variables

2024-03-16 Thread Rob Wagner
Hey Brian - any concerns with assert: that: item in vars Short and sweet! Rob On Fri, Mar 15, 2024 at 3:03 PM Brian Coca wrote: > also varnames lookup > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe

Re: [ansible-project] interpolation of loop variables

2024-03-14 Thread Rob Wagner
Hey Todd - apologies, I don't understand your comment. Hey Walter - yes, you are correct. To elaborate on the use case. FIrst task in my playbooks confirms the user provided all the expected/required variables. I iterate over the list of variables and make sure they are defined with assert.

Re: [ansible-project] backslashes in regex_replace filter

2024-01-17 Thread Rob Wagner
to python raw strings, where a > backslash is always treated as literal. Double quotes require escaping > backslashes. You can read more about the flow scalar styles of YAML at > https://yaml.org/spec/1.2.2/#73-flow-scalar-styles > > On Tue, Jan 9, 2024 at 8:37 AM Rob Wagner wro

Re: [ansible-project] backslashes in regex_replace filter

2024-01-09 Thread Rob Wagner
quotes is automatically escaped? Walter -- Walter Rowe, Division Chief Infrastructure Services Division Mobile: 202.355.4123 On Jan 9, 2024, at 9:04 AM, Rob Wagner wrote: Right, but why doesn’t the \\d need to be double-backslashed?  Backslash-d is regex for matching on a digit.  I just

Re: [ansible-project] backslashes in regex_replace filter

2024-01-09 Thread Rob Wagner
-backslashed because the backref needs to be backslash-digit (\1). Doubling the backslash escapes the backslash. Walter -- Walter Rowe, Division Chief Infrastructure Services Division Mobile: 202.355.4123 On Jan 8, 2024, at 6:57 PM, Rob Wagner wrote: Thanks Matt, but I still don't get why

Re: [ansible-project] backslashes in regex_replace filter

2024-01-08 Thread Rob Wagner
Thanks Matt, but I still don't get why the first parameter (\\d) MAY be double backslashed but the second parameter (\\1) MUST be double backslashed. However, I'm starting to think it's at the python level. https://stackoverflow.com/a/33582215 says Python's string parser causes both \d and \\d to

Re: [ansible-project] why does this loop/when fail

2022-11-28 Thread Rob Wagner
Thanks Racke, but I just tried: - name: task 3 debug: msg: "{{ item }} is in s" loop: "{{ t_list }}" when: ( item | regex_replace('^p(\d+).*$', '\1') ) in s It fails. Only works with \\1. On Mon, Nov 21, 2022 at 9:52 AM Stefan Hornburg (Racke) wrote: > On 21/11/2022

[ansible-project] Timeout (12s) waiting for privilege escalation prompt WITH PIPELINING

2020-09-17 Thread Rob Wagner
Hey all - I'm hitting the infamous Timeout (12s) waiting for privilege escalation prompt error but only under specific conditions. The task that fails is a loop: - name: copy files from blob shell: "{{ blob_ssodba_download_working_dir }}/blob_ssodba_download.py {{ item }} {{

Re: [ansible-project] workaround for serial: 1 failures stopping the entire playbook?

2019-10-22 Thread Rob Wagner
Hey Andrew - were you able to get anywhere with this? I tried adding a block/rescue without any luck. Searching all morning for a way to make ansible move onto the next host in a serial strategy even if one task on one host fails. I'm thinking it's not possible. Rob On Wednesday, April 10,

Re: [ansible-project] Odd case where I cannot figure out how to eliminate {{ }} in a when: clause

2019-07-30 Thread Rob Wagner
Thank you both, and apologies for not responding sooner (got yanked onto something else). vars[] worked great. Rob On Thu, Jul 25, 2019 at 7:00 PM Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On 25.07.2019 23:12, Brian Coca wrote: > > yes, but your example only handles

[ansible-project] Odd case where I cannot figure out how to eliminate {{ }} in a when: clause

2019-07-24 Thread Rob Wagner
All - I'm trying to dynamically set facts in a loop. (Long story short, for a list of keys, if the key isn't defined, I want to replace the key with the value from a register variable.) I have a playbook that works, but it requires the use of {{ }} in a when: clause, and Ansible is

[ansible-project] Re: plugin with side effects vs module

2019-07-05 Thread Rob Wagner
Any thoughts on this? I've been mulling it over and (not to dump on passwordstore) it really seems like a lookup plugin shouldn't have side effects. Rob On Tuesday, June 25, 2019 at 2:41:59 PM UTC-4, Rob Wagner wrote: > > Hey all - looking for some advice. I need to write either a

[ansible-project] plugin with side effects vs module

2019-06-25 Thread Rob Wagner
Hey all - looking for some advice. I need to write either a plugin or a module to interact with Thycotic Secret Server. In most cases, my code will simply retrieve a credential from Thycotic, so a lookup plugin makes perfect sense. However, there are cases where a specific credential

Re: [ansible-project] with_items stat too verbose

2019-02-11 Thread Rob Wagner
Feel free to create a PR which does that. > > Cheers, > Felix > > > > > I appreciate I'm > > getting into the weeds here, but I found it curious that assert got > > noisy in more recent versions. > > > > Rob > > > > On Wed, Feb 6

Re: [ansible-project] with_items stat too verbose

2019-02-08 Thread Rob Wagner
appreciate I'm getting into the weeds here, but I found it curious that assert got noisy in more recent versions. Rob On Wed, Feb 6, 2019 at 12:36 PM Rob Wagner wrote: > Thanks Felix. That's a clever idea. I tested it and I get: > > ok: [localhost] => (item=/dev) => { >

Re: [ansible-project] with_items stat too verbose

2019-02-06 Thread Rob Wagner
Thanks Felix. That's a clever idea. I tested it and I get: ok: [localhost] => (item=/dev) => { "changed": false, "item": [ "/dev", "root" ], "msg": "All assertions passed" } ok: [localhost] => (item=/home) => { "changed": false, "item": [ "/home",

Re: [ansible-project] dig lookup exception: 'list' object has no attribute 'startswith'

2018-12-10 Thread Rob Wagner
Thanks Kai. That's it. I thought I had read somewhere that dig will accept a list, but clearly not. On Mon, Dec 10, 2018 at 1:35 PM Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On Monday, 10 December 2018 18:39:02 CET rjwagner@gmail.com wrote: > > - name: debug > >

Re: [ansible-project] dig lookup multiple hosts

2018-12-05 Thread Rob Wagner
Thanks Kai. That worked. I think I don’t quite understand lookup plugins (aside from with_items). I’ll keep researching. Rob > On Dec 5, 2018, at 3:08 PM, Kai Stian Olstad > wrote: > >> On Wednesday, 5 December 2018 19:55:46 CET rjwagner@gmail.com wrote: >> Hey all - I'm trying to