Browse Source

Closes #176: Added initial_data fixtures for new installs

Jeremy Stretch 8 years ago
parent
commit
b73f980eb2

+ 12 - 0
docs/installation/netbox.md

@@ -163,6 +163,18 @@ Are you sure you want to do this?
 Type 'yes' to continue, or 'no' to cancel: yes
 ```
 
+# Load Initial Data (Optional)
+
+NetBox ships with some initial data to help you get started: RIR definitions, common devices roles, etc. You can delete any seed data that you don't want to keep.
+
+!!! note
+    This step is optional. It's perfectly fine to start using NetBox without using this initial data if you'd rather create everything from scratch.
+
+```
+# ./manage.py loaddata initial_data
+Installed 43 object(s) from 4 fixture(s)
+```
+
 # Test the Application
 
 At this point, NetBox should be able to run. We can verify this by starting a development instance:

+ 26 - 0
netbox/circuits/fixtures/initial_data.json

@@ -0,0 +1,26 @@
+[
+{
+    "model": "circuits.circuittype",
+    "pk": 1,
+    "fields": {
+        "name": "Internet",
+        "slug": "internet"
+    }
+},
+{
+    "model": "circuits.circuittype",
+    "pk": 2,
+    "fields": {
+        "name": "Private WAN",
+        "slug": "private-wan"
+    }
+},
+{
+    "model": "circuits.circuittype",
+    "pk": 3,
+    "fields": {
+        "name": "Out-of-Band",
+        "slug": "out-of-band"
+    }
+}
+]

+ 201 - 0
netbox/dcim/fixtures/initial_data.json

@@ -0,0 +1,201 @@
+[
+{
+    "model": "dcim.devicerole",
+    "pk": 1,
+    "fields": {
+        "name": "Console Server",
+        "slug": "console-server",
+        "color": "teal"
+    }
+},
+{
+    "model": "dcim.devicerole",
+    "pk": 2,
+    "fields": {
+        "name": "Core Switch",
+        "slug": "core-switch",
+        "color": "blue"
+    }
+},
+{
+    "model": "dcim.devicerole",
+    "pk": 3,
+    "fields": {
+        "name": "Distribution Switch",
+        "slug": "distribution-switch",
+        "color": "blue"
+    }
+},
+{
+    "model": "dcim.devicerole",
+    "pk": 4,
+    "fields": {
+        "name": "Access Switch",
+        "slug": "access-switch",
+        "color": "blue"
+    }
+},
+{
+    "model": "dcim.devicerole",
+    "pk": 5,
+    "fields": {
+        "name": "Management Switch",
+        "slug": "management-switch",
+        "color": "orange"
+    }
+},
+{
+    "model": "dcim.devicerole",
+    "pk": 6,
+    "fields": {
+        "name": "Firewall",
+        "slug": "firewall",
+        "color": "red"
+    }
+},
+{
+    "model": "dcim.devicerole",
+    "pk": 7,
+    "fields": {
+        "name": "Router",
+        "slug": "router",
+        "color": "purple"
+    }
+},
+{
+    "model": "dcim.devicerole",
+    "pk": 8,
+    "fields": {
+        "name": "Server",
+        "slug": "server",
+        "color": "medium_gray"
+    }
+},
+{
+    "model": "dcim.devicerole",
+    "pk": 9,
+    "fields": {
+        "name": "PDU",
+        "slug": "pdu",
+        "color": "dark_gray"
+    }
+},
+{
+    "model": "dcim.manufacturer",
+    "pk": 1,
+    "fields": {
+        "name": "APC",
+        "slug": "apc"
+    }
+},
+{
+    "model": "dcim.manufacturer",
+    "pk": 2,
+    "fields": {
+        "name": "Cisco",
+        "slug": "cisco"
+    }
+},
+{
+    "model": "dcim.manufacturer",
+    "pk": 3,
+    "fields": {
+        "name": "Dell",
+        "slug": "dell"
+    }
+},
+{
+    "model": "dcim.manufacturer",
+    "pk": 4,
+    "fields": {
+        "name": "HP",
+        "slug": "hp"
+    }
+},
+{
+    "model": "dcim.manufacturer",
+    "pk": 5,
+    "fields": {
+        "name": "Juniper",
+        "slug": "juniper"
+    }
+},
+{
+    "model": "dcim.manufacturer",
+    "pk": 6,
+    "fields": {
+        "name": "Arista",
+        "slug": "arista"
+    }
+},
+{
+    "model": "dcim.manufacturer",
+    "pk": 7,
+    "fields": {
+        "name": "Opengear",
+        "slug": "opengear"
+    }
+},
+{
+    "model": "dcim.manufacturer",
+    "pk": 8,
+    "fields": {
+        "name": "Super Micro",
+        "slug": "super-micro"
+    }
+},
+{
+    "model": "dcim.platform",
+    "pk": 1,
+    "fields": {
+        "name": "Cisco IOS",
+        "slug": "cisco-ios",
+        "rpc_client": "cisco-ios"
+    }
+},
+{
+    "model": "dcim.platform",
+    "pk": 2,
+    "fields": {
+        "name": "Cisco NX-OS",
+        "slug": "cisco-nx-os",
+        "rpc_client": ""
+    }
+},
+{
+    "model": "dcim.platform",
+    "pk": 3,
+    "fields": {
+        "name": "Juniper Junos",
+        "slug": "juniper-junos",
+        "rpc_client": "juniper-junos"
+    }
+},
+{
+    "model": "dcim.platform",
+    "pk": 4,
+    "fields": {
+        "name": "Arista EOS",
+        "slug": "arista-eos",
+        "rpc_client": ""
+    }
+},
+{
+    "model": "dcim.platform",
+    "pk": 5,
+    "fields": {
+        "name": "Linux",
+        "slug": "linux",
+        "rpc_client": ""
+    }
+},
+{
+    "model": "dcim.platform",
+    "pk": 6,
+    "fields": {
+        "name": "Opengear",
+        "slug": "opengear",
+        "rpc_client": "opengear"
+    }
+}
+]

+ 125 - 0
netbox/ipam/fixtures/initial_data.json

@@ -0,0 +1,125 @@
+[
+{
+    "model": "ipam.aggregate",
+    "pk": 1,
+    "fields": {
+        "created": "2016-08-01",
+        "last_updated": "2016-08-01T15:22:20.938Z",
+        "family": 4,
+        "prefix": "10.0.0.0/8",
+        "rir": 6,
+        "date_added": null,
+        "description": "Private IPv4 space"
+    }
+},
+{
+    "model": "ipam.aggregate",
+    "pk": 2,
+    "fields": {
+        "created": "2016-08-01",
+        "last_updated": "2016-08-01T15:22:32.679Z",
+        "family": 4,
+        "prefix": "172.16.0.0/12",
+        "rir": 6,
+        "date_added": null,
+        "description": "Private IPv4 space"
+    }
+},
+{
+    "model": "ipam.aggregate",
+    "pk": 3,
+    "fields": {
+        "created": "2016-08-01",
+        "last_updated": "2016-08-01T15:22:42.289Z",
+        "family": 4,
+        "prefix": "192.168.0.0/16",
+        "rir": 6,
+        "date_added": null,
+        "description": "Private IPv4 space"
+    }
+},
+{
+    "model": "ipam.rir",
+    "pk": 1,
+    "fields": {
+        "name": "ARIN",
+        "slug": "arin"
+    }
+},
+{
+    "model": "ipam.rir",
+    "pk": 2,
+    "fields": {
+        "name": "RIPE",
+        "slug": "ripe"
+    }
+},
+{
+    "model": "ipam.rir",
+    "pk": 3,
+    "fields": {
+        "name": "APNIC",
+        "slug": "apnic"
+    }
+},
+{
+    "model": "ipam.rir",
+    "pk": 4,
+    "fields": {
+        "name": "LACNIC",
+        "slug": "lacnic"
+    }
+},
+{
+    "model": "ipam.rir",
+    "pk": 5,
+    "fields": {
+        "name": "AFRINIC",
+        "slug": "afrinic"
+    }
+},
+{
+    "model": "ipam.rir",
+    "pk": 6,
+    "fields": {
+        "name": "RFC 1918",
+        "slug": "rfc-1918"
+    }
+},
+{
+    "model": "ipam.role",
+    "pk": 1,
+    "fields": {
+        "name": "Production",
+        "slug": "production",
+        "weight": 1000
+    }
+},
+{
+    "model": "ipam.role",
+    "pk": 2,
+    "fields": {
+        "name": "Development",
+        "slug": "development",
+        "weight": 1000
+    }
+},
+{
+    "model": "ipam.role",
+    "pk": 3,
+    "fields": {
+        "name": "Management",
+        "slug": "management",
+        "weight": 1000
+    }
+},
+{
+    "model": "ipam.role",
+    "pk": 4,
+    "fields": {
+        "name": "Backup",
+        "slug": "backup",
+        "weight": 1000
+    }
+}
+]

+ 42 - 0
netbox/secrets/fixtures/initial_data.json

@@ -0,0 +1,42 @@
+[
+{
+    "model": "secrets.secretrole",
+    "pk": 1,
+    "fields": {
+        "name": "Login Credentials",
+        "slug": "login-credentials",
+        "users": [],
+        "groups": []
+    }
+},
+{
+    "model": "secrets.secretrole",
+    "pk": 2,
+    "fields": {
+        "name": "RADIUS Key",
+        "slug": "radius-key",
+        "users": [],
+        "groups": []
+    }
+},
+{
+    "model": "secrets.secretrole",
+    "pk": 3,
+    "fields": {
+        "name": "SNMPv2 Community",
+        "slug": "snmpv2-community",
+        "users": [],
+        "groups": []
+    }
+},
+{
+    "model": "secrets.secretrole",
+    "pk": 4,
+    "fields": {
+        "name": "SNMPv3 Credentials",
+        "slug": "snmpv3-credentials",
+        "users": [],
+        "groups": []
+    }
+}
+]