--- - name: Make symlink to latest version ansible.builtin.file: src: "/opt/netbox-{{ netbox_version }}" dest: "/opt/netbox" owner: netbox 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" dest: "/opt/netbox/netbox/netbox/configuration.py" mode: '0644' owner: netbox group: netbox ...