|
|
@ -1,7 +1,8 @@
|
|
|
|
#!/usr/bin/python -tt
|
|
|
|
#!/usr/bin/python -tt
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
|
|
# Written by Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
|
|
# Copyright 2015 Cristian van Ee <cristian at cvee.org>
|
|
|
|
|
|
|
|
# Copyright 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# This file is part of Ansible
|
|
|
|
# This file is part of Ansible
|
|
|
|
#
|
|
|
|
#
|
|
|
@ -89,8 +90,12 @@ options:
|
|
|
|
|
|
|
|
|
|
|
|
notes: []
|
|
|
|
notes: []
|
|
|
|
# informational: requirements for nodes
|
|
|
|
# informational: requirements for nodes
|
|
|
|
requirements: [ dnf ]
|
|
|
|
requirements:
|
|
|
|
author: '"Igor Gnatenko" <i.gnatenko.brain@gmail.com>'
|
|
|
|
- "python >= 2.6"
|
|
|
|
|
|
|
|
- dnf
|
|
|
|
|
|
|
|
author:
|
|
|
|
|
|
|
|
- '"Igor Gnatenko (@ignatenkobrain) " <i.gnatenko.brain@gmail.com>'
|
|
|
|
|
|
|
|
- '"Cristian van Ee (@DJMuggs)" <cristian at cvee.org>'
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
EXAMPLES = '''
|
|
|
@ -147,8 +152,8 @@ def pkg_to_dict(pkg):
|
|
|
|
'release': pkg.release,
|
|
|
|
'release': pkg.release,
|
|
|
|
'version': pkg.version,
|
|
|
|
'version': pkg.version,
|
|
|
|
'repo': pkg.repoid,
|
|
|
|
'repo': pkg.repoid,
|
|
|
|
'nevra': str(pkg)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
d['nevra'] = '{epoch}:{name}-{version}-{release}.{arch}'.format(**d)
|
|
|
|
|
|
|
|
|
|
|
|
if pkg.installed:
|
|
|
|
if pkg.installed:
|
|
|
|
d['dnfstate'] = 'installed'
|
|
|
|
d['dnfstate'] = 'installed'
|
|
|
@ -268,5 +273,6 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
# import module snippets
|
|
|
|
# import module snippets
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
main()
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
main()
|
|
|
|
|
|
|
|
|
|
|
|