Skip to content

Commit 0e0b8a6

Browse files
authored
Merge pull request #1323 from Tinyblargon/#1287
Fix broken link and fromat markdown
2 parents c44c9c3 + f36f3df commit 0e0b8a6

File tree

2 files changed

+39
-35
lines changed

2 files changed

+39
-35
lines changed

docs/guides/developer.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
# Overview
1+
# Developer Guide
2+
23
This guide aims to help developers who are new to this project so more people
34
can help investigate any problems they may run into.
45

5-
# Compilation
6+
## Compilation
7+
68
Instructions on how to compile the provider, and cause terraform to use that
79
newly compiled executable, see the
8-
[installation guide](https://github.com/Telmate/terraform-provider-proxmox/blob/new_developer_setup/docs/guides/installation.md#compile-the-executables-with-go).
10+
[installation guide](./installation.md#compile-the-executables-with-go).
911

1012
You may want to specify the namespace and specific path to the plugin to make
1113
sure terraform is getting the correct executable. If you are using the default
1214
example domain as your namespace, it'd look like this:
1315

14-
```
16+
```hcl
1517
terraform {
1618
required_providers {
1719
proxmox = {
@@ -26,15 +28,15 @@ terraform {
2628

2729
After changing that, you'll need to update and upgrade your terraform files:
2830

29-
```
31+
```bash
3032
terraform get -update
3133
terraform init -upgrade
3234
```
3335

3436
And finally, you'll want to check to make sure you only see the v1.0.0 entry
3537
when you look at the providers that terraform reports about.
3638

37-
```
39+
```bash
3840
terraform version
3941
```
4042

@@ -44,11 +46,13 @@ repeatedly, you'll need to know that the hash of the executable is stored in
4446
provisioner or just remove the file entirely before running the usual
4547
terraform get/init commands listed above.
4648

47-
# Debugging
49+
## Debugging
50+
4851
Instructions on how to enable debug logging are located
4952
[here](https://registry.terraform.io/providers/Telmate/proxmox/latest/docs#pm_log_enable).
5053

51-
# Going deeper
54+
## Going deeper
55+
5256
Much of the code for the provider is not actually in this repo. It's in a
5357
library repo called proxmox-api-go. When you build the provider, the build
5458
system will check out a specific commit of that repo to get the code.
@@ -58,7 +62,7 @@ This is controlled by [go.sum](https://github.com/Telmate/terraform-provider-pro
5862
The convention seems to be `Version-Date-CommitHash`. As an example, the
5963
following was commit `31826f2fdc39` that was checked in on 2023-12-07:
6064

61-
```
65+
```go.mod
6266
github.com/Telmate/proxmox-api-go v0.0.0-20231207182448-31826f2fdc39 h1:0MvktdAFWIcc9F4IwQls2Em1F9z2LUZR1fSVm1PkKfM=
6367
github.com/Telmate/proxmox-api-go v0.0.0-20231207182448-31826f2fdc39/go.mod h1:xOwyTd8uC2IiYfmjwCVU2fTTVToFCm9yxJzn4cd7rPw=
6468
```
@@ -68,7 +72,7 @@ statements), you'll want to tell the Go compiler to look in a local directory
6872
for your modified library instead of getting it from github. To do this, you
6973
can add the following line to the end of go.mod:
7074

71-
```
75+
```go.mod
7276
replace "github.com/Telmate/proxmox-api-go" => "../proxmox-api-go"
7377
```
7478

docs/guides/installation.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Automatic Registry Installation
1+
# Installation
2+
3+
This document describes how to install the Terraform provider.
4+
5+
## Automatic Registry Installation
26

37
To install this provider, copy and paste this code into your Terraform configuration (include a version tag).
48

@@ -19,23 +23,23 @@ provider "proxmox" {
1923

2024
Then, run
2125

22-
```shell
23-
$ terraform init
26+
```bash
27+
terraform init
2428
```
2529

26-
# Manual Build & Install
30+
## Manual Build & Install
2731

2832
When developing this provider, it's useful to bootstrap a development as quick as possible. You can use
2933
the [Proxmox VE vagrant VM](https://github.com/rgl/proxmox-ve) project for instance. Check out
3034
the [examples](../../examples/vagrant_example.tf) for a `main.tf` to use.
3135

32-
## How to get terraform to recognize third party provider
36+
### How to get terraform to recognize third party provider
3337

3438
Third-party plugins can be manually installed into the user plugins directory, located
3539
at `%APPDATA%\terraform.d\plugins` on Windows and `~/.terraform.d/plugins` on other systems. Plugins come with
3640
executables that have to be placed in the plugin directory.
3741

38-
## Compile the executables with Go
42+
### Compile the executables with Go
3943

4044
First, clone this repo and cd into the repo's root.
4145

@@ -49,48 +53,45 @@ you want an automated way to do it, look at go.yml in the root of this repo.
4953

5054
Then to compile the provider:
5155

52-
```shell
56+
```bash
5357
make
5458
```
5559

5660
The executable will be in the `./bin` directory.
5761

58-
## Copy executables to plugin directory (Terraform >=0.13)
62+
### Copy executables to plugin directory (Terraform >=0.13)
5963

6064
As of Terraform v0.13, locally-installed, third-party plugins
61-
must [conform to a new filesystem layout](https://github.com/hashicorp/terraform/blob/guide-v0.13-beta/draft-upgrade-guide.md#new-filesystem-layout-for-local-copies-of-providers)
62-
.
65+
must [conform to a new filesystem layout](https://github.com/hashicorp/terraform/blob/guide-v0.13-beta/draft-upgrade-guide.md#new-filesystem-layout-for-local-copies-of-providers).
6366

6467
> Terraform assumes that a provider without an explicit source address belongs to the "hashicorp" namespace on registry.terraform.io, which is not true for your in-house provider. Instead, you can use any domain name under your control to establish a virtual source registry to serve as a separate namespace for your local use.
6568
6669
Use the format: [host.domain]/telmate/proxmox/[version]/[arch].
6770

6871
In our case, we will use `registry.example.com` as our virtual source registry in the following examples.
6972

70-
```shell
73+
```bash
7174
# Uncomment for macOS
7275
# PLUGIN_ARCH=darwin_amd64
7376

74-
$ PLUGIN_ARCH=linux_amd64
77+
PLUGIN_ARCH=linux_amd64
7578

7679
# Create the directory holding the newly built Terraform plugins
77-
$ mkdir -p ~/.terraform.d/plugins/registry.example.com/telmate/proxmox/1.0.0/${PLUGIN_ARCH}
80+
mkdir -p ~/.terraform.d/plugins/registry.example.com/telmate/proxmox/1.0.0/${PLUGIN_ARCH}
7881
```
7982

8083
Then, copy the executables to the directory you just created. You could also use the `make local-dev-install` target.
81-
it's important to note that you aren't required to use a semver, and if you don't, then the path must be altered
82-
accordingly.
84+
It's important to note that you aren't required to use a semver, and if you don't, then the path must be altered accordingly.
8385

84-
```shell
85-
$ cp bin/terraform-provider-proxmox ~/.terraform.d/plugins/registry.example.com/telmate/proxmox/1.0.0/${PLUGIN_ARCH}/
86-
$ ls -al ~/.terraform.d/plugins/registry.example.com/telmate/proxmox/1.0.0/${PLUGIN_ARCH}/
86+
```bash
87+
cp bin/terraform-provider-proxmox ~/.terraform.d/plugins/registry.example.com/telmate/proxmox/1.0.0/${PLUGIN_ARCH}/
88+
ls -al ~/.terraform.d/plugins/registry.example.com/telmate/proxmox/1.0.0/${PLUGIN_ARCH}/
8789
-rwxrwxr-x 1 user user 20352759 Feb 22 21:51 terraform-provider-proxmox_v1.0.0*
8890
```
8991

9092
Add the source to your project's `main.tf` like so:
9193

92-
```
93-
$ cat main.tf
94+
```hcl
9495
terraform {
9596
required_providers {
9697
proxmox = {
@@ -100,16 +101,15 @@ terraform {
100101
}
101102
required_version = ">= 0.14"
102103
}
103-
104-
[...]
104+
# omitted for brevity
105105
```
106106

107107
## Copy executables to plugin directory (Terraform <0.13)
108108

109109
You need to copy these executables to the ~/.terraform.d directory which will also need to have a `plugins` directory
110110
created.
111111

112-
```shell
112+
```bash
113113
mkdir -p ~/.terraform.d/plugins
114114
cp -f bin/terraform-provider-proxmox ~/.terraform.d/plugins
115115
```
@@ -118,8 +118,8 @@ cp -f bin/terraform-provider-proxmox ~/.terraform.d/plugins
118118

119119
Initialize Terraform so that it installs the new plugins:
120120

121-
```
122-
$ terraform init
121+
```bash
122+
terraform init
123123
```
124124

125125
You should see the following marking the successful plugin installation:

0 commit comments

Comments
 (0)