Giter Club home page Giter Club logo

terraform-provider-netbox's Introduction

terraform-provider-netbox

Lisence Conventional Commits Build Status Go Report Card

Terraform provider for Netbox.

Requirements

  • General developper tools like make, bash, ...
  • Go 1.15 minimum (to build the provider)
  • Terraform (to use the provider)

Compatibility with Netbox

Version 0.x.y => Netbox 2.8
Version 1.x.y => Netbox 2.9

Building the provider

Clone repository to: $GOPATH/src/github.com/smutel/terraform-provider-netbox

$ mkdir -p $GOPATH/src/github.com/smutel
$ cd $GOPATH/src/github.com/smutel
$ git clone [email protected]:smutel/terraform-provider-netbox.git

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/smutel/terraform-provider-netbox
$ make build

Installing the provider


NOTE

Before changing the version of the provider, please remove the temporary folder .terraform and ~/.terraform.d.


Automatic installation from Terraform 0.13

terraform {
  required_providers {
    netbox = {
      source = "smutel/netbox"
      version = "0.2.1"
    }
  }
}

Manual installation

You can install the provider manually in your global terraform provider folder.

$ export NETBOX_PROVIDER_VERSION=1.0.0
$ mkdir -p ~/.terraform.d/plugins/registry.terraform.io/smutel/netbox/${NETBOX_PROVIDER_VERSION}/linux_amd64
$ cp terraform-provider-netbox_v${NETBOX_PROVIDER_VERSION} ~/.terraform.d/plugins/registry.terraform.io/smutel/netbox/${NETBOX_PROVIDER_VERSION}/linux_amd64/terraform-provider-netbox_v${NETBOX_PROVIDER_VERSION}

Manual installation (to test the compiled version = version 0.0.1)

$ make localinstall
==> Creating folder ~/.terraform.d/plugins/registry.terraform.io/smutel/netbox/0.0.1/linux_amd64
==> Installing provider in this folder

Using the provider

The definition of the provider is optional.
All the parameters could be setup by environment variables.

provider netbox {
  # Environment variable NETBOX_URL
  url = "127.0.0.1:8000"
  
  # Environment variable NETBOX_TOKEN
  token = "c07a2db4adb8b1e7f75e7c4369964e92f7680512"
  
  # Environment variable NETBOX_SCHEME
  scheme = "http"
}

For further information, check this documentation

Contributing to this project

To contribute to this project, please follow the conventional commits rules.

Examples

You can find some examples in the examples folder.
Each example can be executed directly with command terraform init & terraform apply.
You can set different environment variables for your test:

  • NETBOX_URL to define the URL and the port (127.0.0.1:8000 by default)
  • NETBOX_TOKEN to define the TOKEN to access the application (empty by default)
  • NETBOX_SCHEME to define the SCHEME of the URL (https by default)
$ export NETBOX_URL="127.0.0.1:8000"
$ export NETBOX_TOKEN="c07a2db4adb8b1e7f75e7c4369964e92f7680512"
$ export NETBOX_SCHEME="http"
$ cd examples
$ terraform init & terraform apply

Known bugs in external project which can impact this provider

terraform-provider-netbox's People

Contributors

smutel avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.