with_dict keys with "." was working in Ansible 1.9.4 but not with 2.1.0

47 views
Skip to first unread message

Ryan Groten

unread,
Apr 22, 2016, 10:55:49 AM4/22/16
to Ansible Project
When setting sysctl parameters I use the following variable:

kernel_params:
  kernel
.sem: 250 32000 100 128
  kernel
.shmmni: 4096
  net
.core.rmem_max: 4194304
  net
.core.rmem_default: 262144
  net
.core.wmem_max: 1048576
  net
.core.wmem_default: 262144
...

Then in my role I do the following:

- name: Change kernel parameters
  sysctl
:
    name
: "{{ item.key }}"
    value
: "{{ item.value }}"
    state
: present
  with_dict
: "{{ kernel_params }}"

In Ansible 1.9.4 this worked fine, but when I tried it with Ansible 2.1.0 I get the following error:

TASK [db-sysprep : Change kernel parameters] ****************************
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal error.:
'kernel' is undefined. This feature will be removed in a future release. Deprecation warnings can be
disabled
by setting deprecation_warnings=False in ansible.cfg.
fatal
: [rlxpool51.corp.ads]: FAILED! => {"failed": true, "msg": "with_dict expects a dict"}

It seems like the "." in the key name is causing confusion, although I'm not really sure why (or how to fix it).

Thanks,
Ryan
Reply all
Reply to author
Forward
0 new messages