GNU/Linux: CentOS Linux release 7.6.1810 (Core)
Playbook:
---
- hosts: all
gather_facts: no
vars:
md5script: /pawn/bin/md5verify.sh
tasks:
- name: test (1/3)
command: uptime
- name: test (2/3)
command: uptime
become: yes
- name: test (2/3)
command: ls -l {{ md5script }}
become: yes
Results:
$ ansible-playbook --limit appsrv98 x.yml
PLAY [all] **************************************************************************************************************************************************
TASK [test (1/3)] *******************************************************************************************************************************************
changed: [appsrv98]
TASK [test (2/3)] *******************************************************************************************************************************************
[WARNING]: Module invocation had junk after the JSON data: usage: sudo -e [-S] [-p prompt] [-u username|#uid] file ...
fatal: [appsrv98]: FAILED! => {"changed": false, "module_stderr": "sudo: illegal option `-n'\n", "module_stdout": "usage: sudo -h | -K | -k | -L | -l | -V | -v\nusage: sudo [-bEHPS] [-p prompt] [-u username|#uid] [VAR=value]\n {-i | -s | <command>}\nusage: sudo -e [-S] [-p prompt] [-u username|#uid] file ...\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
PLAY RECAP **************************************************************************************************************************************************
appsrv98 : ok=1 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
shell returned 2
Remote sudo version:
$ sudo -V
Sudo version 1.8.23
Sudoers policy plugin version 1.8.23
Sudoers file grammar version 46
Sudoers I/O plugin version 1.8.23
Local command Ansible version:
$ [meggle1@dvlnx108 ~]$ rpm -qi ansible
Name : ansible
Version : 2.8.5
Release : 1.el7.ans
Architecture: noarch
Install Date: Fri 13 Sep 2019 07:49:12 AM CDT
Group : Development/Libraries
Size : 87783909
License : GPLv3+
Signature : RSA/SHA1, Thu 12 Sep 2019 06:02:36 PM CDT, Key ID b84e339c442667a9
Source RPM : ansible-2.8.5-1.el7.ans.src.rpm
Build Date : Thu 12 Sep 2019 06:01:11 PM CDT
Build Host : jenkins-jnlp-agent-457gk
Relocations : (not relocatable)
URL :
https://www.ansible.comSummary : SSH-based application deployment, configuration management, and IT orchestration platform
Description :
Ansible is a radically simple model-driven configuration management,
multi-node deployment, and orchestration engine. Ansible works
over SSH and does not require any software or daemons to be installed
on remote nodes. Extension modules can be written in any language and
are transferred to managed machines automatically.
Ideas why it's failing?