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
|
ansible-playbook -i inventory/hosts.yml playbooks/deploy-netbox.yml --vault-password-file .vault-password
|
||||||
|
|
||||||
update: ## Update NetBox
|
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
|
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
|
check-syntax: ## Check Ansible playbook syntax
|
||||||
ansible-playbook -i inventory/hosts.yml playbooks/deploy-netbox.yml --syntax-check
|
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:
|
netbox_docker_compose_overrides:
|
||||||
services:
|
services:
|
||||||
netbox:
|
netbox:
|
||||||
|
restart: unless-stopped
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.netbox.rule=Host(`{{ netbox_domain }}`)"
|
- "traefik.http.routers.netbox.rule=Host(`{{ netbox_domain }}`)"
|
||||||
|
|
@ -146,19 +147,23 @@ netbox_docker_compose_overrides:
|
||||||
- "traefik"
|
- "traefik"
|
||||||
- "netbox"
|
- "netbox"
|
||||||
netbox-worker:
|
netbox-worker:
|
||||||
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- "netbox"
|
- "netbox"
|
||||||
postgres:
|
postgres:
|
||||||
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- "netbox"
|
- "netbox"
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ netbox_data_dir }}/postgres:/var/lib/postgresql/data"
|
- "{{ netbox_data_dir }}/postgres:/var/lib/postgresql/data"
|
||||||
redis:
|
redis:
|
||||||
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- "netbox"
|
- "netbox"
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ netbox_data_dir }}/redis:/data"
|
- "{{ netbox_data_dir }}/redis:/data"
|
||||||
redis-cache:
|
redis-cache:
|
||||||
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- "netbox"
|
- "netbox"
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Include vault variables
|
- name: Include vault variables
|
||||||
include_vars: ../inventory/group_vars/netbox_servers_vault
|
include_vars:
|
||||||
|
dir: ../inventory/group_vars
|
||||||
|
|
||||||
- name: Verify Ubuntu distribution
|
- name: Verify Ubuntu distribution
|
||||||
fail:
|
fail:
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Include vault variables
|
||||||
|
include_vars:
|
||||||
|
dir: ../inventory/group_vars
|
||||||
|
|
||||||
- name: Update NetBox Docker repository
|
- name: Update NetBox Docker repository
|
||||||
git:
|
git:
|
||||||
repo: "{{ netbox_repo_url }}"
|
repo: "{{ netbox_repo_url }}"
|
||||||
|
|
@ -15,21 +19,15 @@
|
||||||
tags:
|
tags:
|
||||||
- update-repo
|
- update-repo
|
||||||
|
|
||||||
- name: Pull latest Docker images
|
- name: Pull and Restart latest Docker images
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
project_src: "{{ netbox_install_dir }}"
|
project_src: "{{ netbox_install_dir }}"
|
||||||
pull: yes
|
pull: always
|
||||||
|
state: present
|
||||||
|
recreate: auto
|
||||||
tags:
|
tags:
|
||||||
- pull-images
|
- 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
|
- name: Wait for NetBox to be ready
|
||||||
uri:
|
uri:
|
||||||
url: "https://{{ netbox_domain }}/"
|
url: "https://{{ netbox_domain }}/"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue