Ansible Tower Vagrant

From tannerjc wiki
Jump to: navigation, search

Tower is published as a vagrant box here

The box is only published as a virtualbox image and is not usable by default with libvirt.

# get the virtualbox image
vagrant box add ansible/tower
# install the mutate plugin
VAGRANT_DISABLE_STRICT_DEPENDENCY_ENFORCEMENT=1 vagrant plugin install vagrant-mutate
# mutate the box into a libvirt box
vagrant mutate ansible/tower libvirt

Before you can use the box, the vagrantfile needs to be created with a few key settings.

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config| = "ansible/tower"
  config.vm.provider :libvirt do |libvirt|
    # default cpus is 1
    libvirt.cpus = 2
    # default memory is less than a gig
    libvirt.memory = 8096
    # match this value to the same mask set for your vagrant-libvirt 
    # network as listed by virt-manager.
    libvirt.management_network_address = ""
  # nfs config is a PITA.
  config.vm.synced_folder ".", "/vagrant", disabled: true

Spin up the machine

vagrant up --provider=libvirt

Connect to the machine and note the MOTD

[jtanner@jt420 tower]$ vagrant ssh
Ignoring nokogiri- because its extensions are not built.  Try: gem pristine nokogiri --version
Ignoring unf_ext- because its extensions are not built.  Try: gem pristine unf_ext --version
Last login: Thu Jun  7 00:39:01 2018 from

  Welcome to Ansible Tower!

  Log into the web interface here:

    Username: admin
    Password: ######### 

  The documentation for Ansible Tower is available here:

  For help, visit

The url listed is incorrect. Check the ip settings and use that ip instead

[vagrant@localhost ~]$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:62:1b:b1 brd ff:ff:ff:ff:ff:ff
    inet brd scope global noprefixroute dynamic ens4
       valid_lft 2273sec preferred_lft 2273sec
    inet6 fe80::9f26:b82b:5185:a43c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever