I have a couple of systems that follow a strict hostname schema. For example, depending on the environment, they all follow the same prefix for that environment:
- For development = dev-server1.domain.tld - For testing = test-server1.domain.tld - For production = prod-server1.domain.tld Using Ansible's *setup *module, I know I can call the hostname with a variable of *facter_hostname*. However, how do I use that variable value to compare it with a list of environments like the one above so that if the hostname has the prefix of *dev*, then assign a value of 1; if it contains a prefix of *test*, then assign it a value of 2; if it has a prefix of *prod*, then assign it a value of 3. -- 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/333f046b-bdd3-48c8-919e-0b7037ebf3a2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
