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,
On Tuesday, August 11, 2015 at 7:59:50 AM UTC-7, Néstor Flórez wrote:
>
> 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:
> ------------
>
> PLAY [linux]
> ******************************************************************
>
> GATHERING FACTS
> ***************************************************************
> <192.168.1.150> REMOTE_MODULE setup
> ok: [192.168.1.150]
>
> TASK: [RHN register]
> **********************************************************
> <192.168.1.150> REMOTE_MODULE rhn_register state=present username=rhnuser
> password=VALUE_HIDDEN
> ok: [192.168.1.150] => {"changed": false, "msg": "System already
> registered."}
>
> TASK: [yum update]
> ************************************************************
> <192.168.1.150> REMOTE_MODULE yum name=* state=latest
> ok: [192.168.1.150] => {"changed": false, "msg": "", "rc": 0, "results":
> ["All packages up to date"]}
>
> TASK: [RHN Unregister this server]
> ********************************************
> <192.168.1.150> REMOTE_MODULE rhn_register state=absent username=rhnuser
> password=VALUE_HIDDEN
> failed: [192.168.1.150] => {"failed": true}
> msg: Failed to unregister: <Fault 1003: 'The following systems were NOT
> deleted: \n1039724772'>
>
> FATAL: all hosts have already failed -- aborting
>
> PLAY RECAP
> ********************************************************************
> to retry, use: --limit @/home/myuser/yum_update.retry
>
> 192.168.1.150 : ok=3 changed=0 unreachable=0
> failed=1
>
> -----------------
>
>
> ---------- my playbook ------------
> # This playbook does a RHEL yum update on the linux systems
>
> - hosts: linux
> user: myuser
>
> tasks:
> # Register as user (joe_user) with password (somepass) and
> auto-subscribe to available content.
> - name: RHN register
> rhn_register: state=present username=rhnuser password=mypwd
>
> # Yum update
> - name: yum update
> yum: name=* state=latest
>
> # Unregister system
> - name: RHN Unregister this server
> rhn_register: state=absent username=rhnuser password=mypwd
> -------------
>
>
> Welcome any ideas - THANSK!!!
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/32db8494-6130-456a-b5d0-85bf1e4f5e0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.