Ansible and rhn_register

I am trying my first ansible playbook and I want to register to red hat and do a
yum update and then unregister using the rhn_register modules

The first 2 tasks are working but the last task to unregister fails:

Go it to work!!!

The register portion was working and the register portion was giving errors.
then all of a sudden the register part started to failed with error line:9 of rhnplugin.conf

Some how my /etc/yum/pluginconf.d/rhnplugin.conf had syntax error but other
linux rhel server did not have the same problem.

I have never edited this file until today.

After fixing the syntax error it worked!!!

Thanks,

Hi,

did you check for the error message from the failed task? This looks like an error message from you satellite server you were trying to unregister from and not like an ansible error.

Register, update, unregister sounds like you are trying to save licenses for your servers and the error sounds like the satellite server knows about this :wink:

That is the idea, I have 2 licenses but I only keep my live server register at all time. I have a backup and desktop server. YEs, I want to register and unregister the backup and the desktop just to get the latest updates but the desktop is my test/play desktop server

I was trying that on only on desktop server server and it was failing because of the conf having an error…

It keep giving me the error messages that I put in the first message, and then I did it a 5th time and it said that I had a syntax error in the conf file but the difference is that I thing the last time I ran it, I did it with ‘-vvvv’

Thanks,