Update to version 2.11.12, then 3.1.7

Add anonymous access to most data model fields

fixes for metadata/license/lint

Change-Id: I728b6fbda2927ee7e3d9b994e1c8f97d7d9493ba
diff --git a/.reuse/dep5 b/.reuse/dep5
index 36ce305..40fef72 100644
--- a/.reuse/dep5
+++ b/.reuse/dep5
@@ -1,5 +1,5 @@
 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
-Files: .cookiecutter_params.json VERSION .gitreview
+Files: .cookiecutter_params.json VERSION .gitreview README.md
 Copyright: 2020 Open Networking Foundation
 License: Apache-2.0
diff --git a/Makefile b/Makefile
index 8a5db02..d1215cc 100644
--- a/Makefile
+++ b/Makefile
@@ -23,10 +23,13 @@
     -d "{extends: default, rules: {line-length: {max: 99}}}" \
     -s $(YAML_FILES)
 
+# List of molecule files, not including base molecule.yml which isn't ansible format
+MOLECULE_FILES ?= $(shell find molecule -type f -name '*.yml' \! -name 'molecule.yml' -print )
+
 ansiblelint: ## lint check with ansible-lint
 	ansible-lint --version
 	ansible-lint -v .
-	ansible-lint -v molecule/*/*
+	ansible-lint -v $(MOLECULE_FILES)
 
 license: ## Check license with the reuse tool
 	reuse --version
diff --git a/README.md b/README.md
index 4470b42..d755109 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,3 @@
-<!--
-SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
-SPDX-License-Identifier: Apache-2.0
---!>
 # netbox
 
 This role installs or updates the [NetBox IPAM/DCIM
diff --git a/defaults/main.yml b/defaults/main.yml
index 3a5e3c4..0c7c469 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -5,8 +5,14 @@
 # SPDX-License-Identifier: Apache-2.0
 
 # version and checksum of the .tar.gz distribution on github
-netbox_version: "2.9.10"
-netbox_version_checksum: "sha256:7499c5e9644120b821f13914862154551b94c20df1b3b9ae41c25cd7bf3d8ad4"
+
+# for upgrades from 2.x to 3.x, must upgrade to 2.11.x first for migrations
+# netbox_version: "2.11.12"
+# netbox_version_checksum: >-
+#   sha256:c51d8d386ead7523f7513b41d03500bf464fecc4129ccf1f74569a3e8d609684
+
+netbox_version: "3.1.7"
+netbox_version_checksum: "sha256:af9ff46dd6fd0026d2238a7bffd4a8b6215035e1a76f2a542ac1cf5b4b627aaf"
 
 # unix username/groupname
 netbox_username: "netbox"
diff --git a/meta/main.yml b/meta/main.yml
index 9563eb9..873f923 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -5,6 +5,9 @@
 # SPDX-License-Identifier: Apache-2.0
 
 galaxy_info:
+  role_name: netbox
+  namespace: onf
+
   author: Open Networking Foundation
   description: NetBox IPAM System
   company: Open Networking Foundation
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
index d33ec80..bca6d94 100644
--- a/molecule/default/molecule.yml
+++ b/molecule/default/molecule.yml
@@ -9,13 +9,13 @@
 driver:
   name: docker
 platforms:
-  - name: "ubuntu-18.04-priv"
-    image: "quay.io/paulfantom/molecule-systemd:ubuntu-18.04"
+  - name: "debian-10-priv"
+    image: "quay.io/paulfantom/molecule-systemd:debian-10"
     privileged: true
     volumes:
       - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
-  - name: "debian-10-priv"
-    image: "quay.io/paulfantom/molecule-systemd:debian-10"
+  - name: "debian-11-priv"
+    image: "onfinfra/molecule-systemd:debian-11"
     privileged: true
     volumes:
       - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
@@ -25,5 +25,7 @@
     host_vars:
       debian-10-priv:
         ansible_python_interpreter: /usr/bin/python3
+      debian-11-priv:
+        ansible_python_interpreter: /usr/bin/python3
 verifier:
   name: ansible
diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml
index e244464..9557c4d 100644
--- a/molecule/default/verify.yml
+++ b/molecule/default/verify.yml
@@ -14,4 +14,4 @@
         status_code: 200
         return_content: true
       register: webpage
-      failed_when: "'Home - NetBox' not in webpage.content"
+      failed_when: "'NetBox' not in webpage.content"
diff --git a/templates/configuration.py.j2 b/templates/configuration.py.j2
index de51076..cdd8531 100644
--- a/templates/configuration.py.j2
+++ b/templates/configuration.py.j2
@@ -129,10 +129,60 @@
 
 # Exempt certain models from the enforcement of view permissions. Models listed here will be viewable by all users and
 # by anonymous users. List models in the form `<app>.<model>`. Add '*' to this list to exempt all models.
+#
+# FIXME - this should be a more complete list, but one isn't available from the Netbox docs
 EXEMPT_VIEW_PERMISSIONS = [
-    # 'dcim.site',
-    # 'dcim.region',
-    # 'ipam.prefix',
+  'dcim.cable',
+  'dcim.cablepath',
+  'dcim.connecteddevice',
+  'dcim.consoleconnection',
+  'dcim.console-port-templates',
+  'dcim.consoleport',
+  'dcim.consoleserver-port-templates',
+  'dcim.consoleserver-port',
+  'dcim.devicebaytemplates',
+  'dcim.devicebays',
+  'dcim.devicerole',
+  'dcim.devicetype',
+  'dcim.device',
+  'dcim.front-port-templates',
+  'dcim.front-ports',
+  'dcim.interface-connection',
+  'dcim.interface-templates',
+  'dcim.interface',
+  'dcim.inventoryitem',
+  'dcim.manufacturer',
+  'dcim.platform',
+  'dcim.powerconnections',
+  'dcim.powerfeed',
+  'dcim.poweroutlet-templates',
+  'dcim.poweroutlet',
+  'dcim.powerpanel',
+  'dcim.powerport-templates',
+  'dcim.powerports',
+  'dcim.rackgroups',
+  'dcim.rackreservation',
+  'dcim.rackrole',
+  'dcim.rack',
+  'dcim.rearporttemplate',
+  'dcim.rearport',
+  'dcim.region',
+  'dcim.site',
+  'dcim.sitegroup',
+  'dcim.virtualchassis',
+  'ipam.aggregate',
+  'ipam.ipaddress',
+  'ipam.prefix',
+  'ipam.rir',
+  'ipam.role',
+  'ipam.service',
+  'ipam.vlangroup',
+  'ipam.vlan',
+  'ipam.vrf',
+  'tenancy.tenant-groups',
+  'tenancy.tenant',
+  'virtualization.virtual-machine',
+  'extras.tags',
 ]
 
 # HTTP proxies NetBox should use when sending outbound HTTP requests (e.g. for webhooks).