Unable to install httpd service in ansible nodes - getting below error.

[ansadmin@ip-192-168-0-126 playbooks]$ ansible-playbook 08_installhttpd.yml

PLAY [This script is about installing httpd in the web nodes] *******************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [192.168.0.175]
ok: [192.168.0.225]

TASK [yum] **********************************************************************************************************************************************************************************
fatal: [192.168.0.175]: FAILED! => {“changed”: false, “msg”: “Unsupported parameters for (yum) module: status Supported parameters include: allow_downgrade, autoremove, bugfix, conf_file, disable_excludes, disable_gpg_check, disable_plugin, disablerepo, download_dir, download_only, enable_plugin, enablerepo, exclude, install_repoquery, install_weak_deps, installroot, list, lock_timeout, name, releasever, security, skip_broken, state, update_cache, update_only, use_backend, validate_certs”}
fatal: [192.168.0.225]: FAILED! => {“changed”: false, “msg”: “Unsupported parameters for (yum) module: status Supported parameters include: allow_downgrade, autoremove, bugfix, conf_file, disable_excludes, disable_gpg_check, disable_plugin, disablerepo, download_dir, download_only, enable_plugin, enablerepo, exclude, install_repoquery, install_weak_deps, installroot, list, lock_timeout, name, releasever, security, skip_broken, state, update_cache, update_only, use_backend, validate_certs”}

PLAY RECAP **********************************************************************************************************************************************************************************
192.168.0.175 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
192.168.0.225 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Ansible Script is :

The option is state instead of status https://docs.ansible.com/ansible/latest/modules/yum_module.html

I have changed to state from status
but this time below error.

TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [192.168.0.175]
ok: [192.168.0.225]

TASK [yum] **********************************************************************************************************************************************************************************
fatal: [192.168.0.175]: FAILED! => {“changed”: false, “msg”: “Failure talking to yum: Could not contact any CDS load balancers: rhui2-cds01.us-east-1.aws.ce.redhat.com, rhui2-cds02.us-east-1.aws.ce.redhat.com.”}
fatal: [192.168.0.225]: FAILED! => {“changed”: false, “msg”: “Failure talking to yum: Could not contact any CDS load balancers: rhui2-cds01.us-east-1.aws.ce.redhat.com, rhui2-cds02.us-east-1.aws.ce.redhat.com.”}

PLAY RECAP **********************************************************************************************************************************************************************************
192.168.0.175 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
192.168.0.225 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

This looks like you can’t reach or have permission to use it. Check that you are using enough permissions or that you can reach the repositories.

Answer is in the error message really – “Unsupported parameters for (yum) module: status

The parameter should be “state” not “status” – see eg below:

  • name: install httpd

yum: name=httpd state=present

As stated, you need to reference a credential with relevant permissions too though.

Regards

Phil

(attachments)

image001.jpg