Ubuntu 18.04 - Ansible Vagrant File for libvert

Ubuntu 18.04 - Ansible Vagrant File

See how to install Vagrant libvert here
Vagrant File
Vagrant.configure("2") do |config|
  ansible_root = ENV['ANSIBLE_ROOT']
  ansible_roles = File.expand_path("roles", ansible_root)
  ansible_conf_file = File.expand_path("ansible.cfg", ansible_root)
  ENV['ANSIBLE_ROLES_PATH'] = "#{ansible_roles}"
  config.vm.box = "generic/ubuntu1804"
  config.vm.provision "ansible" do |ansible|
    if ENV['PLAYBOOK_PATH']
      ansible.playbook = ENV['PLAYBOOK_PATH']
    end

    ansible.verbose = true
    ansible.config_file = ansible_conf_file
    if ENV['INVENTORY_PATH']
      ansible.inventory_path = ENV['INVENTORY_PATH']
    end

    if ENV['LIMIT']
      ansible.limit = ENV['LIMIT']
    end
  end
end
Set Ansible Root
export ANSIBLE_ROOT=~/{..Your Project Location..}/ansible/
Set Environment Variable
export PLAYBOOK_PATH=~/{..Your Project Location..}/ansible/roles/rolename/tests/test.yml
Set Inventory Variable
export INVENTORY_PATH=~/{..Your Project Location..}/ansible/env/
Set Inventory Variable
export LIMIT=unit1
Vagrant up
vagrant up --provision
Vagrant ssh
vagrant ssh
Vagrant destroy
vagrant destroy --force
Note:
See Ubuntu 18.04 Vagrant Install on how to install VirtualBox image.

Comments

Popular posts from this blog

Azure DevOps - Auto Approve PR with PAT

Ubuntu 18.04 - Install Android Emulator

Ansible Module - VMWare Update Guest PCI Device