ansible-ops-management/tasks/netbox/install.yml

42 lines
1.1 KiB
YAML
Raw Normal View History

2024-03-23 06:24:10 +00:00
---
2024-04-01 06:44:11 +00:00
- 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
2024-04-01 06:44:11 +00:00
- 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
2024-03-23 06:24:10 +00:00
...