Skip to main content

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.

Release files for terraform-provider-freebox 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terraform-provider-freebox 0.0.2
File Size Uploaded
terraform-provider-freebox-0.0.2.tar.gz 7.2 kB Details

Release files / terraform-provider-freebox-0.0.2.tar.gz

Download URL terraform-provider-freebox-0.0.2.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2bbe4b92ca4714ab1dc7b8080b160bcebde1362bc1fc376a4d3cc3275ec476ed
BLAKE2b-256 checksum
How to use checksums
a6c5fe6820213e792dd819d8fffae51e3dfdf6ce1fdc12da1915a10a8cde1b90
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page