Compare commits
No commits in common. "4553130d904c9db0ae0037ef0b8218f68eaa7393" and "7ab2b719dc6fe9ed6656a402c8554c031fe5fbdc" have entirely different histories.
4553130d90
...
7ab2b719dc
5 changed files with 14 additions and 18 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 --vault-password-file .vault-password
|
ansible-playbook -i inventory/hosts.yml playbooks/update-netbox.yml
|
||||||
|
|
||||||
backup: ## Backup NetBox
|
backup: ## Backup NetBox
|
||||||
ansible-playbook -i inventory/hosts.yml playbooks/backup-netbox.yml --vault-password-file .vault-password
|
ansible-playbook -i inventory/hosts.yml playbooks/backup-netbox.yml
|
||||||
|
|
||||||
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,7 +137,6 @@ 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 }}`)"
|
||||||
|
|
@ -147,23 +146,19 @@ 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,8 +6,7 @@
|
||||||
|
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Include vault variables
|
- name: Include vault variables
|
||||||
include_vars:
|
include_vars: ../inventory/group_vars/netbox_servers_vault
|
||||||
dir: ../inventory/group_vars
|
|
||||||
|
|
||||||
- name: Verify Ubuntu distribution
|
- name: Verify Ubuntu distribution
|
||||||
fail:
|
fail:
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,8 @@
|
||||||
hosts: netbox
|
hosts: netbox
|
||||||
become: yes
|
become: yes
|
||||||
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 }}"
|
||||||
|
|
@ -19,15 +15,21 @@
|
||||||
tags:
|
tags:
|
||||||
- update-repo
|
- update-repo
|
||||||
|
|
||||||
- name: Pull and Restart latest Docker images
|
- name: Pull latest Docker images
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
project_src: "{{ netbox_install_dir }}"
|
project_src: "{{ netbox_install_dir }}"
|
||||||
pull: always
|
pull: yes
|
||||||
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