Debian Codegraph @

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

raw symbols SCIP
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # (c) 2018 Bernhard Suttner (ATIX AG)
4 # (c) 2019 Christoffer Reijer (Basalt AB)
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 from __future__ import absolute_import, division, print_function
20 __metaclass__ = type
21
22
23 DOCUMENTATION = '''
24 ---
25 module: puppet_environment
26 version_added: 1.0.0
27 short_description: Manage Puppet Environments
28 description:
29 - Create, update, and delete Puppet Environments
30 author:
31 - "Bernhard Suttner (@_sbernhard) ATIX AG"
32 - "Christoffer Reijer (@ephracis) Basalt AB"
33 options:
34 name:
35 description: The full environment name
36 required: true
37 type: str
38 extends_documentation_fragment:
39 - theforeman.foreman.foreman
40 - theforeman.foreman.foreman.entity_state
41 - theforeman.foreman.foreman.taxonomy
42 '''
43
44 EXAMPLES = '''
45 - name: create new environment
46 theforeman.foreman.puppet_environment:
47 name: "testing"
48 locations:
49 - "Munich"
50 organizations:
51 - "ACME"
52 server_url: "https://foreman.example.com"
53 username: "admin"
54 password: "changeme"
55 state: present
56 '''
57
58 RETURN = '''
59 entity:
60 description: Final state of the affected entities grouped by their type.
61 returned: success
62 type: dict
63 contains:
64 puppet_environments:
65 description: List of puppet environments.
66 type: list
67 elements: dict
68 '''
69
70 from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import (
71 ForemanTaxonomicEntityAnsibleModule,
72 )
73
74
75 class ForemanEnvironmentModule(ForemanTaxonomicEntityAnsibleModule):
76 pass
77
78
79 def main():
80 module = ForemanEnvironmentModule(
81 foreman_spec=dict(
82 name=dict(required=True),
83 ),
84 )
85
86 with module.api_connection():
87 module.run()
88
89
90 if __name__ == '__main__':
91 main()