https://github.com/thystips/ansible-role-php_fpm_exporter
https://github.com/thystips/ansible-role-php_fpm_exporter
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thystips/ansible-role-php_fpm_exporter
- Owner: thystips
- License: mit
- Created: 2024-06-14T10:14:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-14T12:26:50.000Z (about 2 years ago)
- Last Synced: 2025-09-14T05:28:55.012Z (10 months ago)
- Language: Jinja
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# thystips.php_fpm_exporter
[](https://github.com/thystips)
[](https://github.com/thystips/ansible-role-php_fpm_exporter/blob/main/LICENSE)
[](https://github.com/thystips/ansible-role-php_fpm_exporter/releases)
[](https://github.com/thystips/ansible-role-php_fpm_exporter/actions?query=workflow%3A%22Ansible+Molecule%22)
[](https://galaxy.ansible.com/thystips/php_fpm_exporter)[](https://github.com/ansible/ansible)
⭐ Star us on GitHub — it motivates us a lot!
Install php-fpm prometheus exporter
**Platforms Supported**:
| Platform | Versions |
|----------|----------|
| EL | all |
| Amazon | all |
| Debian | all |
| Ubuntu | all |
## ⚠️ Requirements
Ansible >= 2.1.
### Ansible role dependencies
None.
## ⚡ Installation
### Install with Ansible Galaxy
```shell
ansible-galaxy install thystips.php_fpm_exporter
```
### Install with git
If you do not want a global installation, clone it into your `roles_path`.
```bash
git clone https://github.com/thystips/ansible-role-php_fpm_exporter thystips.php_fpm_exporter
```
But I often add it as a submodule in a given `playbook_dir` repository.
```bash
git submodule add https://github.com/thystips/ansible-role-php_fpm_exporter roles/thystips.php_fpm_exporter
```
As the role is not managed by Ansible Galaxy, you do not have to specify the
github user account.
### ✏️ Example Playbook
Basic usage is:
```yaml
- hosts: all
roles:
- role: thystips.php_fpm_exporter
vars:
php_fpm_additional_args: []
php_fpm_exporter_after_services: network-online.target
php_fpm_exporter_default_template: default/php-fpm_exporter.j2
php_fpm_exporter_download_url: https://github.com/{{ php_fpm_exporter_github_repo
}}/releases/download/v{{ php_fpm_exporter_version }}/php-fpm_exporter_{{ php_fpm_exporter_version
}}_linux_{{ __architecture }}
php_fpm_exporter_force_reinstall: false
php_fpm_exporter_install_dir: /usr/local/bin
php_fpm_exporter_service_template: systemd/php-fpm_exporter.service.j2
php_fpm_exporter_start_service_at_role_end: true
php_fpm_exporter_system_group: '{{ php_fpm_exporter_system_user }}'
php_fpm_exporter_system_user: php-fpm-exporter
php_fpm_exporter_test_service: true
php_fpm_exporter_version: latest
php_fpm_fix_process_count: false
php_fpm_log_level: warn
php_fpm_scrape_uri: unix:///run/php-fpm.sock;/status
php_fpm_web_listen_address: 127.0.0.1:9253
php_fpm_web_telemetry_path: /metrics
```
## ⚙️ Role Variables
Variables are divided in three types.
The **default vars** section shows you which variables you may
override in your ansible inventory. As a matter of fact, all variables should
be defined there for explicitness, ease of documentation as well as overall
role manageability.
The **context variables** are shown in section below hint you
on how runtime context may affects role execution.
### Default variables
Role default variables from `defaults/main.yml`.
| Variable Name | Value |
|---------------|-------|
| php_fpm_exporter_force_reinstall | False |
| php_fpm_exporter_start_service_at_role_end | True |
| php_fpm_exporter_test_service | True |
| php_fpm_exporter_version | latest |
| php_fpm_exporter_install_dir | /usr/local/bin |
| php_fpm_exporter_system_user | php-fpm-exporter |
| php_fpm_exporter_system_group | {{ php_fpm_exporter_system_user }} |
| php_fpm_log_level | warn |
| php_fpm_web_listen_address | 127.0.0.1:9253 |
| php_fpm_web_telemetry_path | /metrics |
| php_fpm_scrape_uri | unix:///run/php-fpm.sock;/status |
| php_fpm_fix_process_count | False |
| php_fpm_additional_args | []
|
| php_fpm_exporter_after_services | network-online.target |
| php_fpm_exporter_download_url | https://github.com/{{ php_fpm_exporter_github_repo }}/releases/download/v{{ php_fpm_exporter_version }}/php-fpm_exporter_{{ php_fpm_exporter_version }}_linux_{{ __architecture }} |
| php_fpm_exporter_default_template | default/php-fpm_exporter.j2 |
| php_fpm_exporter_service_template | systemd/php-fpm_exporter.service.j2 |
### Context variables
Those variables from `vars/*.{yml,json}` are loaded dynamically during task
runtime using the `include_vars` module.
Variables loaded from `vars/main.yml`.
| Variable Name | Value |
|---------------|-------|
| php_fpm_exporter_github_repo | hipages/php-fpm_exporter |
| php_fpm_exporter_binary | php-fpm_exporter |
| go_arch_map | aarch64: arm64
x86_64: amd64
|
| __architecture | {{ go_arch_map[ansible_architecture] \| default('amd64') }} |
| systemd_lib_directory | /etc/systemd/system |
| systemd_default_directory | /etc/default |
## Author Information
ThysTips