On Tue, Mar 15, 2016 at 10:19 AM, James Cammarata <[email protected]> wrote:
> On Tue, Mar 15, 2016 at 10:12 AM, Jan Grant <[email protected]> wrote: > >> I certainly don't want to see dynamic includes go away. >> > > They're definitely not going to go away :) > > > Assuming the preprocessing and running code is neatly split, how about: >> >> 1. Preprocess "static" includes - which can be identified by the absence >> of J2 constructs in them >> 2. Dynamically preprocess dynamic includes and run them as currently. >> 3. Add a "dynamic: yes" flag which optionally adds the dynamic behaviour >> for things that look like static includes. >> > > #1 is something which can be done pretty easily, if there's no loop and > the file name contains no variables. For #3 though, I went the other way > because to me the more tricky thing to figure out is when you see something > like my earlier example, when you've got `- include: "{{some_var}}.yml"`, > and you want to force it to be pre-processed instead of dynamic. This is > why I picked the `static: yes` syntax instead of the converse. > > I can look at tweaking my feature branch to do the above, though this is > why I added config options. Using variables in the include name is valid in > 1.x, so to 2.0 those would look like dynamic includes (as they should, > because now the variable COULD come from an inventory source as well). > Just pushed an update to my feature branch to implement #1 above: https://github.com/ansible/ansible/compare/static_includes#diff-69130db4f6e9ef75876cab5ca756d9d6R118 -- 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/CAMFyvFhrmcOD3QP%3DDkCmoN-LuSHwfeg0kKcJDf5TEZ4SY%2BwKUA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
