| defaults | ||
| meta | ||
| tasks | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
phare_control Role
This role manages monitoring tasks for Uptime phare by authenticating, pausing, and resuming specified monitors via the Uptime phare API.
Description
The phare_control role provides a streamlined way to interact with Uptime phare's API. It handles authentication, pauses monitoring for specified monitors, and resumes monitoring after verifying their availability. The role is modular, allowing you to include specific tasks (pause or resume) based on your requirements.
Installation
- Ensure that Ansible is installed on your system. The recommended version is at least
2.17. - Clone this repository or add the role to your existing project.
- Ensure that the following dependencies are available:
- Python with the
requestslibrary (for API calls) - Access to the Uptime phare API
- Python with the
Variables
The role uses the following variables:
-
phare_control_base_url: The base URL of the Uptime phare API. Example:https://api.phare.io. -
phare_control_domain: Domain that is checked for accessibility before activation. Useskipto bypass the check -
phare_control_token: The token for the phare API. -
phare_control_monitor: A comma-separated string or list of monitor IDs to manage. Example:[1, 2, 3].
Usage
Example Playbook
- name: Manage Uptime phare Monitors
hosts: all
vars:
phare_control_domain: example.com
phare_control_token: "token"
phare_control_monitors: [1,2,3]
tasks:
- name: Pause phare monitoring
ansible.builtin.include_role:
name: phare_control
tasks_from: pause
- name: Resume phare monitoring
ansible.builtin.include_role:
name: phare_control
tasks_from: resume
Features
- Pause Monitoring: Pauses monitoring for the specified monitors.
- Resume Monitoring: Resumes monitoring after verifying the availability of the target URLs.
- Retry Mechanisms: Retries API calls to handle transient failures.
- Modular Design: Dynamically includes tasks.
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request describing your changes.
License
This project is licensed under the AGPL License. The AGPL license requires that modifications to the software be disclosed when distributed or made available over a network. For more information, see the LICENSE file.