paulbsd-salt/states/netbox/install.sls

73 lines
1.9 KiB
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "netbox/map.jinja" import netbox with context %}
netbox-virtualenv-pkg:
pip.installed:
- name: virtualenv
- bin_env: /usr/bin/pip3
netbox-archive-extract:
archive.extracted:
- name: {{ netbox.release_dir }}
- source: {{ netbox.archive_url }}/v{{ netbox.version }}.tar.gz
2020-09-12 17:41:35 +02:00
- skip_verify: true
2020-07-10 00:58:55 +02:00
netbox-install-link:
file.symlink:
- name: {{ netbox.install_dir }}/netbox
- target: {{ netbox.release_dir }}/netbox-{{ netbox.version }}
- watch_in:
- service: netbox-service
- require:
- archive: netbox-archive-extract
netbox-virtualenv:
virtualenv.managed:
- name: {{ netbox.install_dir }}/netbox
- requirements: {{ netbox.install_dir }}/netbox/requirements.txt
- python: /usr/bin/python3
- require:
- pip: netbox-virtualenv-pkg
netbox-gunicorn-pkg:
pip.installed:
- name: gunicorn
- bin_env: {{ netbox.install_dir }}/netbox/bin/pip3
- require:
- virtualenv: netbox-virtualenv
netbox-gunicorn-execfile:
file.managed:
- name: {{ netbox.install_dir }}/netbox/gunicorn.py
- source: salt://netbox/templates/gunicorn.py.j2
- user: root
- group: root
- mode: 0644
- template: jinja
netbox-config-file:
file.managed:
- name: {{ netbox.install_dir }}/netbox/netbox/netbox/configuration.py
- source: salt://netbox/templates/configuration.py.j2
- user: root
- group: root
- mode: 0644
- template: jinja
netbox-migration:
module.run:
- name: django.migrate
- settings_module: netbox.settings
- pythonpath: {{ netbox.install_dir }}/netbox/netbox
- bin_env: {{ netbox.install_dir }}/netbox
- require:
- virtualenv: netbox-virtualenv
netbox-install-static-files:
module.run:
- name: django.collectstatic
- settings_module: netbox.settings
- pythonpath: {{ netbox.install_dir }}/netbox/netbox
- bin_env: {{ netbox.install_dir }}/netbox
- require:
2021-08-19 21:15:24 +02:00
- virtualenv: netbox-virtualenv