Hi John, I believe

- set_fact: foo={{ansible_hostname|default('default_ value')}}

should do what you want.

On Wed, Sep 17, 2014 at 4:20 PM, John Oliver <[email protected]> wrote:

> I'd like to have SSL certificates uploaded and configured according to
> hostname, ie. host1 gets the cert and key for host1, etc.
>
> It seems like the easiest way is to set a variable to equal
> ansible_hostname, but I'd need a way to handle exceptions, so if
> ansible_hostname isn't one of an expected set of values, the variable could
> be set to some default value.  What would be the best way to accomplish
> something like this?
>
> --
> 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/c6565db5-2c7b-4c5b-ba90-f3eaf6bdd0bf%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/c6565db5-2c7b-4c5b-ba90-f3eaf6bdd0bf%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/CAMFyvFhypqZzLRn7w15MHZEUvGdZcPdzMh3F1AkW81y-y4%2BMww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to