The
"extra_arguments" option appears to be intended to accept
--tags,
--skip-tags, and
--extra-vars command line arguments, but (legal) commas in
--tags or
--skip-tags cause errors during packer build.
This provisioner succeeds:
"provisioners": [{
"type": "ansible-local",
"extra_arguments": "--tags 'php5'",
"inventory_file": "../inventory/packer",
"playbook_dir": "..",
"playbook_file": "../example.yml"
}]
This provisioner fails:
"provisioners": [{
"type": "ansible-local",
"extra_arguments": "--tags 'php5,php-config'",
"inventory_file": "../inventory/packer",
"playbook_dir": "..",
"playbook_file": "../example.yml"
}]
with this error message:
docker: Executing Ansible: cd /tmp/packer-provisioner-ansible-local && ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/packer-provisioner-ansible-local/leadferret.yml --tags 'php5 php-config' -c local -i /tmp/packer-provisioner-ansible-local/packer
docker: ERROR: tag(s) not found in playbook: php5 php-config. possible values: application-env-config,build,common,crons,datadog-agent,deploy,leadferret,node_npm,php-config,php5,rsyslog,rundeck-common,rundeck-datadog-agent-restart,ssl-rds,user-accounts
It's clear that the "extra_arguments" parser is stripping out commas. Is the best way forward to modify the "extra_arguments" parsing to leave commas in-place (possibly breaking option parsing elsewhere), or to add new "tags" and "skip-tags" options that can preserve commas without affecting other parsing?