oops .. I missed.
Now I have corrected like below ... still bad luck with me ... . Also If I
executed these commands directly into clients servers and its working.
- name: Subscribing a new channel
shell: sh -c "sudo yum clean all"
- shell: sh -c "sudo rhnreg_ks --activationkey 1-vblock20161026"
- shell: sh -c "sudo rhnreg_ks --activationkey 1-vblock20161026 --force"
PLAY [patch]
*******************************************************************
TASK [I am rebooting servers!! You go and have some coffe!]
********************
changed: [ccltstftsmrk1]
[WARNING]: Consider using 'become', 'become_method', and 'become_user'
rather than running sudo
TASK [I am waiting for server to come back!]
***********************************
ok: [ccltstftsmrk1 -> localhost]
TASK [Subscribing a new channel]
***********************************************
changed: [ccltstftsmrk1]
TASK [command]
*****************************************************************
fatal: [ccltstftsmrk1]: FAILED! => {"changed": true, "cmd": "sh -c \"sudo
rhnreg_ks --activationkey 1-vblock20161026\"", "delta": "0:00:00.270108",
"end": "2016-11-18 14:06:44.477886", "failed": true, "rc": 255, "start":
"2016-11-18 14:06:44.207778", "stderr": "", "stdout": "This system is
already registered. Use --force to override", "stdout_lines": ["This system
is already registered. Use --force to override"], "warnings": []}
NO MORE HOSTS LEFT
*************************************************************
[WARNING]: Could not create retry file 'patch.retry'. [Errno 2] No
such file or directory: ''
PLAY RECAP
*********************************************************************
ccltstftsmrk1 : ok=3 changed=2 unreachable=0 failed=1
On Friday, November 18, 2016 at 8:55:25 PM UTC+5:30, Kai Stian Olstad wrote:
>
> On 18. nov. 2016 16:16, [email protected] <javascript:> wrote:
> > Added like below , still am getting error :(
>
> Have you read the error message?
>
>
> > - name: Subscribing a new channel
> > shell: sh -c "rhnreg_ks --activationkey 1-vblock20161026"
> >
> > - name: Subscribing a new channel forcefully
> > shell: sh -c "rhnreg_ks --activationkey 1-vblock20161026 --force"
> >
> > TASK [I am waiting for server to come back!]
> > ***********************************
> > ok: [ccltstftsmrk1 -> localhost]
> >
> > TASK [Subscribing a new channel]
> > ***********************************************
> > fatal: [ccltstftsmrk1]: FAILED! => {"changed": true, "cmd": "sh -c
> > \"rhnreg_ks --activationkey 1-vblock20161026\"", "delta":
> "0:00:00.272494",
> > "end": "2016-11-18 10:13:52.624698", "failed": true, "rc": 1, "start":
> > "2016-11-18 10:13:52.352204", "stderr": "", "stdout": "You must be root
> to
> > run /usr/sbin/rhnreg_ks", "stdout_lines": ["You must be root to run
> > /usr/sbin/rhnreg_ks"], "warnings": []}
>
> The error message say "You must be root to run /usr/sbin/rhnreg_ks"
>
> --
> Kai Stian Olstad
>
--
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/3460ef8f-85e5-4ad3-85a6-611bf683b824%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.