short answer is yes... easily.

An example of your template scenario might look something like this:

      {% if ansible_local.oscar.tags.environment == "production" %}
          server_name  foo.example.com;
      {% elif ansible_local.oscar.tags.environment == "staging"   %}
          server_name foo-staging.example.com;
      {% else %}
          server_name  {{ ansible_fqdn }};
      {% endif %}

--------
Brent
--------

On Mon, Feb 9, 2015 at 4:19 PM, Chris Short <ch...@chrisshort.net> wrote:

> I'm trying to wrap my brain around something. Can Ansible deploy different
> application configuration files based upon a hostname, IP address, network
> address, etc? To take that a step further, could Ansible look at a template
> and then fill in the blanks based upon hostname, IP, and/or network
> address? If so, how? Is there an example somewhere.
>
> I'm trying to wrap my mind around this concept still so I might not be
> asking this in the right way.
>
> Thanks in advance for any feedback.
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3a50e90e-326a-4b24-8309-ffab6b2294f2%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/3a50e90e-326a-4b24-8309-ffab6b2294f2%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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CABta7G22HoRe6LpL2sAVTJ21SU3hwg5uAULzM6h_%2BtyV8_XvHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to