-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathplaybook.yml
81 lines (71 loc) · 2.76 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
- name: Installing netbox (requires redis and postgres installed)
hosts: netbox.domain.tld
# only one host at a time:
# serial: 1
vars_files:
- my-vault.yml
vars:
netbox_superuser_username: YOUR_ADMINUSER
# netbox_superuser_password: "-> Vault"
netbox_superuser_email: "[email protected]"
# minimum: 50chars:
# netbox_secret_key: " -> vault" # generate: "head /dev/urandom | tr -dc a-zA-Z0-9 | head -c50"
# netbox_token: "-> vault" # generate:"head /dev/urandom | tr -dc a-f0-9 | head -c40"
# Postgres >= 11 needed
# https://github.com/candlerb/netbox/blob/master/docs/installation/postgresql.md
# ENCODING 'UTF8' LC_COLLATE='C.UTF-8' LC_CTYPE='C.UTF-8';
netbox_db_host: localhost
# netbox_db_password: "-> vault"
netbox_db_user: netbox
netbox_db: netbox
postgresql_databases:
- name: "{{ netbox_db }}"
lc_collate: "C.UTF-8"
lc_ctype: "C.UTF-8"
encoding: "UTF8"
#login_host: "{{ netbox_db_host }}"
#login_password: "{{ netbox_db_password }}"
#login_user: "{{ netbox_db_user }}"
# owner: "{{ netbox_user }}"
postgresql_users:
- name: "{{ netbox_db_user }}"
db: "{{ netbox_db }}"
password: "{{ netbox_db_password }}"
# priv: "CONNECT/{{ netbox_db }}:ALL"
priv: ALL
# netbox_nginx_ssl_certificate: "/etc/letsencrypt/live/{{ netbox_hostname }}/fullchain.pem"
# netbox_nginx_ssl_certificate_key: "/etc/letsencrypt/live/{{ netbox_hostname }}/privkey.pem"
nginx_ssl_protocols: "TLSv1.3"
netbox_nginx_remove_default_config: true
# letsencrypt:
certbot_create_method: nginx
certbot_certs:
- domains:
- "{{ ansible_fqdn }}"
certbot_auto_renew_minute: 17
certbot_auto_renew_hour: 3
certbot_admin_email: "[email protected]"
certbot_create_if_missing: true
certbot_install_from_source: false
post_tasks:
# https://docs.netbox.dev/en/stable/installation/1-postgresql/
- name: GRANT CREATE ON SCHEMA public TO netbox;
community.postgresql.postgresql_privs:
db: "{{ netbox_db }}"
privs: CREATE
type: schema
objs: public
role: "{{ netbox_user }}"
# login_unix_socket: "{{ item.login_unix_socket | default(postgresql_unix_socket_directories[0]) }}"
become: true
become_user: "{{ postgresql_user }}"
tags: postgresql
roles:
- { role: selfhostx.ansible.baserole, tags: baserole }
- { role: geerlingguy.pip, tags: pip }
- { role: geerlingguy.redis, tags: redis }
- { role: geerlingguy.postgresql, tags: postgresql }
- { role: selfhostx.ansible.nginx_common, tags: nginx_common }
- { role: selfhostx.certbot, tags: certbot,letsencrypt }
- { role: selfhostx.ansible.netbox, tags: netbox }