Modularize Netbox into several containers with workers n stuff

This commit is contained in:
Salt 2021-09-23 22:09:38 -05:00
parent 8d59a1b201
commit 8ecc7bfbb6

View File

@ -1,28 +1,44 @@
# vim:ft=ansible: # vim:ft=ansible:
- name: docker deploy netbox - name: deploy netbox
docker_container: module_defaults:
name: netbox docker_container:
image: netboxcommunity/netbox:v3.0.2 image: netboxcommunity/netbox:v3.0.2
user: 101 state: started
env: restart_policy: unless-stopped
SUPERUSER_EMAIL: rehashedsalt@cock.li pull: yes
SUPERUSER_PASSWORD: "{{ secret_netbox_user_pass }}" user: 101
SUPERUSER_API_TOKEN: "{{ secret_netbox_api_token }}" env:
SECRET_KEY: "{{ secret_netbox_secret_key }}" SUPERUSER_EMAIL: rehashedsalt@cock.li
ALLOWED_HOST: netbox.desu.ltd SUPERUSER_PASSWORD: "{{ secret_netbox_user_pass }}"
DB_HOST: 192.168.164.156 SUPERUSER_API_TOKEN: "{{ secret_netbox_api_token }}"
DB_NAME: netbox-desultd SECRET_KEY: "{{ secret_netbox_secret_key }}"
DB_USER: netbox-desultd ALLOWED_HOST: netbox.desu.ltd
DB_PASSWORD: "{{ secret_netbox_db_pass }}" DB_HOST: 192.168.164.156
REDIS_HOST: redis DB_NAME: netbox-desultd
REDIS_PORT: "6379" DB_USER: netbox-desultd
networks: DB_PASSWORD: "{{ secret_netbox_db_pass }}"
- name: web REDIS_HOST: redis
aliases: [ "netbox" ] REDIS_PORT: "6379"
volumes: networks:
- /data/netbox/startup_scripts:/opt/netbox/startup_scripts:z,ro - name: web
- /data/netbox/initializers:/opt/netbox/initializers:z,ro aliases: [ "netbox" ]
- /data/netbox/configuration:/etc/netbox/config:z,ro volumes:
- /data/netbox/reports:/etc/netbox/reports:z,ro - /data/netbox/media:/opt/netbox/netbox/media:z
- /data/netbox/media:/opt/netbox/netbox/media:z block:
tags: [ docker, netbox ] - name: docker deploy netbox
docker_container:
name: netbox
tags: [ docker, netbox ]
- name: docker deploy netbox worker
docker_container:
name: netbox-worker-1
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- rqworker
tags: [ docker, netbox ]
- name: docker deploy netbox housekeeping
docker_container:
name: netbox-housekeeping
command: /opt/netbox/housekeeping.sh
tags: [ docker, netbox ]