Debian Codegraph @

ansible_collections/theforeman/foreman/plugins/modules/flatpak_remote.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
25 version_added: 5.5.0
26 short_description: Manage Flatpak Remotes
27 description:
28 - Manage Flatpak Remotes
29 author:
30 - "Evgeni Golov (@evgeni)"
31 options:
32 description:
33 description:
34 - Description of the flatpak remote
35 required: false
36 type: str
37 name:
38 description:
39 - name
40 required: true
41 type: str
42 token:
43 description:
44 - Token/password for the flatpak remote
45 required: false
46 type: str
47 url:
48 description:
49 - 'Base URL of the flatpak registry index, like C(https://flatpaks.redhat.io/rhel/), C(https://registry.fedoraproject.org).'
50 required: false
51 type: str
52 remote_username:
53 description:
54 - Username for the flatpak remote
55 required: false
56 type: str
57
58 extends_documentation_fragment:
59 - theforeman.foreman.foreman
60 - theforeman.foreman.foreman.entity_state
61 - theforeman.foreman.foreman.organization
62 '''
63
64 EXAMPLES = '''
65 - name: Create Fedora flatpak remote
66 theforeman.foreman.flatpak_remote:
67 name: "fedora"
68 url: "registry.fedoraproject.org"
69 organization: "Default Organization"
70 username: "admin"
71 password: "changeme"
72 server_url: "https://foreman.example.com"
73 '''
74
75 RETURN = '''
76 entity:
77 description: Final state of the affected entities grouped by their type.
78 returned: success
79 type: dict
80 contains:
81 flatpak_remotes:
82 description: List of flatpak_remotes.
83 type: list
84 elements: dict
85 '''
86
87 from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import KatelloEntityAnsibleModule
88
89
90 class ForemanFlatpakRemoteModule(KatelloEntityAnsibleModule):
91 pass
92
93
94 def main():
95 module = ForemanFlatpakRemoteModule(
96 foreman_spec=dict(
97 name=dict(required=True),
98 url=dict(),
99 description=dict(),
100 remote_username=dict(flat_name="username"),
101 token=dict(no_log=True),
102 ),
103 )
104
105 with module.api_connection():
106 module.run()
107
108
109 if __name__ == '__main__':
110 main()