Skip to content

Instantly share code, notes, and snippets.

@dynax60
Last active October 18, 2018 13:15
Show Gist options
  • Save dynax60/bdf154856faf5e8bbe7b8361ff2dedc4 to your computer and use it in GitHub Desktop.
Save dynax60/bdf154856faf5e8bbe7b8361ff2dedc4 to your computer and use it in GitHub Desktop.
Install Netbox 2.4.6 on CentOS 7.5.1804 using Ansible

Usage

ansible-galaxy install graylog2.graylog-ansible-role
ansible-galaxy install geerlingguy.postgresql lae.netbox
ansible-playbook -i hosts.yml netbox.yml
- hosts: netbox.local
become: yes
roles:
- geerlingguy.postgresql
- lae.netbox
vars:
netbox_git: true
netbox_git_version: v2.4.6
netbox_database_socket: "{{ postgresql_unix_socket_directories[0] }}"
netbox_superuser_password: whateveryouwant
netbox_socket: "0.0.0.0:80"
netbox_config:
ALLOWED_HOSTS:
- netbox.local
MEDIA_ROOT: "{{ netbox_shared_path }}/media"
REPORTS_ROOT: "{{ netbox_shared_path }}/reports"
NAPALM_USERNAME: netbox
NAPALM_PASSWORD: whateveryouwant
netbox_home: /opt/netbox
netbox_napalm_enabled: true
netbox_superuser_email: [email protected]
postgresql_version: "10"
postgresql_daemon: postgresql-10
postgresql_bin_path: "/usr/pgsql-10/bin"
postgresql_data_dir: "/var/lib/pgsql/10/data"
postgresql_packages:
- postgresql10
- postgresql10-server
- postgresql10-contrib
- postgresql10-libs
postgresql_users:
- name: "{{ netbox_database_user }}"
role_attr_flags: CREATEDB,NOSUPERUSER
pre_tasks:
- name: Enable/Install EPEL Repo
yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- name: Enable/Install PostgreSQL Repo
yum:
name: https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment