Skip to content

Commit

Permalink
Forced provider to libvirt
Browse files Browse the repository at this point in the history
Added ansible_env_vars to speed up the provisioning and eliminate login errors in packer log
Added DEBIAN_FRONTEND="noninteractive" to have cleaner packer logs
  • Loading branch information
ruzickap committed Sep 18, 2016
1 parent b97d401 commit 7a4589b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Vagrantfile-linux.template
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

Vagrant.configure("2") do |config|
config.vm.provider :libvirt do |libvirt|
libvirt.disk_bus = "virtio"
libvirt.nic_model_type = "virtio"
libvirt.video_type = "qxl"
libvirt.graphics_type = "spice"
end

config.vm.provider "libvirt"
#Disable NFS sharing (==> default: Mounting NFS shared folders...)
config.vm.synced_folder ".", "/vagrant", type: "nfs", disabled: true
end
3 changes: 2 additions & 1 deletion my-centos7.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",

"accelerator": "kvm",
"qemuargs": [[ "-display", "gtk" ], [ "-m", "1024M" ]],
"qemuargs": [[ "-display", "gtk" ], [ "-m", "1G" ]],
"boot_wait": "2s",
"boot_command":
[
Expand All @@ -48,6 +48,7 @@
{
"type": "ansible",
"user": "vagrant",
"ansible_env_vars": [ "ANSIBLE_SSH_ARGS='-o ForwardAgent=no -o ControlMaster=auto -o ControlPersist=1h'" ],
"playbook_file": "ansible/main.yml",
"sftp_command": "/usr/libexec/openssh/sftp-server -e"
},
Expand Down
6 changes: 4 additions & 2 deletions my-ubuntu-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",

"accelerator": "kvm",
"qemuargs": [[ "-display", "gtk" ], [ "-m", "1024M" ]],
"qemuargs": [[ "-display", "gtk" ], [ "-m", "1G" ]],
"boot_wait": "2s",
"boot_command":
[
Expand Down Expand Up @@ -57,11 +57,13 @@
},
{
"type": "shell",
"inline": ["sudo apt-get install -y aptitude python"]
"environment_vars": [ "DEBIAN_FRONTEND=noninteractive" ],
"inline": [ "sudo -E apt-get install -y aptitude python" ]
},
{
"type": "ansible",
"user": "vagrant",
"ansible_env_vars": [ "ANSIBLE_SSH_ARGS='-o ForwardAgent=no -o ControlMaster=auto -o ControlPersist=1h'" ],
"playbook_file": "ansible/main.yml"
},
{
Expand Down
1 change: 1 addition & 0 deletions scripts/ubuntu/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash -eux

SSH_USER=${SSH_USERNAME:-vagrant}
export DEBIAN_FRONTEND="noninteractive"

# Make sure udev does not block our network - http://6.ptmc.org/?p=164
echo "==> Cleaning up udev rules"
Expand Down
6 changes: 4 additions & 2 deletions scripts/ubuntu/update.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash -eux

export DEBIAN_FRONTEND="noninteractive"

# Update the box
apt update
apt -y upgrade
apt-get update
apt-get -y upgrade
2 changes: 1 addition & 1 deletion ubuntu-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",

"accelerator": "kvm",
"qemuargs": [[ "-display", "gtk" ], [ "-m", "1024M" ]],
"qemuargs": [[ "-display", "gtk" ], [ "-m", "1G" ]],
"boot_wait": "2s",
"boot_command":
[
Expand Down

0 comments on commit 7a4589b

Please sign in to comment.