Re: [ansible-project] XML to Datetime

2022-02-04 Thread Rilindo Foster
Perhaps the XML module is an option:

https://docs.ansible.com/ansible/latest/collections/community/general/xml_module.html

> On Feb 3, 2022, at 3:13 PM, Amarpreet Singh  wrote:
> 
> Looking for help to convert XML output of a ssl certificate and get date out 
> of it. 
> Then compare and check if that cert has expired or not.
> 
> output
> 
> "stdout": "{\"not-valid-after\": \"Apr 20 17:36:03 2022 GMT\"}",
> "stdout_lines": [
> "{\"not-valid-after\": \"Apr 20 17:36:03 2022 GMT\"}"
> ],
> "stdout_xml": "Apr 20 17:36:03 2022 
> GMT\n"
> 
> I am looking to change the red highlighted line in datetime format. 
> 
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/26e20e6e-5c9b-45f6-96e4-f523f5fa8534n%40googlegroups.com
>  
> .

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1A1A690B-A27C-4453-BE38-3C3DCE7835EF%40gmail.com.


Re: [ansible-project] XML to Datetime

2022-02-03 Thread Dick Visser
Where does this xml originate from?

On Thu, 3 Feb 2022 at 22:16, Amarpreet Singh  wrote:

> Looking for help to convert XML output of a ssl certificate and get date
> out of it.
> Then compare and check if that cert has expired or not.
>
> output
>
> "stdout": "{\"not-valid-after\": \"Apr 20 17:36:03 2022 GMT\"}",
> "stdout_lines": [
> "{\"not-valid-after\": \"Apr 20 17:36:03 2022 GMT\"}"
> ],
> "stdout_xml": "Apr 20 17:36:03 2022
> GMT\n"
>
> I am looking to change the red highlighted line in datetime format.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/26e20e6e-5c9b-45f6-96e4-f523f5fa8534n%40googlegroups.com
> 
> .
>
-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwOQhMMoYY9LFdta6xqNBSFsYwj%2BCg9cw7VTGmt4im-fpw%40mail.gmail.com.


[ansible-project] XML to Datetime

2022-02-03 Thread Amarpreet Singh
Looking for help to convert XML output of a ssl certificate and get date 
out of it. 
Then compare and check if that cert has expired or not.

output

"stdout": "{\"not-valid-after\": \"Apr 20 17:36:03 2022 GMT\"}",
"stdout_lines": [
"{\"not-valid-after\": \"Apr 20 17:36:03 2022 GMT\"}"
],
"stdout_xml": "Apr 20 17:36:03 2022 
GMT\n"

I am looking to change the red highlighted line in datetime format. 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/26e20e6e-5c9b-45f6-96e4-f523f5fa8534n%40googlegroups.com.