Whenever I run my game, the following warning appears:
[WARNING]: when building the mapping from /etc/ansible/roles/foo/tasks/main.yml line 17, column 3, a duplicate dict key (file) was found. Use only the last defined value.
The corresponding part of my main.yml in the task folder looks like this:
(line 17 is the task of cleaning files that seem a bit off, so I think the problem is with the previous <script line)
- name: Run script to format output script: foo.py {{ taskname }} /tmp/fcpout.log - name: Clean temp files file: path=/tmp/fcpout.log state=absent
And my vars file:
--- my_dict: {SLM: "114", Regular: "255", Production: "1"} taskid: "{{my_dict[taskname]}}"
To run my book, I:
ansible-playbook playbooks/foo.yml --extra-vars "server=bar taskname=SLM"
What I'm trying to do is take the command line arguments, set the hosts: with the "server" parameter, get the name of the task and find out which identifier it belongs to. This identifier is used as the first input of my python script, which is started remotely.
Playbook works fine, but I donโt understand why I am getting a warning. Can someone explain what is wrong here?
source share