Learning Ansible and found issue with yum module

1,420 views
Skip to first unread message

Donald Macaulay

unread,
Jun 30, 2016, 12:38:18 PM6/30/16
to Ansible Project
I am running through an Ansible training course on Pluralsight and I am trying to deploy Apache from onto a remote CentOS box using (Ansible controller is also on CentOS).

The command I am using is:

ansible webservers -i inventory -m yum -a "name=httpd state=present" --sudo -ask-sudo-pass

But I get the following error:

ERROR! this task 'yum' has extra params, which is only allowed in the following modules: command, shell, script, include, include_vars, add_host, group_by, set_fact, raw, meta

This command works in the training material but not in my test lab so I'm a bit stuck with how to proceed.

Dan Lang

unread,
Jun 30, 2016, 1:26:22 PM6/30/16
to Ansible Project
What version of Ansible do you have?  You can find that with the --version flag.   You may also want to change your use of -sudo to use --become and --ask-become-pass since sudo is deprecated. 

Donald Macaulay

unread,
Jun 30, 2016, 7:27:41 PM6/30/16
to Ansible Project
I'm running 2.1.0.0.

Superb.  Your suggestion worked perfectly.  I didn't realise --sudo was deprecated.
Reply all
Reply to author
Forward
0 new messages