Template

Warning

Use at your own risk!!! Commands, procedures etc. described in this page worked for me. That does not mean they will automatically work for you.

Table of contents

Full table of contents

Setup

yum install https://releases.hashicorp.com/vagrant/2.0.0/vagrant_2.0.0_x86_64.rpm

firewall-cmd –permanent –add-service=nfs firewall-cmd –permanent –add-service=mountd firewall-cmd –permanent –add-service=rpc-bind firewall-cmd –reload

On use level:

vagrant plugin list
 vagrant plugin install vagrant-libvirt
 vagrant plugin install vagrant-mutate
 history |grep vagrant | grep plugin

Convert your favorite image:

vagrant mutate /tmp/centos-7.0-x86_64.box libvirt

Config

vagrant init

Simple config:

Vagrant.configure(2) do |config|
  config.vm.box = "rhel7.1"
  config.vm.box_url = "http://content.example.com/puppet3.6/x86_64/dvd/vagrant/rhel-server-libvirt-7.1-1.x86_64.box"
  config.vm.hostname = "sandbox.example.com"
end

ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.configure("2") do |config|
  config.vm.box = "generic/centos7"
  config.vm.hostname = "puppy1.doubtfull.snd"
  config.vm.synced_folder "puppet/ssl", "/var/tmp/puppet_ssl", type: "rsync", owner: "root", group: "root", rsync__rsync_path: "sudo rsync"
  config.vm.provision "shell", inline: <<-SHELL
    echo 'LANG="en_US.UTF-8"' > /etc/locale.conf
    echo "unset PROMPT_COMMAND" >> /root/.bashrc
    echo "10.0.0.165 foreman.doubtfull.snd" >> /etc/hosts
    echo ">> Install needed packages"
    yum install -q -y rsync vim-enhanced bash-completion deltarpm epel-release
    yum -y install https://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
    yum -y install puppet
    rsync -av /var/tmp/puppet_ssl/ /var/lib/puppet/ssl/
  SHELL
  config.vm.provision "puppet_server" do |puppet|
    puppet.puppet_server = 'foreman.doubtfull.snd'
    puppet.options = '--onetime --verbose --waitforcert=10 --no-usecacheonfailure --no-daemonize'
  end
end

Add intructions:

config.vm.provision "shell", inline: <<-SHELL
  sudo cp /home/vagrant/sync/etc/yum.repos.d/* /etc/yum.repos.d
  sudo yum install -y puppet
SHELL

Puppet stuff:

config.vm.provision "puppet_server" do |puppet|
  puppet.puppet_server = 'serverc.lab.example.com'
  puppet.options = '--onetime --verbose --waitforcert=10 --no-usecacheonfailure --no-daemonize'
end

See Also

TBD

TODO

Indices and tables