Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

service: allow user to query service status #3316

Closed
wants to merge 1 commit into from
Closed

service: allow user to query service status #3316

wants to merge 1 commit into from

Conversation

ritzk
Copy link
Contributor

@ritzk ritzk commented Mar 24, 2016

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

system/service.py

ANSIBLE VERSION
ansible 2.0.1.0
SUMMARY

Add the ability to query for service status

Before 
$ ansible -i "127.0.0.1," all -m service -a"name=atd state=status"
127.0.0.1 | FAILED! => {
    "changed": false, 
    "failed": true, 
    "msg": "value of state must be one of: running,started,stopped,restarted,reloaded, got: status"


After
$ ansible -i "127.0.0.1," all -m service -a"name=atd state=status"
127.0.0.1 | SUCCESS => {
    "changed": false, 
    "state": true
}

Based of request from : https://www.reddit.com/r/ansible/comments/4bpvry/service_module_to_return_the_status_of_a_service/

@resmo
Copy link
Contributor

resmo commented Mar 26, 2016

IMHO status would rather go into a facts module, status is not a state.

@ritzk
Copy link
Contributor Author

ritzk commented Mar 26, 2016

@resmo, does not make any sense to me, as the service module already has this implemented ( with get_service_status )

class Service(object):
    """
    This is the generic Service manipulation class that is subclassed
    based on platform.

    A subclass should override the following action methods:-
      - get_service_tools
      - service_enable
      - get_service_status
      - service_control

We could always return "running: true" over "state". This allows us to query only for a particular service status.

Are we looking to query for all the service status, if this is pushed into facts ( which could be slower) ?

@resmo
Copy link
Contributor

resmo commented Mar 27, 2016

Thanks @ritzk for this PR. This module is maintained by the Ansible core team, so it can take a while for patches to be reviewed. Thanks for your patience.

@freeseacher
Copy link

@resmo any news?

@resmo
Copy link
Contributor

resmo commented Aug 30, 2016

@freeseacher thanks for the ping, coming back to it shortly

@ansibot
Copy link

ansibot commented Dec 7, 2016

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

@rdmarsh
Copy link

rdmarsh commented Jan 24, 2017

Any chance this will be merged soon?

@ansibot
Copy link

ansibot commented Apr 11, 2017

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

@ansibot ansibot closed this Apr 11, 2017
@cornfeedhobo
Copy link

@ritzk did you move this to ansible/ansible yet?

@o-lenczyk
Copy link

will it be merged?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants