File tree Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ netbox_config:
2626 ALLOWED_HOSTS :
2727 - localhost
2828 - 127.0.0.1
29+ # NETBOX_USERNAME:
30+ # NETBOX_PASSWORD:
2931
3032netbox_user : netbox
3133netbox_group : netbox
@@ -48,3 +50,5 @@ netbox_load_initial_data: false
4850
4951netbox_ldap_enabled : false
5052netbox_ldap_config_template : netbox_ldap_config.py.j2
53+
54+ netbox_napalm_enabled : false
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ netbox_config:
3131 MAX_PAGE_SIZE : 500
3232 PAGINATE_COUNT : 100
3333 PREFER_IPV4 : False
34+ NETBOX_USERNAME : netbox
35+ NETBOX_PASSWORD : NetBox42
3436 TIME_ZONE : UTC
3537 DATE_FORMAT : N j, Y
3638 # quotes aren't necessary as you can see - but in my opinion quotes make this more readable
Original file line number Diff line number Diff line change 4444 when :
4545 - netbox_ldap_enabled
4646
47+ - name : Install napalm if NAPALM integration is enabled
48+ pip :
49+ name : napalm
50+ virtualenv : " {{ netbox_virtualenv_path }}"
51+
4752- name : Symlink NetBox configuration file into the active NetBox release
4853 file :
4954 src : " {{ netbox_shared_path }}/configuration.py"
Original file line number Diff line number Diff line change 11---
22# tasks file for lae.netbox
3- - include : check_mandatory_vars .yml
3+ - include : validate_variables .yml
44
55- name : Gather OS specific variables
66 include_vars : " {{ item }}"
Original file line number Diff line number Diff line change 3030 msg : " Please set netbox_python to either 2 or 3."
3131 when :
3232 - netbox_python not in [2, 3]
33+
34+ - name : Ensure NETBOX_USERNAME/PASSWORD is defined for NAPALM integration
35+ fail :
36+ msg : " Please define NETBOX_USERNAME and NETBOX_PASSWORD in netbox_config to use NAPALM."
37+ when :
38+ - netbox_napalm_enabled and ("NETBOX_USERNAME" not in netbox_config or "NETBOX_PASSWORD" not in netbox_config)
You can’t perform that action at this time.
0 commit comments