netbox: run upgrade script
This commit is contained in:
parent
ce397c7a62
commit
b28004bf35
@ -54,6 +54,7 @@
|
|||||||
dest: /opt
|
dest: /opt
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
creates: '/opt/netbox-{{ netbox_version }}'
|
creates: '/opt/netbox-{{ netbox_version }}'
|
||||||
|
register: netbox_unarchive
|
||||||
|
|
||||||
- name: Configure netbox
|
- name: Configure netbox
|
||||||
template:
|
template:
|
||||||
@ -69,12 +70,6 @@
|
|||||||
owner: '{{ netbox_user }}'
|
owner: '{{ netbox_user }}'
|
||||||
group: '{{ netbox_group }}'
|
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
|
- name: Netbox file permissions
|
||||||
file:
|
file:
|
||||||
path: '/opt/netbox-{{ netbox_version }}'
|
path: '/opt/netbox-{{ netbox_version }}'
|
||||||
@ -82,10 +77,17 @@
|
|||||||
group: '{{ netbox_group }}'
|
group: '{{ netbox_group }}'
|
||||||
recurse: yes
|
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
|
# TODO - still manual work
|
||||||
# * Run Database Migrations
|
# * Create a super user
|
||||||
# * Create a Super User
|
# * Migrate media files
|
||||||
# * Collect Static Files
|
|
||||||
|
|
||||||
- name: Ensure certificates are available
|
- name: Ensure certificates are available
|
||||||
command:
|
command:
|
||||||
@ -96,9 +98,9 @@
|
|||||||
creates: '/etc/nginx/ssl/{{ netbox_domain }}.crt'
|
creates: '/etc/nginx/ssl/{{ netbox_domain }}.crt'
|
||||||
notify: Restart nginx
|
notify: Restart nginx
|
||||||
|
|
||||||
#- name: Configure certificate manager for netbox
|
- name: Configure certificate manager for netbox
|
||||||
# template: src=certs.j2 dest=/etc/acertmgr/{{ netbox_domain }}.conf
|
template: src=certs.j2 dest=/etc/acertmgr/{{ netbox_domain }}.conf
|
||||||
# notify: Run acertmgr
|
notify: Run acertmgr
|
||||||
|
|
||||||
- name: Configure vhost
|
- name: Configure vhost
|
||||||
template:
|
template:
|
||||||
|
Loading…
Reference in New Issue
Block a user