community.general.launchd – Manage macOS services¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.launchd
.
New in version 1.0.0: of community.general
Requirements¶
The below requirements are needed on the host that executes this module.
A system managed by launchd
The plistlib python library
Parameters¶
Examples¶
- name: Make sure spotify webhelper is started
community.general.launchd:
name: com.spotify.webhelper
state: started
- name: Deploy custom memcached job definition
template:
src: org.memcached.plist.j2
dest: /Library/LaunchDaemons/org.memcached.plist
- name: Run memcached
community.general.launchd:
name: org.memcached
state: started
- name: Stop memcached
community.general.launchd:
name: org.memcached
state: stopped
- name: Stop memcached
community.general.launchd:
name: org.memcached
state: stopped
force_stop: yes
- name: Restart memcached
community.general.launchd:
name: org.memcached
state: restarted
- name: Unload memcached
community.general.launchd:
name: org.memcached
state: unloaded
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
status
dictionary
|
always |
Metadata about service status
Sample:
{'current_pid': '-', 'current_state': 'stopped', 'previous_pid': '82636', 'previous_state': 'running'}
|
Authors¶
Martin Migasiewicz (@martinm82)