netbox: run upgrade script

This commit is contained in:
Markus 2021-07-12 19:18:07 +02:00
parent ce397c7a62
commit b28004bf35
1 changed files with 14 additions and 12 deletions

View File

@ -54,6 +54,7 @@
dest: /opt
remote_src: yes
creates: '/opt/netbox-{{ netbox_version }}'
register: netbox_unarchive
- name: Configure netbox
template:
@ -69,12 +70,6 @@
owner: '{{ netbox_user }}'
group: '{{ netbox_group }}'
- name: Install venv
pip:
requirements: '/opt/netbox-{{ netbox_version }}/requirements.txt'
virtualenv: '/opt/netbox-{{ netbox_version }}/venv'
virtualenv_command: '/usr/bin/python3 -m venv'
- name: Netbox file permissions
file:
path: '/opt/netbox-{{ netbox_version }}'
@ -82,10 +77,17 @@
group: '{{ netbox_group }}'
recurse: yes
- name: Run upgrade script
command:
cmd: ./upgrade.sh
chdir: '/opt/netbox-{{ netbox_version }}'
become: true
become_user: '{{ netbox_user }}'
when: netbox_unarchive.changed
# TODO - still manual work
# * Run Database Migrations
# * Create a Super User
# * Collect Static Files
# * Create a super user
# * Migrate media files
- name: Ensure certificates are available
command:
@ -96,9 +98,9 @@
creates: '/etc/nginx/ssl/{{ netbox_domain }}.crt'
notify: Restart nginx
#- name: Configure certificate manager for netbox
# template: src=certs.j2 dest=/etc/acertmgr/{{ netbox_domain }}.conf
# notify: Run acertmgr
- name: Configure certificate manager for netbox
template: src=certs.j2 dest=/etc/acertmgr/{{ netbox_domain }}.conf
notify: Run acertmgr
- name: Configure vhost
template: