|
| 1 | +# Ansible: perfSONAR Testpoint (Minimal Skeleton) |
| 2 | + |
| 3 | +This minimal Ansible skeleton installs and configures a perfSONAR testpoint on RHEL-family systems with optional features you can toggle: |
| 4 | +- fail2ban |
| 5 | +- SELinux |
| 6 | +- nftables |
| 7 | + |
| 8 | +It is designed to be small, idempotent, and easy to try. Extend as needed for your environment. |
| 9 | + |
| 10 | +## Prerequisites |
| 11 | +- Control node with Ansible >= 2.12 |
| 12 | +- Target host: RHEL/Alma/Rocky 8/9 (sudo privileges) |
| 13 | +- Network access to OS and perfSONAR repos |
| 14 | + |
| 15 | +## Inventory Example |
| 16 | +See [inventory.example](inventory.example). Place your target host(s) in the `testpoints` group. |
| 17 | + |
| 18 | +## Feature Toggles |
| 19 | +These booleans can be set in group_vars, host_vars, or via `-e` extra vars: |
| 20 | +- `enable_fail2ban` (default: false) |
| 21 | +- `enable_selinux` (default: false) |
| 22 | +- `enable_nftables` (default: false) |
| 23 | + |
| 24 | +Additional variables: |
| 25 | +- `selinux_state`: enforcing | permissive | disabled (default: enforcing when enabled) |
| 26 | +- `testpoint_sysctls`: list of sysctl name/value pairs (default provided) |
| 27 | +- `testpoint_services`: list of services to enable/start (default provided) |
| 28 | + |
| 29 | +## Quick Start |
| 30 | +```bash |
| 31 | +# Dry run |
| 32 | +ansible-playbook -i ansible/inventory.example ansible/site.yml --check |
| 33 | + |
| 34 | +# Apply with optional features enabled |
| 35 | +ansible-playbook -i ansible/inventory.example ansible/site.yml \ |
| 36 | + -e enable_fail2ban=true -e enable_selinux=true -e enable_nftables=true |
| 37 | +``` |
| 38 | + |
| 39 | +## Notes |
| 40 | +- nftables: This deploys a minimal ruleset to `/etc/nftables.conf` and enables the nftables service. If you already use another firewall (firewalld/iptables), test carefully and avoid conflicts. |
| 41 | +- SELinux: The role sets the SELinux mode only when `enable_selinux=true`. On systems without SELinux, the role is skipped. |
| 42 | +- Debian/Ubuntu: Not tested here. Tasks are guarded where practical; contributions welcome. |
| 43 | + |
| 44 | +## Uninstall / Revert |
| 45 | +- Remove packages if desired and restore prior firewall configuration manually. This skeleton does not attempt to revert system-wide firewall configuration automatically. |
0 commit comments