cis-ubuntu-ansible
cis-ubuntu-ansible copied to clipboard
Overwrite provisioning playbook.yml in Vagrantfile
This fixes a problem where, if vagrant provision
is run more than once, the inline script from the Vagrantfile would append the existing contents the playbook.yml
with another copy of the same script. After multiple copies have been redirected to playbook.yml
, a YAML syntax error results. i.e. The following output will come from a second vagrant provision
run:
==> default: ERROR! Syntax Error while loading YAML.
==> default:
==> default:
==> default: The error appears to have been in '/home/vagrant/ansible/roles-ubuntu/playbook.yml': line 6, column 1, but may
==> default: be elsewhere in the file depending on the exact syntax problem.
==> default:
==> default: The offending line appears to be:
==> default:
==> default: - cis
==> default: ---
==> default: ^ here
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
This PR changes the inline script so that playbook.yml
will be overwritten each time vagrant provision
is called.
Coverage decreased (-0.5%) to 87.261% when pulling bd22b651d0632ab03dfecd903fcc67db4b5f085e on joshavant:vagrantfile-provisioning-fix into c346162da0e7a8220b4e54f93b68a650b566dc95 on awailly:master.
@joshavant Thanks for the pull request. While you're at it, could you also change it in the README?
@awailly Was there a reason for appending the new content rather than creating a new file? (This is from the general installation steps we have since the beginning.)