-
-
Notifications
You must be signed in to change notification settings - Fork 164
Add podman system info module #922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add podman system info module #922
Conversation
e40c22c to
22d8381
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have come into (rare) situations where I needed to configure cgroups to use v2 or network backend. This can help my playbook to decide whether or not to do those extra steps.
|
Awesome! Thanks for this addition. |
johnsonlien
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added workflow
3296a37 to
47f94ea
Compare
|
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
return json object and add example for printing value Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
1636a59 to
1c857fe
Compare
Signed-off-by: johnsonlien <[email protected]>
be7f23e to
b576ca5
Compare
| register: podman_info | ||
| - name: Printing Podman System info | ||
| debug: | ||
| msg: "{{ podman_info['podman_system_info'] }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no ending double quote
| msg: "{{ podman_info['podman_system_info'] }} | |
| msg: "{{ podman_info['podman_system_info'] }}" |
| GoVersion: go1.16.6 | ||
| OsArch: linux/amd64 | ||
| Version: 4.0.0 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
| } |
| author: | ||
| - Johnson Lien (@johnsonlien) | ||
| short_description: Get podman system information from host machine | ||
| description: Runs "podman system info --format json" on host machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should document arguments here, like executable
| def main(): | ||
| module = AnsibleModule( | ||
| argument_spec=dict( | ||
| executable=dict(type='str', default='podman'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add it in doc above.
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
For quadlets you can set sdnotify (which maps to Notify=) to healthy to use a healthcheck to determine when the container is up. Signed-off-by: Ewoud Kohl van Wijngaarden <[email protected]> Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
return json object and add example for printing value Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
…ners#920) Fixes: containers#807 Signed-off-by: Evgeni Golov <[email protected]> Signed-off-by: johnsonlien <[email protected]>
Fix containers#917 Signed-off-by: Sagi Shnaidman <[email protected]> Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: Sagi Shnaidman <[email protected]> Signed-off-by: johnsonlien <[email protected]>
Signed-off-by: johnsonlien <[email protected]>
sshnaidm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix remaining issues and should be fine
| import json | ||
|
|
||
| from ansible.module_utils.basic import AnsibleModule | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| module.log(msg="Unable to get podman system info: %s" % err) | ||
| return json.dumps([]) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ) | ||
|
|
||
| module.exit_json(**results) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| conmon: | ||
| package: conmon-2.0.29-2.fc34.x86_64 | ||
| path: /usr/bin/conmon | ||
| version: 'conmon version 2.0.29, commit: ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| version: 'conmon version 2.0.29, commit: ' | |
| version: 'conmon version 2.0.29, commit ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this breaks yaml
| package: conmon-2.0.29-2.fc34.x86_64 | ||
| path: /usr/bin/conmon | ||
| version: 'conmon version 2.0.29, commit: ' | ||
| cpu_utilization: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| cpu_utilization: | |
| cpu_utilization: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this breaks yaml, wrong indent
|
pep8 errors, included in suggestions: |
|
@johnsonlien would you like to fix these last linter errors? |
2dd7cfe to
93fa2d1
Compare
Signed-off-by: Sagi Shnaidman <[email protected]>
93fa2d1 to
9aa5d9c
Compare
This adds the
podman_system_infomodule. There are niche use cases in offline environments to set up machines running Podman.Closes #921