Skip to content

Commit e40c22c

Browse files
authored
Update podman_system_info.py
return json object and add example for printing value
1 parent 9b318be commit e40c22c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins/modules/podman_system_info.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
- name: Get Podman system information into a variable
2121
containers.podman.podman_system_info:
2222
register: podman_info
23+
- name: Printing Podman System info
24+
debug:
25+
msg: "{{ podman_info['podman_system_info'] }}
2326
'''
2427

2528
RETURN = r'''
@@ -187,7 +190,7 @@ def get_podman_system_info(module, executable):
187190
rc, out, err = module.run_command(command)
188191
out = out.strip()
189192
if out:
190-
return out
193+
return json.loads(out)
191194

192195
module.log(msg="Unable to get podman system info: %s" % err)
193196
return json.dumps([])
@@ -196,14 +199,11 @@ def main():
196199
module = AnsibleModule(
197200
argument_spec=dict(
198201
executable=dict(type='str', default='podman'),
199-
name=dict(type='list', elements='str')
200202
),
201203
supports_check_mode=True,
202204
)
203205

204-
executable = module.params['executable']
205-
name = module.params.get('name')
206-
executable = module.get_bin_path(executable, required=True)
206+
executable = module.get_bin_path(module.params['executable'], required=True)
207207

208208
results = get_podman_system_info(module, executable)
209209

0 commit comments

Comments
 (0)