thank you for the advise but i am new to json can you please help with the 
commad or any reference link

On Wednesday, March 27, 2019 at 11:01:52 PM UTC-7, Dick Visser wrote:
>
> The output of that command is already json. Instead of fragile filtering a 
> (hopefully) single line that contains your value and then trying to unquote 
> that, please use the entire output in combination with the from_json filter 
> to access the value. 
>
> Dick
>
> On Wed, 27 Mar 2019 at 23:59, <[email protected] <javascript:>> wrote:
>
>> playbook task
>>
>> - name: "create Assessment template" 
>>
>>     command: "{{ item }}"
>>
>>     with_items: 
>>
>>       - aws inspector create-assessment-template --assessment-target-arn 
>> {{ target_arn }} --assessment-template-name {{ assessment_template_name }} 
>> --duration-in-seconds {{ run_duration }} --rules-package-arns {{ rules_arn 
>> }}
>>
>>     register: template_arn
>>
>>     tags: create-assessment-template
>>
>>   - debug:
>>
>>       var: template_arn.results.0.stdout_lines[1]
>>
>>     tags: create-assessment-template
>>
>> On Wednesday, March 27, 2019 at 3:57:05 PM UTC-7, [email protected] 
>> wrote:
>>>
>>> how can i get only the arn value but not complete output saved in to 
>>> variable
>>>
>>> in the below example
>>>
>>> TASK [debug] 
>>> ****************************************************************************************************************************************************************************************************************************
>>>
>>> ok: [localhost] => {
>>>
>>>     "template_arn.results.0.stdout_lines[1]": "  
>>>   \"assessmentTemplateArn\": 
>>> \"arn:aws:inspector:us-west-2:024283424342:target/0-Rrtw16WK/template/0-5KIIPQREcC\""
>>>
>>>
>>>
>>> i want to print 
>>> only 
>>> arn:aws:inspector:us-west-2:024283424342:target/0-Rrtw16WK/template/0-5KIIPQREcC\
>>>  
>>> i dont want """"assessmentTemplateArn"""" to be saved to my variable 
>>> Can anyone please help
>>>
>>> Thank you 
>>>
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/b73f4838-849d-4590-9231-2007e0acd344%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/b73f4838-849d-4590-9231-2007e0acd344%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
> Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0efad1e6-ce2c-4f8e-9f31-4d753c35f2c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to