Il giorno lunedì 26 febbraio 2018 16:14:19 UTC, flowerysong ha scritto:
>
>
>
>
> You'll note that this error is from the 'debug' task, which has neither a
> loop nor a 'when' clause. `item` is undefined because `item` has not been
> defined for that task.
>
> If you were attempting to apply
]
But as noted by floweryoursong...
Il giorno lunedì 26 febbraio 2018 15:38:58 UTC, Kai Stian Olstad ha scritto:
>
> On Monday, 26 February 2018 15.39.09 CET Nico Sabbi wrote:
> > HI,
> > can I combine when: and with_items clauses as in this example?
> >
> >
HI,
can I combine when: and with_items clauses as in this example?
become: true
become_user: root
tasks:
- block:
- debug:
msg: "riga {{item}}"
- user:
name: "{{ item.split(':')[0] }}"
home: "{{ item.split(':')[1] }}"
when: item
Sorry, but it's not clear at all how debug iterates over the rows.
Running a simple debug doesn't help.
For example, if I had a playbook like this (that of course doesn't work),
how should I fix it
to iterate over every single row and print the value of the 3 columns?
---
- hosts: db
HI,
I find Ansible docs *really* frustrating. Never a full example that is
not trivial or misleading.
Please, can someone provide a working example of a play to iterate over the
rows of a csvfile?
Thanks.
--
You received this message because you are subscribed to the Google Groups
s precise.
>
> On Tuesday, February 13, 2018 at 10:45:57 AM UTC-6, Nico Sabbi wrote:
>>
>> HI,
>> I need to do a grep-like search in a file without using shell commands
>> and in a check_mode compatible way.
>> I just need to check the presence of a given string a
:
> path: /etc/myfile
> register: myfile
>
> - set_fact:
> contains_cmdline: "{{ myfile.contents|b64decode|search("^CMDLINE") }}"
>
> On Tue, Feb 13, 2018 at 10:45 AM, Nico Sabbi <nico@gmail.com
> > wrote:
>
>>
HI,
I need to do a grep-like search in a file without using shell commands and
in a check_mode compatible way.
I just need to check the presence of a given string a in a file without
doing overwrites of any kind.
I implemented something with lineinfile but I'm very annoyed by the need
to