Skip to content

Commit

Permalink
update ansible docs to remove references to WinRMPassword in favor of…
Browse files Browse the repository at this point in the history
… build.Password (#60)
  • Loading branch information
SwampDragons committed Jul 22, 2021
1 parent 8251b71 commit 47cbb43
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 20 deletions.
22 changes: 17 additions & 5 deletions docs-partials/provisioner/ansible-local/Config-not-required.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
not be quoted. Usage example:

```json
"extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ]
"extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ]
```

In certain scenarios where you want to pass ansible command line arguments
that include parameter and value (for example `--vault-password-file pwfile`),
from ansible documentation this is correct format but that is NOT accepted here.
Expand All @@ -23,12 +24,23 @@
If you are running a Windows build on AWS, Azure, Google Compute, or OpenStack
and would like to access the auto-generated password that Packer uses to
connect to a Windows instance via WinRM, you can use the template variable
`{{.WinRMPassword}}` in this option. For example:

```build.Password``` in HCL templates or ```{{ build `Password`}}``` in
legacy JSON templates. For example:

in JSON templates:

```json
"extra_arguments": [
"--extra-vars", "winrm_password={{ .WinRMPassword }}"
]
"extra_arguments": [
"--extra-vars", "winrm_password={{ build `Password`}}"
]
```

in HCL templates:
```hcl
extra_arguments = [
"--extra-vars", "winrm_password=${build.Password}"
]
```

- `group_vars` (string) - A path to the directory containing ansible group
Expand Down
22 changes: 17 additions & 5 deletions docs-partials/provisioner/ansible/Config-not-required.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
not be quoted. Usage example:

```json
"extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ]
"extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ]
```

In certain scenarios where you want to pass ansible command line arguments
that include parameter and value (for example `--vault-password-file pwfile`),
from ansible documentation this is correct format but that is NOT accepted here.
Expand All @@ -23,12 +24,23 @@
If you are running a Windows build on AWS, Azure, Google Compute, or OpenStack
and would like to access the auto-generated password that Packer uses to
connect to a Windows instance via WinRM, you can use the template variable
`{{.WinRMPassword}}` in this option. For example:

```build.Password``` in HCL templates or ```{{ build `Password`}}``` in
legacy JSON templates. For example:

in JSON templates:

```json
"extra_arguments": [
"--extra-vars", "winrm_password={{ .WinRMPassword }}"
]
"extra_arguments": [
"--extra-vars", "winrm_password={{ build `Password`}}"
]
```

in HCL templates:
```hcl
extra_arguments = [
"--extra-vars", "winrm_password=${build.Password}"
]
```

- `ansible_env_vars` ([]string) - Environment variables to set before
Expand Down
22 changes: 17 additions & 5 deletions provisioner/ansible-local/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ type Config struct {
// not be quoted. Usage example:
//
// ```json
// "extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ]
// "extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ]
// ```
//
// In certain scenarios where you want to pass ansible command line arguments
// that include parameter and value (for example `--vault-password-file pwfile`),
// from ansible documentation this is correct format but that is NOT accepted here.
Expand All @@ -47,12 +48,23 @@ type Config struct {
// If you are running a Windows build on AWS, Azure, Google Compute, or OpenStack
// and would like to access the auto-generated password that Packer uses to
// connect to a Windows instance via WinRM, you can use the template variable
// `{{.WinRMPassword}}` in this option. For example:
//
// ```build.Password``` in HCL templates or ```{{ build `Password`}}``` in
// legacy JSON templates. For example:
//
// in JSON templates:
//
// ```json
// "extra_arguments": [
// "--extra-vars", "winrm_password={{ .WinRMPassword }}"
// ]
// "extra_arguments": [
// "--extra-vars", "winrm_password={{ build `Password`}}"
// ]
// ```
//
// in HCL templates:
// ```hcl
// extra_arguments = [
// "--extra-vars", "winrm_password=${build.Password}"
// ]
// ```
ExtraArguments []string `mapstructure:"extra_arguments"`
// A path to the directory containing ansible group
Expand Down
22 changes: 17 additions & 5 deletions provisioner/ansible/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ type Config struct {
// not be quoted. Usage example:
//
// ```json
// "extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ]
// "extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ]
// ```
//
// In certain scenarios where you want to pass ansible command line arguments
// that include parameter and value (for example `--vault-password-file pwfile`),
// from ansible documentation this is correct format but that is NOT accepted here.
Expand All @@ -65,12 +66,23 @@ type Config struct {
// If you are running a Windows build on AWS, Azure, Google Compute, or OpenStack
// and would like to access the auto-generated password that Packer uses to
// connect to a Windows instance via WinRM, you can use the template variable
// `{{.WinRMPassword}}` in this option. For example:
//
// ```build.Password``` in HCL templates or ```{{ build `Password`}}``` in
// legacy JSON templates. For example:
//
// in JSON templates:
//
// ```json
// "extra_arguments": [
// "--extra-vars", "winrm_password={{ .WinRMPassword }}"
// ]
// "extra_arguments": [
// "--extra-vars", "winrm_password={{ build `Password`}}"
// ]
// ```
//
// in HCL templates:
// ```hcl
// extra_arguments = [
// "--extra-vars", "winrm_password=${build.Password}"
// ]
// ```
ExtraArguments []string `mapstructure:"extra_arguments"`
// Environment variables to set before
Expand Down

0 comments on commit 47cbb43

Please sign in to comment.