rhn module

Hi,

We are currently getting started with Ansible, and we really like it!

Since we use RHEL for a large part of our infra I did an attempt to
create an Ansible module that allows you to
add or remove software channels from a machine. I tried to keep the
dependencies to other Python mods to a
minimum and currently only use things from Python core.
I do however have some doubts and it would be nice if someone would
share his thoughts :slight_smile:

To test the module I used a hostname variable. It is of course not
meant to stay that way because that would
make the module rather useless...
My plan was to use the hostname var because we register our machines
in rhn with their hostname, but other
people might give it names other than the hostname. Any suggestions on this?

Currently I fetch the machine's id from rhn while I could get it from
/etc/sysconfig/rhn/systemid (I already made a function
for that in the module). The reason for this is that I've seen
machines where the local systemid differs from the systemid in rhn.
I would like to go for the local systemid since it makes things
easier... Suggestions?

Let me also tell you that I'm a newbie in Python, but I must say that
I really enjoy it and plan on extending this module.
It would maybe be nice to add rhn info about the machine to the machine's facts?

Module on Github :
https://github.com/vincentvdk/ansible_modules/tree/master/rhn

Thanks!
Vincent

I would tenatively call this "rhn_channel" but this looks super clean to me.

I would like to see the server name be an optional parameter so you
could use it with Satellite server.

Minor style note would be to use_underscores versus camelCase in functions.

If you want to fix those things up, I'd love to have a pull request for this!

Thanks!

--Michael

I would tenatively call this "rhn_channel" but this looks super clean to me.

rhn_channel does indeed make more sense. I'll change that. Thanks.

I would like to see the server name be an optional parameter so you
could use it with Satellite server.

Ok. fair enough

Minor style note would be to use_underscores versus camelCase in functions.

If you want to fix those things up, I'd love to have a pull request for this!

I'll make the changes and send a pull request in the next few days.
Thanks!

Thanks!

--Michael

Vincent