diff --git a/roles/netbox/tasks/main.yml b/roles/netbox/tasks/main.yml index fa327f0..a9b3a99 100644 --- a/roles/netbox/tasks/main.yml +++ b/roles/netbox/tasks/main.yml @@ -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: