ansible-infra/roles/netbox/handlers/main.yaml
June 745755604c
add netbox role for ensuring netbox is deployed as specified
The role takes over the deployment of netbox and its dependencies, while
still requiring the user to provide the netbox version, db password and
config as well as to set up a web server and handle stuff like creating
users, etc.
2025-02-15 06:10:59 +01:00

24 lines
643 B
YAML

- name: Run upgrade script
ansible.builtin.command: /opt/netbox/upgrade.sh
become: true
# When it runs, this should always report changed.
changed_when: true
- name: Ensure netbox systemd services are set up and up-to-date
ansible.builtin.systemd_service:
daemon_reload: true
name: "{{ item }}"
enabled: true
state: restarted
become: true
loop:
- "netbox.service"
- "netbox-rq.service"
- name: Ensure netbox housekeeping timer is set up and up-to-date
ansible.builtin.systemd_service:
daemon_reload: true
name: "netbox-housekeeping.timer"
enabled: true
state: restarted
become: true