The match is a regular expression match (not a wildcard match). If you want
something ending in 'd' try this:
search('d$')
kind regards
Pshem
On Tue, 5 Dec 2017 at 13:08 Luke Miller <[email protected]> wrote:
>
> I am trying to use tests to match a hostname, I want hostnames that end in
> the letter "d", they are non-production hosts, here is what I have:
>
> - name: Register to Foreman Redhat non-Prod
> redhat_subscription:
> state: present
> activationkey: "Non-Prod-Redhat-7"
> org_id: "Default_Organization"
> when: inventory_hostname_short | match("*d")
>
>
> and I am getting this error:
>
> TASK [Register to Foreman Redhat non-Prod]
> ***********************************************************************************************************************************************
> fatal: [slpatch001d]: FAILED! => {"failed": true, "msg": "The conditional
> check 'inventory_hostname_short | match(\"*d\")' failed. The error was:
> nothing to repeat\n\nThe error appears to have been in
> '/Users/millerlu/misc/foreman.yml': line 10, column 7, but may\nbe
> elsewhere in the file depending on the exact syntax problem.\n\nThe
> offending line appears to be:\n\n\n - name: Register to Foreman Redhat
> non-Prod\n ^ here\n"}
>
> What am I doing wrong here?
>
> Thanks,
> Luke
>
> --
> 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/b1b87d02-ac11-4fca-95ce-9cbd2ee59729%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/b1b87d02-ac11-4fca-95ce-9cbd2ee59729%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CAEaZiRVXV_3mGu55Ht%2BVUbwC-QyeER3Ze3tq_GKb6fA5Ev-piQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.