syslog.syslog(syslog.LOG_NOTICE, 'Invoked with %s' % args)
params = module.params
usage = "The module expects arguments of the following forms: state=<installed|removed|latest> pkg=<pkgspec> OR list=<installed|updates|available|repos|pkgspec>. pkgspec is nothing but the package specification. Example: google-chrome-stable.i386"
if not len(items):
msg = "the yum module requires arguments (-a)"
return 1, msg
if not len(params):
module.fail_json(msg=usage)
# if nothing else changes - it fails
results = { 'changed':False,
'failed':True,
'results':'',
'errors':'',
'msg':args }
params = {}
for x in items:
try:
(k, v) = x.split("=", 1)
except ValueError:
msg = "invalid arguments: %s" % args
return 1, msg
params[k] = v
'msg':usage }
if 'conf_file' not in params:
params['conf_file'] = None
if 'list' in params:
try:
my = yum_base(conf_file=params['conf_file'], cachedir=True)