Skip to content

Commit

Permalink
docs: technical debt
Browse files Browse the repository at this point in the history
- General cleanup of the documentation.
- Standardize heading for Required and Optional.
- Standardize headings for HCL and JSON.
- Standardize leading with HCL examples.
- Format for cleanliness.
- Moves `builder/vsphere/examples/` to `examples/`.

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
tenthirtyam authored and lbajolet-hashicorp committed May 28, 2024
1 parent 9989aea commit 8951b15
Show file tree
Hide file tree
Showing 41 changed files with 181 additions and 370 deletions.
51 changes: 30 additions & 21 deletions .web-docs/components/builder/vsphere-clone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,27 @@ disk controller plus the new configured ones.

<!-- Code generated from the comments of the DiskConfig struct in builder/vsphere/common/storage_config.go; DO NOT EDIT MANUALLY -->

The following example that will create a 15GB and a 20GB disk on the virtual machine.
The second disk will be thin provisioned:
The following example that will create a 15GB and a 20GB disk on the virtual
machine. The second disk will be thin provisioned:

HCL Example:

```hcl
storage {
disk_size = 15000
}
storage {
disk_size = 20000
disk_thin_provisioned = true
}
```

JSON Example:

```json

"storage": [
{
"disk_size": 15000
Expand All @@ -149,35 +152,40 @@ JSON Example:
"disk_thin_provisioned": true
}
],

```

The following example will use two PVSCSI controllers and two disks on each controller.
The following example will use two PVSCSI controllers and two disks on each
controller.

HCL Example:

```hcl
disk_controller_type = ["pvscsi", "pvscsi"]
storage {
disk_size = 15000,
disk_controller_index = 0
}
storage {
disk_size = 15000
disk_controller_index = 0
}
storage {
disk_size = 15000
disk_controller_index = 1
}
storage {
disk_size = 15000
disk_controller_index = 1
}
disk_controller_type = ["pvscsi", "pvscsi"]
storage {
disk_size = 15000,
disk_controller_index = 0
}
storage {
disk_size = 15000
disk_controller_index = 0
}
storage {
disk_size = 15000
disk_controller_index = 1
}
storage {
disk_size = 15000
disk_controller_index = 1
}
```

JSON Example:

```json

"disk_controller_type": ["pvscsi", "pvscsi"],
"storage": [
{
Expand All @@ -197,6 +205,7 @@ JSON Example:
"disk_controller_index": 1
}
],

```

<!-- End of code generated from the comments of the DiskConfig struct in builder/vsphere/common/storage_config.go; -->
Expand Down Expand Up @@ -1659,7 +1668,7 @@ HCL Example:

```hcl
content_library_destination {
library = "Example Content Library"
library = "Example Content Library"
}
```

Expand Down
57 changes: 33 additions & 24 deletions .web-docs/components/builder/vsphere-iso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ their respective End of General Support dates. For detailed information, refer t

## Examples

- Basic examples are available in the [examples](https://github.com/hashicorp/packer-plugin-vsphere/tree/main/builder/vsphere/examples/)
directory of the GitHub repository.
- Basic examples are available in the [examples](https://github.com/hashicorp/packer-plugin-vsphere/tree/main/examples/)
directory of the GitHub repository.

- Additional examples are available in the [`vmware-samples/packer-examples-for-vsphere`](https://github.com/vmware-samples/packer-examples-for-vsphere)
GitHub repository maintained by VMware by Broadcom.
GitHub repository maintained by VMware by Broadcom.

## Configuration Reference

Expand Down Expand Up @@ -264,7 +264,7 @@ wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/foo/bar/preseed.cfg
ESXi host, run the following PowerShell command using `VMware.PowerCLI`:

```powershell
Connect-VIServer -Server "vcenter.example.com" -User "administrator@vsphere" -Password "password"
Connect-VIServer -Server "vcenter.example.com" -User "administrator@vsphere.local" -Password "password"
$esxiHost = Get-VMHost -Name "esxi-01.example.com"
$environmentBrowser = Get-View -Id $esxiHost.ExtensionData.Parent.ExtensionData.ConfigManager.EnvironmentBrowser
$vmxVersion = ($environmentBrowser.QueryConfigOptionDescriptor() | Where-Object DefaultConfigOption).Key
Expand Down Expand Up @@ -736,24 +736,27 @@ JSON Example:

<!-- Code generated from the comments of the DiskConfig struct in builder/vsphere/common/storage_config.go; DO NOT EDIT MANUALLY -->

The following example that will create a 15GB and a 20GB disk on the virtual machine.
The second disk will be thin provisioned:
The following example that will create a 15GB and a 20GB disk on the virtual
machine. The second disk will be thin provisioned:

HCL Example:

```hcl
storage {
disk_size = 15000
}
storage {
disk_size = 20000
disk_thin_provisioned = true
}
```

JSON Example:

```json

"storage": [
{
"disk_size": 15000
Expand All @@ -763,35 +766,40 @@ JSON Example:
"disk_thin_provisioned": true
}
],

```

The following example will use two PVSCSI controllers and two disks on each controller.
The following example will use two PVSCSI controllers and two disks on each
controller.

HCL Example:

```hcl
disk_controller_type = ["pvscsi", "pvscsi"]
storage {
disk_size = 15000,
disk_controller_index = 0
}
storage {
disk_size = 15000
disk_controller_index = 0
}
storage {
disk_size = 15000
disk_controller_index = 1
}
storage {
disk_size = 15000
disk_controller_index = 1
}
disk_controller_type = ["pvscsi", "pvscsi"]
storage {
disk_size = 15000,
disk_controller_index = 0
}
storage {
disk_size = 15000
disk_controller_index = 0
}
storage {
disk_size = 15000
disk_controller_index = 1
}
storage {
disk_size = 15000
disk_controller_index = 1
}
```

JSON Example:

```json

"disk_controller_type": ["pvscsi", "pvscsi"],
"storage": [
{
Expand All @@ -811,6 +819,7 @@ JSON Example:
"disk_controller_index": 1
}
],

```

<!-- End of code generated from the comments of the DiskConfig struct in builder/vsphere/common/storage_config.go; -->
Expand Down
34 changes: 18 additions & 16 deletions .web-docs/components/builder/vsphere-supervisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ their respective End of General Support dates. For detailed information, refer t

## Examples

Examples are available in the [examples](https://github.com/hashicorp/packer-plugin-vsphere/tree/main/builder/vsphere/examples/)
Examples are available in the [examples](https://github.com/hashicorp/packer-plugin-vsphere/tree/main/examples/)
directory of the GitHub repository.

HCL Example:
Expand Down Expand Up @@ -358,8 +358,8 @@ Content of `cleanup-playbook.yml`:
group: root
mode: "{{ item.mode }}"
loop:
- { path: /etc/machine-id, state: absent, mode: "0644" }
- { path: /etc/machine-id, state: touch, mode: "0644" }
- { path: /etc/machine-id, state: absent, mode: "0644" }
- { path: /etc/machine-id, state: touch, mode: "0644" }

- name: Truncate audit logs
file:
Expand All @@ -369,20 +369,20 @@ Content of `cleanup-playbook.yml`:
group: utmp
mode: "{{ item.mode }}"
loop:
- { path: /var/log/wtmp, state: absent, mode: "0664" }
- { path: /var/log/lastlog, state: absent, mode: "0644" }
- { path: /var/log/wtmp, state: touch, mode: "0664" }
- { path: /var/log/lastlog, state: touch, mode: "0644" }
- { path: /var/log/wtmp, state: absent, mode: "0664" }
- { path: /var/log/lastlog, state: absent, mode: "0644" }
- { path: /var/log/wtmp, state: touch, mode: "0664" }
- { path: /var/log/lastlog, state: touch, mode: "0644" }

- name: Remove cloud-init lib dir and logs
file:
state: absent
path: "{{ item }}"
loop:
- /var/lib/cloud
- /var/log/cloud-init.log
- /var/log/cloud-init-output.log
- /var/run/cloud-init
- /var/lib/cloud
- /var/log/cloud-init.log
- /var/log/cloud-init-output.log
- /var/run/cloud-init

- name: Truncate all remaining log files in /var/log
shell:
Expand All @@ -399,9 +399,9 @@ Content of `cleanup-playbook.yml`:
depth: 1
file_type: any
paths:
- /tmp
- /var/tmp
pattern: '*'
- /tmp
- /var/tmp
pattern: "*"
register: temp_files

- name: Reset temp space
Expand All @@ -415,6 +415,8 @@ Content of `cleanup-playbook.yml`:
state: absent
path: "{{ item.path }}"
loop:
- { path: /root/.bash_history }
- { path: "/home/{{ ansible_env.SUDO_USER | default(ansible_user_id) }}/.bash_history" }
- { path: /root/.bash_history }
- {
path: "/home/{{ ansible_env.SUDO_USER | default(ansible_user_id) }}/.bash_history",
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ the virtual machine as a template and moves it to your specified path.
their respective End of General Support dates. For detailed information, refer to the
[Broadcom Product Lifecycle](https://support.broadcom.com/group/ecx/productlifecycle).

## Examples

Examples are available in the [examples](https://github.com/hashicorp/packer-plugin-vsphere/tree/main/examples/)
directory of the GitHub repository.

## Configuration Reference

The following configuration options are available for the post-processor.
Expand Down
7 changes: 6 additions & 1 deletion .web-docs/components/post-processor/vsphere/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ The artifact must be a VMX, OVA, or OVF file.
their respective End of General Support dates. For detailed information, refer to the
[Broadcom Product Lifecycle](https://support.broadcom.com/group/ecx/productlifecycle).

## Examples

Examples are available in the [examples](https://github.com/hashicorp/packer-plugin-vsphere/tree/main/examples/)
directory of the GitHub repository.

## Configuration Reference

The following configuration options are available for the post-processor.
Expand Down Expand Up @@ -146,7 +151,7 @@ JSON Example:
"cluster": "cluster-01",
"datastore": "datastore-01",
"vm_network": "VM Network",
"keep_input_artifact": true,
"keep_input_artifact": true
}
]
]
Expand Down
Loading

0 comments on commit 8951b15

Please sign in to comment.