Ansible installation and server preparation
Use ansible/prepare-ipsonic-probe.yml to prepare an ipsonic-probe host running Debian, Ubuntu, Raspberry Pi OS, AlmaLinux or Rocky Linux.
Ansible runs only on the controller, not on the target host. The target needs SSH, privilege escalation, Python 3 for Ansible modules, and distribution-managed packages from its standard repositories or an approved local mirror. The playbook uses ansible.builtin modules and requires no pip installation on the target.
AWX / Automation Controller
See the complete AWX tutorial for Job Templates, credential injection, Ansible Vault, deployment and secure execution.
Run from the controller
cp ansible/inventory.ini.example ansible/inventory.ini
# Edit target hostname and SSH user in inventory.ini.
ansible-playbook -i ansible/inventory.ini ansible/prepare-ipsonic-probe.yml --ask-become-pass
The playbook installs python3, python3-requests, ca-certificates, and python3-yaml (Debian family) or python3-pyyaml (RPM family), copies ipsonic-probe and examples to /opt/ipsonic-probe, prepares /etc/ipsonic-probe, and validates imports and --help.
Check installation
ssh user@monitor.example '/usr/bin/python3 /opt/ipsonic-probe/ipsonic-probe.py --help'
Run an actual ipsonic-probe check with Ansible
After installation, deploy your application-specific YAML configuration to /etc/ipsonic-probe/api.yaml (for example, from an Ansible-managed template). The preparation playbook does not create this configuration automatically.
- name: Run ipsonic-probe checks
ansible.builtin.command:
argv:
- /usr/bin/python3
- /opt/ipsonic-probe/ipsonic-probe.py
- /etc/ipsonic-probe/api.yaml
environment:
HTTPTEST_API_TOKEN: "{{ vault_api_token }}"
register: ipsonic_probe_result
changed_when: false
no_log: true
Use Ansible Vault for vault_api_token, and omit the environment block entirely for checks that do not need secrets. no_log: true protects sensitive data but also suppresses ordinary check output; use a separate sanitized reporting step if needed. The CLI returns a nonzero status when checks fail, which makes this task fail in Ansible by default. See the YAML examples for check definitions.
Operational notes
- Use only approved distribution repositories or preconfigured internal mirrors.
- Bootstrap Python 3 before Ansible fact gathering on minimal installations.
- Store passwords, API tokens, and private CA keys outside public YAML examples; restrict permissions.
- Ansible does not enable background monitoring, install a daemon, or open firewall ports.
- Integrate checks into your existing Nagios, Icinga 2, Checkmk, cron or systemd scheduling separately.
- The
requirements.txtin release archives documents OS package dependencies and is not intended forpip install -r.
Maintainer and disclaimer
Maintained by mati peterson (ipsonic@mailbox.org). Official project URL: https://ipsonic.com/probe/.
Disclaimer: This software and its examples are provided AS IS, without warranty of any kind. Use at your own risk. Review and validate configurations before production deployment.
Validate before running checks
Run the offline configuration validation before scheduling or executing a probe. The validation task does not change the host and fails on malformed YAML:
- name: Validate ipsonic-probe configuration
ansible.builtin.command:
argv:
- /usr/bin/python3
- /opt/ipsonic-probe/ipsonic-probe.py
- --validate
- /etc/ipsonic-probe/api.yaml
register: ipsonic_probe_validation
changed_when: false
After successful validation, run the check with /usr/bin/python3 /opt/ipsonic-probe/ipsonic-probe.py /etc/ipsonic-probe/api.yaml. Monitoring status codes 1 and 2 indicate WARNING and CRITICAL, while 3 means UNKNOWN. For secret-bearing execution tasks, use no_log: true and Ansible Vault.
Operator workflow and directory checks
See OPERATOR-WORKFLOW.md for the complete validate → execute Ansible workflow using /opt/ipsonic-probe/ipsonic-probe.py, --check-dir and optional YAML metadata.