Ansible/RHN: cannot marshal None unless allow_none is enabled

Latest response
TASK [rhn : Register to RHN Server using 3-dev-rhel-x86_64-server-7-key] *********************************************
fatal: [atllvdopap650d]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to register with 'atlsatrh01c.hughestelematics.net': cannot marshal None unless allow_none is enabled"

I get the above when trying to register a machine to RHN using the rhn_register Ansible module.

ansible 2.3.1.0
  config file = /home/reinose/ansible_sysops.newvm/ansible.cfg
  configured module search path = [u'library']
  python version = 2.7.5 (default, Aug  2 2016, 04:20:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]

Red Hat Enterprise Linux Server release 7.2 (Maipo)
yum-rhn-plugin-2.0.1-5.el7.noarch

Seems to register anyway ...

Responses

We have the same issue. ansible fails but the machine is actually registered to satellite after the failed run

this is the faulty one https://raw.githubusercontent.com/ansible/ansible-modules-core/devel/packaging/os/rhn_register.py

this is the working one https://raw.githubusercontent.com/ansible/ansible/devel/lib/ansible/modules/packaging/os/rhn_register.py

but the second one is not yet part of the ansible package (2.3.1.0-1.el7) that is currently in EPEL.

the first one always uses the username and password field even when using activation key. and since the username and password are not mandatory when using activationkey they stay set to None, which causes the error.

creating a workaround now untill the core module has been updated with the working version

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.