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

53 lines
1.2 KiB
YAML
Raw Normal View History

2024-03-23 06:24:10 +00:00
---
2024-04-01 06:44:11 +00:00
- name: Install required software to build python libs and run netbox
2024-03-23 06:24:10 +00:00
become: true
ansible.builtin.package:
2024-04-01 06:44:11 +00:00
name: "{{ netbox_pkg }}"
2024-03-23 06:24:10 +00:00
state: present
- name: Setup initial netbox user
become: true
ansible.builtin.user:
name: netbox
comment: "NetBox"
system: true
2024-04-01 06:44:11 +00:00
uid: "2001"
- name: Configuring SELinux booleans
ansible.posix.seboolean:
name: "{{ item }}"
persistent: true
state: true
with_items: "{{ netbox_selinux_booleans }}"
- name: Setup firewalld services
ansible.posix.firewalld:
service: "{{ item }}"
permanent: true
state: enabled
loop:
- http
- https
- name: Setup firewalld port because of netbox's weird setup
ansible.posix.firewalld:
port: "8000/tcp"
permanent: true
state: enabled
- name: Download netbox
ansible.builtin.get_url:
url: "https://github.com/netbox-community/netbox/archive/refs/tags/v{{ netbox_version }}.tar.gz"
dest: "/tmp/netbox-{{ netbox_version }}.tar.gz"
checksum: "{{ netbox_checksum }}"
- name: Unpack netbox
ansible.builtin.unarchive:
src: "/tmp/netbox-{{ netbox_version }}.tar.gz"
dest: "/opt"
owner: netbox
group: netbox
mode: '0644'
remote_src: true
2024-03-23 06:24:10 +00:00
...