hashicorp/packer-plugin-ansible

Ansible-remote Extra Vars

Aperta

#20 aperta il 16 apr 2021

 (0 commenti) (0 reazioni) (0 assegnatari)Go (39 fork)auto 404
enhancementgood first issueprovisioner/ansible-remote

Metriche repository

Star
 (64 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

This issue was originally opened by @gamethis as hashicorp/packer#9300. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.

Feature Description

add variable for ansible extra vars to payload.

A written overview of the feature. add option in payload for ansible_extra_vars This would be to seperate and simplify form.

Use Case(s)

today you have to do something like this

  "extra_arguments": ["-vv",
                "-T 1200",
                "--extra-vars",
                "ansible_host_key_checking=False ansible_scp_if_ssh=True ansible_python_interpreter=/usr/bin/python3.6 ansible_ssh_retries=20 ansible_ssh_common_args='-C -o ControlMaster=auto -o ControlPersist=180s -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' ansible_shell_type=powershell ansible_user={{user `ssh_username`}} ansible_password={{user `ssh_password`}} ansible_become_method=runas ansible_become_user=System proxy_addr=thd-svr-proxy.homedepot.com:9090 proxy_bypass=retail.net ansible_shell_executable=None"

            ],

the idea would be to allow the extra vars to be seperated to make for a clearer payload

"extra_arguments": ["-vv",
                "-T 1200",
            ],
            "ansible_extra_vars":[
                "ansible_host_key_checking=False",
                "ansible_scp_if_ssh=True"
                "ansible_python_interpreter=/usr/bin/python3.6"
            ]

Guida contributor