Hi, I have a simple playbook to install packages on my servers/virtual machines. The package name to install is a variable, with prompt if needed. As a default behaviour I want it to install the package on all servers, but I want to be able to override it if needed. The problem I see (as an ansible beginner) is that I either have to set the hosts as a variable, with no default value possible and hence a systematic prompt or -e flag passed to the command, or hardcode the default value and edit the playbook when I want to install a package to a specific server only. I could also have 2 playbooks, one for installation on all servers, and one with a prompt for the hosts value.
None of those scenarios feel right. I've seen also that overriding the hosts value with the ansible-playbook is not seen as a good thing (https://github.com/ansible/ansible/issues/725 ). But wouldn't default values for vars be the right solution in this case? Thanks Raph PS: Of course, if you consider that a server should be reinstallable from scratch like it's needed on EC2, this question doesn't make sense. But from my understanding ansible doesn't mean to limit itself to the cloud scenario. -- 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/250a04b0-7cd9-4d39-9af8-97b5d07cb4b7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
