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/4f2f396c-e12b-458c-8c5c-d8d377cf16f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to