mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
ansible docs
This commit is contained in:
parent
2e4758e948
commit
8b4b3f3b04
3 changed files with 159 additions and 4 deletions
|
@ -119,6 +119,16 @@ The first step is to install the plugin by putting the plugin files inside the c
|
|||
cp -rp ./bunkerweb-plugins/* /data/plugins
|
||||
```
|
||||
|
||||
=== "Ansible"
|
||||
When using the [Ansible integration](/1.4/integrations/#ansible), plugins must be written to the varaibles `plugins` within your Ansible inventory. :
|
||||
```ini
|
||||
[all]
|
||||
"Your_IP"
|
||||
|
||||
[all:vars]
|
||||
plugins="PathToYourPlugins"
|
||||
```
|
||||
|
||||
When a plugin is installed, you are ready to use it, please refer to the plugin documentation for more information.
|
||||
|
||||
## Writing a plugin
|
||||
|
|
|
@ -304,6 +304,15 @@ You will find more settings about reverse proxy in the [settings section](/1.4/s
|
|||
variables_env: ../variables.env
|
||||
```
|
||||
|
||||
Or in INI format :
|
||||
```ini
|
||||
[all]
|
||||
host
|
||||
|
||||
[all:vars]
|
||||
variables_env = ../variables.env
|
||||
```
|
||||
|
||||
Run the playbook :
|
||||
```shell
|
||||
ansible-playbook -i inventory.yml playbook.yml
|
||||
|
@ -907,11 +916,44 @@ You will find more settings about reverse proxy in the [settings section](/1.4/s
|
|||
```yaml
|
||||
all:
|
||||
children:
|
||||
Groups:
|
||||
host1:
|
||||
hosts:
|
||||
"Your_IP_Address":
|
||||
vars:
|
||||
variables_env: ../variables.env
|
||||
vars:
|
||||
variables_env: ../variables.env
|
||||
host2:
|
||||
hosts:
|
||||
"Your_IP_Address":
|
||||
vars:
|
||||
variables_env = variables.env
|
||||
enable_ui=true
|
||||
host3:
|
||||
hosts:
|
||||
"Your_IP_Address":
|
||||
vars:
|
||||
variables_env = ../variables.env
|
||||
custom_site=../site
|
||||
plugins=../plugins
|
||||
```
|
||||
|
||||
Or in INI format :
|
||||
```ini
|
||||
[all]
|
||||
host1
|
||||
host2
|
||||
host3
|
||||
|
||||
[host1:vars]
|
||||
variables_env = ../variables.env
|
||||
|
||||
[host2:vars]
|
||||
variables_env = variables.env
|
||||
enable_ui=true
|
||||
|
||||
[host3:vars]
|
||||
variables_env = ../variables.env
|
||||
custom_site=../site
|
||||
plugins=../plugins
|
||||
```
|
||||
|
||||
Run the playbook :
|
||||
|
@ -1090,6 +1132,15 @@ REAL_IP_HEADER=X-Forwarded-For
|
|||
variables_env: ../variables.env
|
||||
```
|
||||
|
||||
Or in INI format :
|
||||
```ini
|
||||
[all]
|
||||
host
|
||||
|
||||
[all:vars]
|
||||
variables_env = ../variables.env
|
||||
```
|
||||
|
||||
Run the playbook :
|
||||
```shell
|
||||
ansible-playbook -i inventory.yml playbook.yml
|
||||
|
@ -1259,6 +1310,15 @@ REAL_IP_HEADER=proxy_protocol
|
|||
variables_env: ../variables.env
|
||||
```
|
||||
|
||||
Or in INI format :
|
||||
```ini
|
||||
[all]
|
||||
host
|
||||
|
||||
[all:vars]
|
||||
variables_env = ../variables.env
|
||||
```
|
||||
|
||||
Run the playbook :
|
||||
```shell
|
||||
ansible-playbook -i inventory.yml playbook.yml
|
||||
|
@ -1526,6 +1586,16 @@ Some integrations offer a more convenient way of applying configurations for exa
|
|||
}
|
||||
```
|
||||
|
||||
Or in INI format :
|
||||
```ini
|
||||
[all]
|
||||
host
|
||||
|
||||
[all:vars]
|
||||
custom_configs=true
|
||||
custom_configs_path={'server-http': '../hello-world.conf', 'http': '../http.conf', 'default-server-http': '../default-server-http.conf', 'modsec-crs': '../modsec-crs', 'modsec': '../modsec'}
|
||||
```
|
||||
|
||||
Run the playbook :
|
||||
```shell
|
||||
ansible-playbook -i inventory.yml playbook.yml
|
||||
|
|
|
@ -241,4 +241,79 @@ Because the web UI is a web application, the recommended installation procedure
|
|||
Restart the BunkerWeb UI service and you are now ready to access it :
|
||||
```shell
|
||||
systemctl restart bunkerweb-ui
|
||||
```
|
||||
```
|
||||
|
||||
=== "Ansible"
|
||||
|
||||
The installation of the web UI using the [Ansible integration](/1.4/integrations/#ansible) is pretty straightforward because it is installed with BunkerWeb.
|
||||
|
||||
The first thing to do is to edit your local BunkerWeb configuration and add settings related to the web UI :
|
||||
```conf
|
||||
HTTP_PORT=80
|
||||
HTTPS_PORT=443
|
||||
DNS_RESOLVERS=8.8.8.8 8.8.4.4
|
||||
...
|
||||
SERVER_NAME=bwadm.example.com
|
||||
MULTISITE=yes
|
||||
USE_API=yes
|
||||
API_WHITELIST_IP=127.0.0.0/8
|
||||
bwadm.example.com_USE_UI=yes
|
||||
bwadm.example.com_USE_REVERSE_PROXY=yes
|
||||
bwadm.example.com_REVERSE_PROXY_URL=/changeme/
|
||||
bwadm.example.com_REVERSE_PROXY_HOST=http://127.0.0.1:7000
|
||||
bwadm.example.com_REVERSE_PROXY_HEADER=X-Script-Name /changeme
|
||||
bwadm.example.com_REVERSE_PROXY_INTERCEPT_ERRORS=no
|
||||
...
|
||||
```
|
||||
|
||||
Important things to note :
|
||||
|
||||
* `bwadm.example.com` is the dedicated (sub)domain for accessing the web UI
|
||||
* replace the `/changeme` URLs with a custom one of your choice
|
||||
|
||||
Once the configuration file is edited, you will start your playbook :
|
||||
```shell
|
||||
ansible-playbook -i inventory.yml playbook.yml
|
||||
```
|
||||
|
||||
The inventory to go with the playbook:
|
||||
In YAML format:
|
||||
|
||||
```yaml
|
||||
all:
|
||||
children:
|
||||
Groups:
|
||||
hosts:
|
||||
"Your_IP_Address":
|
||||
vars:
|
||||
enable_ui: true # Activate the UI
|
||||
custom_ui: "PathToYourFile" # Path to your UI file
|
||||
}
|
||||
```
|
||||
|
||||
Or in INI format :
|
||||
```ini
|
||||
[all]
|
||||
"Your_IP_Address"
|
||||
|
||||
[all:vars]
|
||||
enable_ui: true # Activate the UI
|
||||
custom_ui: "PathToYourFile" # Path to your UI file
|
||||
```
|
||||
|
||||
You can edit your local UI file containing the settings of the web UI :
|
||||
```conf
|
||||
ADMIN_USERNAME=admin
|
||||
ADMIN_PASSWORD=changeme
|
||||
ABSOLUTE_URI=http(s)://bwadm.example.com/changeme/
|
||||
```
|
||||
|
||||
Important things to note :
|
||||
|
||||
* `http(s)://bwadmin.example.com/changeme/` is the full base URL of the web UI (must match the sub(domain) and /changeme URL used in **/opt/bunkerweb/variables.env**)
|
||||
* replace the username `admin` and password `changeme` with strong ones
|
||||
|
||||
Deplay your playbook :
|
||||
```shell
|
||||
ansible-playbook -i inventory.yml playbook.yml
|
||||
```
|
Loading…
Reference in a new issue