rgibert.single_binary_service

Single Binary Service

Ansible Role Molecule Test Status Ansible Quality Score Ansible Role

Description

This Ansible role installs a single binary as a systemd service.

Requirements

  • Works on RHEL-based or Debian-based operating systems.

Role Variables

Variable Description
single_binary_service_checksum Checksum for the download file
single_binary_service_dl_url URL for downloading the binary
single_binary_service_exec_files Files to make executable (relative to the shared installation path)
single_binary_service_group Main group for the service user
single_binary_service_name Name of the service
single_binary_service_share_path Path where the binary will be installed
single_binary_service_start_cmd Command to start the service
single_binary_service_stop_cmd Command to stop the service
single_binary_service_user User account under which the service runs

Dependencies

  • None

Example Playbook

- hosts: servers
  roles:
    - role: rgibert.single_binary_service
      prometheus_node_exporter_base_url: "https://github.com/prometheus/node_exporter/releases/download"
      prometheus_node_exporter_dl_url: "{{ prometheus_node_exporter_base_url }}/v{{ single_binary_service_version }}/node_exporter-{{ single_binary_service_version }}.linux-{{ prometheus_node_exporter_arch }}.tar.gz"
      single_binary_service_checksum: "sha256:{{ prometheus_node_exporter_base_url }}/v{{ single_binary_service_version }}/sha256sums.txt"
      single_binary_service_dl_url: "{{ prometheus_node_exporter_base_url }}/v{{ single_binary_service_version }}/node_exporter-{{ single_binary_service_version }}.linux-{{ prometheus_node_exporter_arch }}.tar.gz"
      single_binary_service_group: prometheus
      single_binary_service_is_archive: true
      single_binary_service_name: prometheus_node_exporter
      single_binary_service_start_cmd: "/usr/local/share/prometheus_node_exporter-{{ single_binary_service_version }}/node_exporter-{{ single_binary_service_version }}.linux-{{ prometheus_node_exporter_arch }}/node_exporter"
      single_binary_service_stop_cmd: "/usr/bin/ps auwwx | grep /usr/local/share/prometheus_node_exporter-{{ single_binary_service_version }}/node_exporter-{{ single_binary_service_version }}.linux-{{ prometheus_node_exporter_arch }}/node_exporter | grep -v grep | awk '{print $2}' | xargs kill -9"
      single_binary_service_user: prometheus
      single_binary_service_version: 0.18.1
      prometheus_node_exporter_arch: amd64

License

GPLv3

Author Information

Richard Gibert
[email protected]
https://richard.gibert.ca/

Informazioni sul progetto

Sets up a single binary as a systemd service

Installa
ansible-galaxy install rgibert.single_binary_service
Licenza
gpl-3.0
Download
355
Proprietario
SRE @getsentry