Hey all,
How's it going?
So I'm trying to create a playbook that will add rhn-channels to servers
based on both Server/Workstation.
Here's my pb:
---
- name: Register RHN Channel
hosts: GONG
become: yes
vars_files:
- passwd.yml
- vars.yml
vars:
ansible: "{{ ansible_distribution }}"
tasks:
- name: Workstation or Server?
shell: cat /etc/redhat-release | awk '{print $5}'
register: rh_type
tags: name
- name: "Check if {{ ansible_hostname }} is already registered and
given server"
rhn_channel:
name: rhel-x86_64-server-optional-7
sysname: ansible_hostname
user: rh_user
password: rh_pass
url: http://server.name.com/XMLRPC
when: rh_type.stdout == 'Server'
- name: "Check if {{ ansible_hostname }} is already registered and
given workstation"
rhn_channel:
name: rhel-x86_64-workstation-optional-7
sysname: ansible_hostname
user: rh_user
password: rh_pass
url: http://server.name.com/XMLRPC
when: rh_type.stdout == 'Workstation'
- debug:
var: ansible_hostname
tags: name
Erroring out with this:
fatal: [dev-gong-proc1-lx]: FAILED! => {"changed": false, "module_stderr":
"Shared connection to dev-gong-proc1-lx closed.\r\n", "module_stdout":
"\r\nTraceback (most recent call last):\r\n File
\"/home/tsg/.ansible/tmp/ansible-tmp-1545238985.06-63865196201679/AnsiballZ_rhn_channel.py\",
line 113, in <module>\r\n _ansiballz_main()\r\n File
\"/home/tsg/.ansible/tmp/ansible-tmp-1545238985.06-63865196201679/AnsiballZ_rhn_channel.py\",
line 105, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path,
ANSIBALLZ_PARAMS)\r\n File
\"/home/tsg/.ansible/tmp/ansible-tmp-1545238985.06-63865196201679/AnsiballZ_rhn_channel.py\",
line 48, in invoke_module\r\n imp.load_module('__main__', mod, module,
MOD_DESC)\r\n File
\"/tmp/ansible_rhn_channel_payload_3Kfo9x/__main__.py\", line 145, in
<module>\r\n File \"/tmp/ansible_rhn_channel_payload_3Kfo9x/__main__.py\",
line 118, in main\r\n File \"/usr/lib64/python2.7/xmlrpclib.py\", line
1233, in __call__\r\n return self.__send(self.__name, args)\r\n File
\"/usr/lib64/python2.7/xmlrpclib.py\", line 1591, in __request\r\n
verbose=self.__verbose\r\n File \"/usr/lib64/python2.7/xmlrpclib.py\",
line 1273, in request\r\n return self.single_request(host, handler,
request_body, verbose)\r\n File \"/usr/lib64/python2.7/xmlrpclib.py\",
line 1306, in single_request\r\n return
self.parse_response(response)\r\n File
\"/usr/lib64/python2.7/xmlrpclib.py\", line 1482, in parse_response\r\n
return u.close()\r\n File \"/usr/lib64/python2.7/xmlrpclib.py\", line 794,
in close\r\n raise Fault(**self._stack[0])\r\nxmlrpclib.Fault: <Fault
-1: \"While running 'auth.login': caught\\n<class
'spacewalk.server.apacheRequest.UnknownXML'> : Invalid request received
(class xmlrpc.auth is not defined (function = login)).\\n\">\r\n", "msg":
"MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
I'm pretty sure it's got something to do with the: url:
http://server.name.com/XMLRPC piece. How do I know what that URL is really
supposed to be?
Thanks!
Chris
--
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/CAHKi8CgxsEdAmvhfZujVJSR2Y9Wxw_xVa63Sxao9DW3MBnzkqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.