55# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
66
77from __future__ import absolute_import , division , print_function
8+
89__metaclass__ = type
910
10- DOCUMENTATION = '''
11+ DOCUMENTATION = """
1112---
12- module: cs_configuration_info
13+ module: configuration_info
1314short_description: Gathering information about configurations from Apache CloudStack based clouds.
1415description:
1516 - Gathering information from the API about configurations.
1617author: Francisco Arencibia (@arencibiafrancisco)
17- version_added: 0.1 .0
18+ version_added: 3.0 .0
1819options:
1920 name:
2021 description:
2324 type: str
2425extends_documentation_fragment:
2526- ngine_io.cloudstack.cloudstack
26- '''
27+ """
2728
28- EXAMPLES = '''
29+ EXAMPLES = """
2930- name: Gather information about a specific configuration
30- ngine_io.cloudstack.cs_configuration_info :
31+ ngine_io.cloudstack.configuration_info :
3132 name: consoleproxy.sslEnabled
3233 register: config
3334
3637 msg: "{{ config }}"
3738
3839- name: Gather information about all configurations
39- ngine_io.cloudstack.cs_configuration_info :
40+ ngine_io.cloudstack.configuration_info :
4041 register: configs
4142
4243- name: Show information on all configurations
4344 debug:
4445 msg: "{{ configs }}"
45- '''
46+ """
4647
47- RETURN = '''
48+ RETURN = """
4849---
4950configurations:
5051 description: A list of matching configurations.
6667 returned: success
6768 type: str
6869 sample: "Enable SSL for console proxy"
69- '''
70+ """
7071
7172from ansible .module_utils .basic import AnsibleModule
72- from ansible_collections .ngine_io .cloudstack .plugins .module_utils .cloudstack import (
73- AnsibleCloudStack ,
74- cs_argument_spec ,
75- )
73+ from ansible_collections .ngine_io .cloudstack .plugins .module_utils .cloudstack import AnsibleCloudStack , cs_argument_spec
7674
7775
7876class AnsibleCloudStackConfigurationInfo (AnsibleCloudStack ):
7977
8078 def __init__ (self , module ):
8179 super (AnsibleCloudStackConfigurationInfo , self ).__init__ (module )
8280 self .returns = {
83- ' name' : ' name' ,
84- ' value' : ' value' ,
85- ' description' : ' description' ,
81+ " name" : " name" ,
82+ " value" : " value" ,
83+ " description" : " description" ,
8684 }
8785
8886 def get_configuration (self ):
8987 args = {}
90- if self .module .params [' name' ]:
91- args [' name' ] = self .module .params [' name' ]
92- configurations = self .query_api (' listConfigurations' , ** args )
93- if configurations and ' configuration' in configurations :
94- configurations = configurations [' configuration' ]
88+ if self .module .params [" name" ]:
89+ args [" name" ] = self .module .params [" name" ]
90+ configurations = self .query_api (" listConfigurations" , ** args )
91+ if configurations and " configuration" in configurations :
92+ configurations = configurations [" configuration" ]
9593 else :
9694 configurations = []
9795 else :
98- configurations = self .query_api (' listConfigurations' )
99- if configurations and ' configuration' in configurations :
100- configurations = configurations [' configuration' ]
96+ configurations = self .query_api (" listConfigurations" )
97+ if configurations and " configuration" in configurations :
98+ configurations = configurations [" configuration" ]
10199 else :
102100 configurations = []
103101
104- return {
105- 'configurations' : [self .update_result (config ) for config in configurations ]
106- }
102+ return {"configurations" : [self .update_result (config ) for config in configurations ]}
107103
108104
109105def main ():
110106 argument_spec = cs_argument_spec ()
111- argument_spec .update (dict (
112- name = dict (type = 'str' ),
113- ))
107+ argument_spec .update (
108+ dict (
109+ name = dict (type = "str" ),
110+ )
111+ )
114112
115113 module = AnsibleModule (
116114 argument_spec = argument_spec ,
@@ -122,5 +120,5 @@ def main():
122120 module .exit_json (** result )
123121
124122
125- if __name__ == ' __main__' :
123+ if __name__ == " __main__" :
126124 main ()
0 commit comments