Fix #12349
revisit packages/common_packages
0%
Description
While reviewing docs for/trying to understand packages vs common_packages, I wondered if it would not be possible to use the same var name, "packages", at various levels of the tree, and have the more-specific levels do a list append; that way, each level defines which packages it knows to be necessary without the artificial split between "high-level" in common_packages and "low level" in packages (and the implication that there are only two levels of owners of package lists).
Something like "packages: {{packages|list}} + {{additional_packages|list}}"
was suggested. It's not clear if Ansible allows the RHS to refer to the prior value of a variable in order to reassign it to the LHS.
History
#1 Updated by Dan Mick over 8 years ago
- Category set to ansible
- Assignee set to Andrew Schoen
- Source changed from other to Development
#2 Updated by Dan Mick over 8 years ago
- Subject changed from revisit packages vs common_packages to revisit packages/common_packages
#3 Updated by Andrew Schoen over 8 years ago
- Status changed from New to In Progress
It doesn't seem we can use the same variable and append to it across multiple variable files.
This syntax does not appear to work:
packages: "{{ packages }} + {{ additional_packages }}"
Jinja2 gets stuck in recursion and can't render the template.
Any other ideas on how to make common_packages and packages easier to understand?
#4 Updated by Andrew Schoen over 8 years ago
- Status changed from In Progress to Need More Info