Role to manage linux services.
- Ubuntu (tested)
- Arch Linux (tested)
- Redhat (tested)
- Other Linux distributions should work just fine
Available variables are listed below:
## Dict of services to manage based on OS
services_list:
all:
- name: name of service (string)
state: state of service, choices are 'stopped', 'started', 'reloaded', 'restarted' (string)
enabled: whether the service should start on boot (bool)
# same as above
debian: []
archlinux: []
redhat: []
None
Here is an example playbook:
- hosts: all
vars:
services_list:
all:
- name: haproxy
state: started
enabled: true
- name: keepalived
state: restarted
debian:
- name: apache2
state: stopped
enabled: false
archlinux:
- name: httpd
state: stopped
enabled: false
redhat:
- name: httpd
state: stopped
enabled: false
roles:
- budimanjojo.services
MIT License