-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Adding custom module to get PID of the process #50896
Conversation
@saranyasridharan this PR contains the following merge commits: Please rebase your branch to remove these commits. |
The test
The test
The test
|
@saranyasridharan This PR has a merge commit in it. Have you tried going through the rebasing instructions? If you need help with that, feel free to ask here or in IRC on Freenode in the #ansible-devel channel. |
@mattclay. I am trying this steps for rebasing
Is it right way ? |
new file: ../../../../lib/ansible/modules/system/pids.py new file: aliases new file: files/obtainpid.sh new file: tasks/main.yml
modified: main.yml
@AugustusKling @ColOfAbRiX @EvanK @LinusU @Mogztter @MorrisA @abulimov @adejoux @ahtik @azaghal @bgurney-rh @dankeder @davidobrien1985 @davixx @dirtyharrycallahan @dougluce @dsummersl @flynn1973 @gforster @giovannisciortino @goozbach @groks @haad @hryamzik @indrajitr @jasperla @jbenden @jdauphant @jhoekx @jsumners @jtyr @kairoaraujo @kevensen @lberruti @mattjeffery @matze @mcv21 @molekuul @mpdehaan @mulby @natefoo @nibalizer @obourdon @ovcharenko @pilou- @pmarkham @pyykkis @rhaido @risaacson @ryan_sb @saito-hideki @sebastiendarocha @sfromm @srvg @tacatac @tdtrask @tmshn @xen0l As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add |
@saranyasridharan Yes, it looks correct now. I'm seeing just your commits on the PR. |
@felixfontein I have recreated this PR for the same module. Can you please review it once ? |
@@ -0,0 +1,59 @@ | |||
# Test code for the pid module |
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.
# Test code for the pid module | |
# Test code for the pids module |
@@ -0,0 +1,59 @@ | |||
# Test code for the pid module | |||
# Copyright 2019, Saranya Sridharan |
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.
# Copyright 2019, Saranya Sridharan | |
# Copyright: (c) 2019, Saranya Sridharan |
lib/ansible/modules/system/pids.py
Outdated
DOCUMENTATION = ''' | ||
module: pids | ||
version_added: 2.8 | ||
description: "Retrieves a list of process IDs (PIDs) of all processes of the given name. Returns an empty list if no process of the given name exists." |
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.
It would be nice to add a note - From where this module will gather information about PIDs viz., Ansible Controller or Managed nodes or remote machines.
@Akasurde thanks for the review comments. I have addressed the changes. Please let me know if anything else it needed. |
Thanks @mattclay. if the PR is good to go, Can you please mark it as shipit ? |
@Akasurde . Can you please let me know if the addressed changes are as expected ? |
@saranyasridharan Thank you for contributing a new module with tests. |
Thanks @mattclay for the review comments and support provided throughout my learning and contribution. |
SUMMARY
This module will find the pid of the given process name either locally or in remote system, depending on the host parameter.
ISSUE TYPE
New Module Pull Request
COMPONENT NAME
pids
ANSIBLE VERSION
ansible 2.8.0.dev0 last updated 2018/08/07 12:03:58 (GMT +550)
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/ansible/newcode/library']
ansible python module location = /home/ansible/lib/ansible
executable location = /home/ansible/bin/ansible
python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
ADDITIONAL INFORMATION
I have used psutil module to find the process IDs(PIDs) of the given process