diff --git a/tasks/netbox/install.yml b/tasks/netbox/install.yml index f34aa48..1905e98 100644 --- a/tasks/netbox/install.yml +++ b/tasks/netbox/install.yml @@ -7,6 +7,30 @@ group: netbox state: link +- name: As netbox user, install deps part 1 + ansible.builtin.pip: + name: + - pip + - setuptools + state: latest + virtualenv: "/opt/netbox-{{ netbox_version }}/venv" + virtualenv_command: "{{ netbox_python_binary }} -m venv" + become: true + become_user: netbox + retries: 2 + register: netbox_virtualenv_setup + until: netbox_virtualenv_setup is succeeded + +- name: As netbox user, install deps part 2 + ansible.builtin.pip: + requirements: "/opt/netbox-{{ netbox_version }}/requirements.txt" + virtualenv: "/opt/netbox-{{ netbox_version }}/venv" + become: true + become_user: netbox + retries: 2 + register: netbox_virtualenv_setup + until: netbox_virtualenv_setup is succeeded + - name: Deploy templated configuration ansible.builtin.template: src: "opt/netbox/netbox/netbox/configuration.py.j2" diff --git a/vars/netbox.yml b/vars/netbox.yml index 057eb09..18a0c2a 100644 --- a/vars/netbox.yml +++ b/vars/netbox.yml @@ -1,14 +1,23 @@ --- netbox_version: "3.7.4" netbox_checksum: "f0c2026b81ab9785f3530eb3c59a922517630976c2af1f95eea02f8bfb9613fd" +netbox_python_binary: "/usr/bin/python3.9" netbox_pkg: - git - libxml2-devel - libxslt-devel - libffi-devel + - libjpeg-devel - libpq-devel - nginx + - openldap-devel - openssl-devel + - python3 + - python3-devel + - python3-libselinux + - python3-pip + - python3-psycopg2 + - python3-setuptools - redhat-rpm-config - redis netbox_selinux_booleans: