If you're talking about roles, default variables should be put in the defaults/main.yml file.
On Thu, Jan 9, 2014 at 2:02 PM, Stan Lemon <[email protected]> wrote: > Is there a way to default a variable inside of a tasks file? Use case is > something like this... I have a list of tasks that I include in some play > books, each of which I am currently defining the vars in. For a couple of > those vars they're there more for flexibility that actually necessity, and > I am wondering if there is a way with jinja to maybe default them... > something like {{varname|"def_value"}} or something that could be done in > the task itself when that variable has not been defined. > > Thanks for your help, > Stan > > -- > 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]. > For more options, visit https://groups.google.com/groups/opt_out. > -- James Cammarata <[email protected]> Sr. Software Engineer, AnsibleWorks, Inc. http://www.ansibleworks.com/ -- 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]. For more options, visit https://groups.google.com/groups/opt_out.
