I'm getting an error with a very simple play,
- name: add to environment
lineinfile:
path: /etc/environment
line: "{{ item }}"
loop:
- "foo=1"
- "bar=2"
I simply want to add those lines to that file if they don't exist. The error I get is,
fatal: [10.1.38.15]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'item' is undefined\n\nThe error appears to have been in '/home/ecarroll/cp/ansible/roles/sandbox/tasks/main.yml': line 6, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n dest: /\n- name: add to environment\n ^ here\n"}