Skip to main content

Terraform provider to configure Freebox xDSL/FTTH modems

Project description

WARNING, this project is in an early stage; you should probably not use it yet.

terraform-provider-freebox is a Terraform (0.12) provider for configuring Freeboxes (the xDSL/FTTH modems provided by the French ISP Free).

This modem provides a configuration GUI for NAT configuration, port forwarding, static DHCP leases, etc. and a configuration API with the same capabilities. (The GUI uses the API).

This provider uses the same API to let you configure your Freebox using Terraform’s IaC approach.

It’s licensed under the MIT license. It’s available on the Python package index. Its documentation and its source code are on GitHub.

Questions? Remarks? Bugs? Want to contribute? Open an issue!

https://img.shields.io/github/workflow/status/jacquev6/terraform-provider-freebox/Continuous%20Integration?label=CI&logo=github PyPI PyPI

Quick start

Installation

Install from PyPI:

$ pip install terraform-provider-freebox

Configuration

The configuration API provided by the Freebox uses a token for authentication.

You first need to obtain a token (you’ll have to do that only once). Run the following command and follow its instructions. You’ll have to click on your Freebox’ touch display.

$ terraform-provider-freebox create-token

After creating the token, it will give you a provider section to copy-paste in your Terraform configuration files. It should look like:

provider freebox {
    app_id = "terraform"
    app_token = "9m2KFLflttfuk1h52aiQvna@LWwk%02qPN4Ah3euZpT7YjP!lekb1MmfWR9qL50r"
}

You are responsible for keeping this token safe. If you lose it, you’ll have to create a new one.

You are responsible for keeping this token secret. Ill-intentioned people might use it to hack your network and devices.

Permissions setup

@todo Motivate why permissions have to be added manually. @todo Describe how to add permissions. @todo List what permissions must be added for each datasource and resource.

First test: get your public IP address

Add the following to your Terraform configuration:

data freebox_connection_status connection_status {}

output connection_ipv4 {
    value = data.freebox_connection_status.connection_status.ipv4
}

Then run terraform init and terraform plan. The later should display something like:

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

connection_ipv4 = 82.65.16.120

Data sources

freebox_connection_status

Calls GET /api/v4/connection/ and returns attributes described in ConnectionStatus.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terraform-provider-freebox-0.0.2.tar.gz (7.2 kB view details)

Uploaded Source

File details

Details for the file terraform-provider-freebox-0.0.2.tar.gz.

File metadata

  • Download URL: terraform-provider-freebox-0.0.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for terraform-provider-freebox-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2bbe4b92ca4714ab1dc7b8080b160bcebde1362bc1fc376a4d3cc3275ec476ed
MD5 6f0b952465348192a9f2527a4b0eaa0c
BLAKE2b-256 a6c5fe6820213e792dd819d8fffae51e3dfdf6ce1fdc12da1915a10a8cde1b90

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page