dmotte / vagrant-ansiblebox

πŸ“¦ Debian Vagrant box with Ansible and Ansible Lint

Home Page:https://app.vagrantup.com/dmotte/boxes/ansiblebox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vagrant-ansiblebox

GitHub Workflow Status Vagrant Cloud

πŸ“¦ Debian Vagrant box with Ansible and Ansible Lint installed via pip with Python 3.

Since Ansible cannot run natively on a Windows host, this Vagrant box can be useful if you need Ansible but you're using Windows on your controller.

πŸ“¦ This box is also on Vagrant Cloud as dmotte/ansiblebox.

Usage

To use this Vagrant box you can take inspiration from the test folder of dmotte/vagrant-dockerbox.

If you want your host SSH identity keys and known_hosts to be available inside the VM, you can mount the host's ~/.ssh directory like this:

config.vm.synced_folder "~/.ssh", "/home/vagrant/.ssh-host",
    mount_options: ["dmode=700,fmode=600"]

Then you'll need to add some directives to the ~/.ssh/config file inside the VM:

config.vm.provision "shell", privileged: false, inline: <<-SHELL
    touch ~/.ssh/config && chmod 600 ~/.ssh/config
    echo "UserKnownHostsFile ~/.ssh-host/known_hosts" >> ~/.ssh/config
    echo -e "Host *\n    IdentityFile ~/.ssh-host/id_ed25519" >> ~/.ssh/config
SHELL

If you want to install additional packages:

config.vm.provision "shell", inline: <<-SHELL
    apt-get update && apt-get install -y rsync
SHELL