Hi all,
Where can I see the available options like
 | trim('.') which i can use in playbook.

Warm Regards,
Abhi

On Tue, 13 Jun 2023, 13:20 Will McDonald <[email protected]> wrote:

> This should do the trick:
>
> "{{myhost}}.{{mydns | trim('.')}}"
>
> On Tue, 13 Jun 2023 at 11:52, Veera <[email protected]> wrote:
>
>> Hi,
>>
>> While using set_facts , I am combining a hostname and dns name .
>> myhost = linuxhost1
>> mydns = example.com.
>>
>> while  combining them  with set_fact
>>
>> ansible.builtin.set_fact:
>>    my_fqdn:  "{{myhost}}.{{mydns}}"
>>
>> This gives the desired output of "linuxhost1.example.com."
>> The last dot can be cut with [:-1] with debug , however I want to set
>> this in set_fact itself as I am trying to write the FQDN without a dot to
>> the inventory file.
>>
>>
>>
>>
>> --
>> 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/ebdb13fe-035d-473a-9904-277a11d8e285n%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/ebdb13fe-035d-473a-9904-277a11d8e285n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/CAKtKohQ%2BOx%3DikVNL8sxXBXqLmRO0BW8ZTj6Wev5gy_-0dcyTaQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAKtKohQ%2BOx%3DikVNL8sxXBXqLmRO0BW8ZTj6Wev5gy_-0dcyTaQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CACRdtvuBeQxTdG%2BWD_qo4GKsgtQEpNmce5BA8_O7n_3RC7rMmg%40mail.gmail.com.

Reply via email to