Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Do not use nested variables #87

Open
koenpunt opened this issue Dec 22, 2016 · 2 comments
Open

Request: Do not use nested variables #87

koenpunt opened this issue Dec 22, 2016 · 2 comments
Assignees

Comments

@koenpunt
Copy link

koenpunt commented Dec 22, 2016

Now everyone that wants to customise a single option, they have to define the full hash.

With the defaults like:

  rbenv:
    env: system
    version: v1.0.0
    default_ruby: 2.3.3

Just setting the default_ruby requires me to define the full hash, e.g.:

- role: rbenv
  rbenv:
    env: system
    version: v1.0.0
    default_ruby: 2.1.6

And now since 3.0.0 the rubies properties is added, which requires me to add that to my playbook configuration (or add a version constraint).

There a way to get this working by setting hash_behaviour, but this isn't recommended:

We generally recommend not using this setting unless you think you have an absolute need for it, and playbooks in the official examples repos do not use this setting:

So I suggest to change it to plain variables:

  rbenv_env: system
  rbenv_version: v1.0.0
  rbenv_default_ruby: 2.3.3
  rbenv_rubies:
    - version: 2.3.3
@zzet zzet self-assigned this Jan 10, 2017
@RossBarnie
Copy link

In a role to install and configure Icinga2, we've made the decision to keep certain variables in a hash and came up agains the same issues regarding variables as hash getting overwritten. We solved this using the combine filter and setting the default values under vars in the role, see Icinga/ansible-icinga2@0fd8afe. May or may not be suitable here.

@AndrewKvalheim
Copy link

Related: #89, #150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants