Debian Codegraph @

ansible_collections/theforeman/foreman/plugins/modules/flatpak_remote_scan.py

raw symbols SCIP
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # (c) Evgeni Golov
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 from __future__ import absolute_import, division, print_function
19 __metaclass__ = type
20
21
22 DOCUMENTATION = '''
23 ---
24 module: flatpak_remote_scan
25 version_added: 5.5.0
26 short_description: Scan a Flatpak Remote
27 description:
28 - Scan a Flatpak Remote
29 author:
30 - "Evgeni Golov (@evgeni)"
31 options:
32 flatpak_remote:
33 description:
34 - Flatpak remote
35 required: true
36 type: str
37
38 extends_documentation_fragment:
39 - theforeman.foreman.foreman
40 - theforeman.foreman.foreman.organization
41 '''
42
43 EXAMPLES = '''
44 - name: "Scan flatpak remote"
45 theforeman.foreman.flatpak_remote_scan:
46 username: "admin"
47 password: "changeme"
48 server_url: "https://foreman.example.com"
49 organization: "Default Organization"
50 flatpak_remote: "rhel"
51 '''
52
53 RETURN = ''' # '''
54
55 from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import KatelloAnsibleModule
56
57
58 def main():
59 module = KatelloAnsibleModule(
60 foreman_spec=dict(
61 flatpak_remote=dict(type='entity', scope=['organization'], required=True),
62 ),
63 )
64
65 module.task_timeout = 12 * 60 * 60
66
67 with module.api_connection():
68 flatpak_remote = module.lookup_entity('flatpak_remote')
69
70 task = module.resource_action('flatpak_remotes', 'scan', {'id': flatpak_remote['id']})
71
72 module.exit_json(task=task)
73
74
75 if __name__ == '__main__':
76 main()