No description
Find a file
2025-10-30 23:34:12 +01:00
defaults fixe some typos and bugs 2025-10-17 01:11:26 +02:00
meta init 2025-10-12 15:10:36 +02:00
tasks fix check mode 2025-10-30 23:34:12 +01:00
.gitignore init 2025-10-12 15:10:36 +02:00
LICENSE init 2025-10-12 15:10:36 +02:00
README.md add domain check skip 2025-10-28 23:35:53 +01:00

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

  1. Ensure that Ansible is installed on your system. The recommended version is at least 2.17.
  2. Clone this repository or add the role to your existing project.
  3. Ensure that the following dependencies are available:
    • Python with the requests library (for API calls)
    • Access to the Uptime phare API

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. Use skip to 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:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. 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.