Lecture: Roles - Using Notification Playbook fails
Posted on: Oct 04, 2018by: Ted G
When new notification added to the webservers role. Complains about the "debug" statement.
Can you provide your role definition?
been going through the roles lectures section in order. All works well till this lecture and they have us add a extra notification to install telnet and a debug statement in tasks/main.yml
The role definition is important, but the exact error message may be more instructive to know...
ERROR! this task 'debug' has extra params, which is only allowed in the following modules: shell, win_shell, include_vars, add_host, raw, .....etc
THe error appears to have been in '/home/ansible/playbooks/Roles/roles/webservers/tasks/main.yml: line 11, column 3, but may be somewhere else in the file depending on the exact syntax problem.
the offending line appears to be:
- debug: Need to install Telnet
The issue stems from the text you have on the line after the 'debug:' statement. Nothing else goes on that line. You can add some text you want to display, but it goes on the next line behind "msg:". See the Ansible documentation right here on debug.
Funny as it worked for the instructor when he did it on the lecture. I vaughly remember useing msg: to go with debug statements on some earlier playbooks.