An Ansible role for installing and configuring auditship, a tool that ships Linux audit logs to Fluentd endpoints in real-time.
- Automatically downloads the latest auditship binary from GitLab releases
 - Configures auditship as an auditd plugin for real-time log shipping
 - Sets up log rotation to prevent disk space issues
 - Supports multiple Linux distributions (Ubuntu, Debian)
 - Idempotent installation with force reinstall option
 
- Ansible >= 2.4
 - Target systems must have 
auditdinstalled and running - Internet connectivity for downloading auditship binary and configuration files
 - Root privileges on target systems
 
None. All variables have sensible defaults.
| Variable | Default | Description | 
|---|---|---|
auditship_force_install | 
false | 
Forces reinstallation even if binary exists | 
auditship_tag | 
auditd | 
Tag to apply to audit logs | 
auditship_outputs | 
["-", "/var/log/auditship.json"] | 
Array of output destinations (stdout and file) | 
auditship_log_file | 
/var/log/auditship.log | 
Location of auditship log file | 
auditship_log_level | 
info | 
Logging level (debug, info, warn, error) | 
auditship_buffer_size | 
10000 | 
Buffer size for batching audit events | 
auditship_retry_interval | 
30 | 
Retry interval in seconds for failed deliveries | 
auditship_max_retry_attempts | 
10 | 
Maximum number of retry attempts | 
auditship_metrics_enabled | 
false | 
Enable metrics endpoint for monitoring | 
auditship_metrics_bind_address | 
127.0.0.1 | 
Bind address for metrics endpoint | 
auditship_metrics_port | 
9090 | 
Port for metrics endpoint | 
auditship_metrics_path | 
/metrics | 
HTTP path for metrics endpoint | 
auditship_force_install: true
auditship_tag: "security-audit"
auditship_outputs:
  - "-"                           # stdout
  - "/var/log/auditship.json"     # local file
  - "fluent://log-server.company.com:24224"  # fluentd endpoint
auditship_log_file: "/var/log/auditship.log"
auditship_log_level: "debug"
auditship_buffer_size: 5000       # smaller buffer for high-frequency logs
auditship_retry_interval: 60      # retry every minute
auditship_max_retry_attempts: 5   # fail after 5 attempts
auditship_metrics_enabled: true   # enable monitoring
auditship_metrics_bind_address: "0.0.0.0"  # expose metrics externally
auditship_metrics_port: 8080      # custom metrics port
auditship_metrics_path: "/stats"  # custom metrics pathNone.
- hosts: servers
  become: true
  roles:
    - devopsworks.auditship- hosts: servers
  become: true
  vars:
    auditship_tag: "security-audit"
    auditship_outputs:
      - "-"                           # stdout
      - "/var/log/auditship.json"     # local file  
      - "fluent://log-server.company.com:24224"  # fluentd endpoint
    auditship_log_level: "debug"
    auditship_buffer_size: 5000       # smaller buffer for high-frequency logs
    auditship_retry_interval: 60      # retry every minute
    auditship_max_retry_attempts: 5   # fail after 5 attempts
    auditship_metrics_enabled: true   # enable monitoring
    auditship_metrics_bind_address: "0.0.0.0"  # expose metrics externally
    auditship_metrics_port: 8080      # custom metrics port
    auditship_metrics_path: "/stats"  # custom metrics path
  roles:
    - devopsworks.auditship- hosts: servers
  become: true
  vars:
    auditship_force_install: true
  roles:
    - devopsworks.auditshipansible-galaxy install devopsworks.auditshipansible-galaxy install git+https://github.com/devops-works/ansible-auditship.git- Version Detection: Queries GitLab API to find the latest auditship release
 - Binary Download: Downloads the compressed auditship binary for Linux AMD64
 - Installation: Extracts and installs the binary to 
/usr/local/bin/auditship - Plugin Configuration: Creates auditd plugin configuration in 
/etc/audit/plugins.d/auditship.conf - Main Configuration: Creates main auditship configuration file at 
/etc/auditship.conf - Log Rotation: Downloads and installs logrotate configuration to 
/etc/logrotate.d/auditship 
- Binary: 
/usr/local/bin/auditship - Plugin Config: 
/etc/audit/plugins.d/auditship.conf - Main Config: 
/etc/auditship.conf - Log Rotation: 
/etc/logrotate.d/auditship 
- Ubuntu (all versions)
 - Debian (all versions)
 
This role includes comprehensive testing using Molecule with Podman driver.
pip install -r requirements.txt# Run all tests
make test
# Run linting only
make lint
# Run syntax check
make syntax- Ubuntu 24.04
 - Debian 11
 - Debian 12
 
- Clone the repository
 - Install dependencies: 
make install - Run tests: 
make test 
make help- Show available commandsmake install- Install Python dependenciesmake lint- Run all linting toolsmake test- Run molecule testsmake clean- Clean up test artifactsmake syntax- Check Ansible syntax
- Internet Connectivity: Ensure target systems can reach GitLab for downloading binaries
 - Auditd Service: Verify auditd is installed and running before applying this role
 - Permissions: Role requires root privileges for installation and configuration
 
After running the role, verify installation:
# Check binary exists and is executable
ls -la /usr/local/bin/auditship
# Test auditship version
/usr/local/bin/auditship -version
# Verify plugin configuration
cat /etc/audit/plugins.d/auditship.conf
# Verify main configuration
cat /etc/auditship.conf
# Check auditd is using the plugin
sudo service auditd statusMIT
This role was created by DevopsWorks.
- Fork the repository
 - Create a feature branch
 - Make your changes
 - Add tests for new functionality
 - Run the test suite: 
make test - Submit a pull request