Compare commits
2 commits
7ab2b719dc
...
4553130d90
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4553130d90 | ||
|
|
e2798b77d1 |
5 changed files with 18 additions and 14 deletions
4
Makefile
4
Makefile
|
|
@ -16,10 +16,10 @@ deploy: ## Deploy NetBox (requires vault password)
|
|||
ansible-playbook -i inventory/hosts.yml playbooks/deploy-netbox.yml --vault-password-file .vault-password
|
||||
|
||||
update: ## Update NetBox
|
||||
ansible-playbook -i inventory/hosts.yml playbooks/update-netbox.yml
|
||||
ansible-playbook -i inventory/hosts.yml playbooks/update-netbox.yml --vault-password-file .vault-password
|
||||
|
||||
backup: ## Backup NetBox
|
||||
ansible-playbook -i inventory/hosts.yml playbooks/backup-netbox.yml
|
||||
ansible-playbook -i inventory/hosts.yml playbooks/backup-netbox.yml --vault-password-file .vault-password
|
||||
|
||||
check-syntax: ## Check Ansible playbook syntax
|
||||
ansible-playbook -i inventory/hosts.yml playbooks/deploy-netbox.yml --syntax-check
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ traefik_custom_ca_verify_ssl: false
|
|||
netbox_docker_compose_overrides:
|
||||
services:
|
||||
netbox:
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.netbox.rule=Host(`{{ netbox_domain }}`)"
|
||||
|
|
@ -146,19 +147,23 @@ netbox_docker_compose_overrides:
|
|||
- "traefik"
|
||||
- "netbox"
|
||||
netbox-worker:
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- "netbox"
|
||||
postgres:
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- "netbox"
|
||||
volumes:
|
||||
- "{{ netbox_data_dir }}/postgres:/var/lib/postgresql/data"
|
||||
redis:
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- "netbox"
|
||||
volumes:
|
||||
- "{{ netbox_data_dir }}/redis:/data"
|
||||
redis-cache:
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- "netbox"
|
||||
volumes:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
pre_tasks:
|
||||
- name: Include vault variables
|
||||
include_vars: ../inventory/group_vars/netbox_servers_vault
|
||||
include_vars:
|
||||
dir: ../inventory/group_vars
|
||||
|
||||
- name: Verify Ubuntu distribution
|
||||
fail:
|
||||
|
|
|
|||
|
|
@ -3,8 +3,12 @@
|
|||
hosts: netbox
|
||||
become: yes
|
||||
gather_facts: no
|
||||
|
||||
|
||||
tasks:
|
||||
- name: Include vault variables
|
||||
include_vars:
|
||||
dir: ../inventory/group_vars
|
||||
|
||||
- name: Update NetBox Docker repository
|
||||
git:
|
||||
repo: "{{ netbox_repo_url }}"
|
||||
|
|
@ -15,21 +19,15 @@
|
|||
tags:
|
||||
- update-repo
|
||||
|
||||
- name: Pull latest Docker images
|
||||
- name: Pull and Restart latest Docker images
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ netbox_install_dir }}"
|
||||
pull: yes
|
||||
pull: always
|
||||
state: present
|
||||
recreate: auto
|
||||
tags:
|
||||
- pull-images
|
||||
|
||||
- name: Restart NetBox services
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ netbox_install_dir }}"
|
||||
state: present
|
||||
recreate: yes
|
||||
tags:
|
||||
- restart-services
|
||||
|
||||
- name: Wait for NetBox to be ready
|
||||
uri:
|
||||
url: "https://{{ netbox_domain }}/"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue