community.general.homebrew_services module – Services manager for Homebrew
Note
This module is part of the community.general collection (version 9.5.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.homebrew_services
.
New in community.general 9.3.0
Synopsis
Manages daemons and services via Homebrew.
Requirements
The below requirements are needed on the host that executes this module.
homebrew must already be installed on the target system
Parameters
Parameter |
Comments |
---|---|
An installed homebrew package whose service is to be updated. |
|
A Default: |
|
State of the package’s service. Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Install foo package
community.general.homebrew:
name: foo
state: present
- name: Start the foo service (equivalent to `brew services start foo`)
community.general.homebrew_services:
name: foo
state: present
- name: Restart the foo service (equivalent to `brew services restart foo`)
community.general.homebrew_services:
name: foo
state: restarted
- name: Remove the foo service (equivalent to `brew services stop foo`)
community.general.homebrew_services:
name: foo
service_state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
If the service is now running, this is the PID of the service, otherwise -1. Returned: success Sample: |
|
Whether the service is running after running this command. Returned: success Sample: |