ansible-role-snort/README.md

61 lines
1.6 KiB
Markdown
Raw Normal View History

2023-08-14 21:37:34 +00:00
# Ansible Role: snort
This Ansible Role builds and installs [snort](https://github.com/v0l/snort). It is intended to be composed with a separate role for the web proxy configuration.
**Warning**: This role is incomplete. Yarn seems problematic to run via Ansible. The build step must be done manually. After running this role and the nginx configuration, the manual steps are as follows:
```shell
systemctl stop snort
cd /var/www/snort
doas -u snort yarn
doas -u snort yarn build
doas -u snort yarn workspace @snort/app intl-extract
doas -u snort yarn workspace @snort/app intl-compile
systemctl start snort
```
2023-08-14 21:37:34 +00:00
Tested on:
* Archlinux
* Ubuntu 22.04
## Requirements
* `nodejs` - version 20 is fine,
* `yarn`
2023-08-14 21:37:34 +00:00
You can use [ansible-role-nodejs](https://github.com/bleetube/ansible-role-nodejs) if you want to. Here is an example `requirements.yml` for that:
2023-08-14 21:37:34 +00:00
```yaml
roles:
- src: https://github.com/bleetube/ansible-role-nodejs
name: bleetube.nodejs
```
It will set up `node`, `npm`, `yarn`, and `n` using the nodesource Debian repositories. But you can also install those by any other method.
2023-08-14 21:37:34 +00:00
## Dependencies
* [nginx_conf](docs/examples/nginx_conf.yml) (optional)
Any similarly configured web proxy may suffice.
2023-08-14 21:37:34 +00:00
## Role Variables
See the role [defaults](defaults/main.yml). For a working example, see this [homelab stack](https://github.com/bleetube/satstack).
## Example Playbook
```yaml
- hosts: snort
become: yes
2023-08-14 21:37:34 +00:00
roles:
- role: nginxinc.nginx_core.nginx
2023-08-14 22:30:07 +00:00
- role: bleetube.nodejs
tags: nodejs
2023-08-14 21:37:34 +00:00
- role: bleetube.snort
tags: snort
tasks:
- import_tasks: nginx_conf.yml
```