Skip to content

Instantly share code, notes, and snippets.

@jmyoung jmyoung/Vagrantfile Secret
Created Aug 26, 2016

Embed
What would you like to do?
vagrant with ansible-local example
[defaults]
host_key_checking = no
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes
ansible-example ansible_connection=local
---
- hosts: ansible-example
tasks:
- copy: content="IT WORKS!" dest=/home/vagrant/ansible_runs
...
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# The default ubuntu/xenial64 image has issues with vbguest additions
config.vm.box = "bento/ubuntu-16.04"
# Set memory for the default VM
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
# Configure vbguest auto update options
config.vbguest.auto_update = false
config.vbguest.no_install = false
config.vbguest.no_remote = true
# Configure the hostname for the default machine
config.vm.hostname = "ansible-example"
# Mount this folder as RO in the guest, since it contains secure stuff
config.vm.synced_folder "vagrant", "/vagrant", :mount_options => ["ro"]
# And finally run the Ansible local provisioner
config.vm.provision "ansible_local" do |ansible|
ansible.provisioning_path = "/vagrant/provisioning"
ansible.inventory_path = "inventory"
ansible.playbook = "playbook.yml"
ansible.limit = "all"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.