I tried the above what Kai suggested however that is not working and unable
to get the particular json for me from the specific backup dir. However I
could find a way to get this done as shown below - this way we can get the
output from the variable line by line.
with_items:
- "{{ dashboards_imported_from_latest_backup.stdout_lines[2] }}"
- "{{ dashboards_imported_from_latest_backup.stdout_lines[3] }}"
- "{{ dashboards_imported_from_latest_backup.stdout_lines[4] }}"
On Monday, February 3, 2020 at 10:22:42 AM UTC+5:30, Vishal Bobade wrote:
>
> Thanks Kai. No actually this is not going to be one item only as it should
> be done for almost 7-8 json files. so i think the below trick you shown I
> am going to try that right now and see if that works forme. Thanks again ,
> cheers!
>
> On Saturday, February 1, 2020 at 1:42:41 PM UTC+5:30, Kai Stian Olstad
> wrote:
>>
>> On 01.02.2020 06:55, Vishal Bobade wrote:
>> > trying like this
>> >
>> > with_items:
>> > - "{{ dashboards_imported_from_latest_backup ~
>> > '/Artifactory_Monitoring.json' }}"
>> >
>> >
>> >
>> > On Saturday, February 1, 2020 at 11:24:05 AM UTC+5:30, Vishal Bobade
>> > wrote:
>> >>
>> >> HI kai,
>> >>
>> >> thanks for the response. however I am trying to use inside looping
>> >> with_items it isn't working.
>> >>
>> >> "msg": "error : Can't load json file [Errno 2] No such file or
>> >> directory:
>> >> '{\\'stderr_lines\\':
>>
>> This will only be one item so you don't need to use with_items.
>> Anyway, since you only need the text it should be like this
>>
>> with_items:
>> - "{{
>> dashboards_imported_from_latest_backup}}/Artifactory_Monitoring.json"
>>
>>
>> --
>> Kai Stian Olstad
>>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9551db5a-8eba-41b6-a667-893b2d3fa184%40googlegroups.com.