On 08/07/2021 12:18, Charles Daniel wrote:
> Hi Dick, Below is the complete output of the playbook,
>
> [root@tower1 temp_play]# ansible-playbook testplay2.yml -i /etc/ansible/temp_play/hosts
>
> PLAY [Get the secondary router tunnel ip address] *****************************************************************
>
> TASK [Obtain secondary tunnel interface ip address] ***************************************************************
> ok: [172.16.12.1]
>
> TASK [debug] ******************************************************************************************************
> ok: [172.16.12.1] => {
> "msg": [
> "Internet address is
172.16.121.6/32 <
http://172.16.121.6/32>"
> ]
> }
>
Hello Charles,
the output looks like a string, so the map filter doesn't makes sense here.
Please try:
{{output.stdout | regex_search('(([0-9]+(.)[0-9]+(.)[0-9]+(.)[0-9]+))') }}
Regards
Racke
> TASK [set_fact] ***************************************************************************************************
> ok: [172.16.12.1]
>
> TASK [debug] ******************************************************************************************************
> ok: [172.16.12.1] => {
> "msg": {
> "ansible_facts": {
> "intf": "- [u'172.16.121.6']\n"
> },
> "changed": false,
> "failed": false
> }
> }
>
> PLAY RECAP ********************************************************************************************************
> 172.16.12.1 : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
>
> [root@tower1 temp_play]#
>
> Thanks,
> Charles Daniel
>
>
> On Thu, 8 Jul 2021 at 15:34, Dick Visser <
dick....@geant.org <mailto:
dick....@geant.org>> wrote:
>
> You're sending only the output of the debug task with the regex_search
> applied to the output.stdout variable.
> We need to see the output.stdout variable before you mangled it.
>
> > To unsubscribe from this group and stop receiving emails from it, send an email to
ansible-proje...@googlegroups.com <mailto:
ansible-project%2Bunsu...@googlegroups.com>.
> > To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAPnV%3Dh%2B7LxPqEnbrezq3Maofib9Ak8UmLUsK10twE0DeqXKBPw%40mail.gmail.com <
https://groups.google.com/d/msgid/ansible-project/CAPnV%3Dh%2B7LxPqEnbrezq3Maofib9Ak8UmLUsK10twE0DeqXKBPw%40mail.gmail.com>.
>
>
>
> --
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>
> --
> 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-proje...@googlegroups.com <mailto:
ansible-project%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPitsJ0-RyoEdfUWJkV%3DBusc8y7gx8r_YnB1YuvDwuCeQ%40mail.gmail.com <
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPitsJ0-RyoEdfUWJkV%3DBusc8y7gx8r_YnB1YuvDwuCeQ%40mail.gmail.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-proje...@googlegroups.com <mailto:
ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAPnV%3DhLBRtLbu0RWnNodwDs7v7xfrtprATkeKhfKC6%2By98OVsQ%40mail.gmail.com <
https://groups.google.com/d/msgid/ansible-project/CAPnV%3DhLBRtLbu0RWnNodwDs7v7xfrtprATkeKhfKC6%2By98OVsQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.