All Projects → geerlingguy → ansible-role-packer-debian

geerlingguy / ansible-role-packer-debian

Licence: MIT License
Ansible Role - Packer Debian/Ubuntu Configuration for Vagrant VirtualBox

Projects that are alternatives of or similar to ansible-role-packer-debian

Ansible Role Packer rhel
Ansible Role - Packer RHEL/CentOS Configuration for Vagrant VirtualBox
Stars: ✭ 45 (+40.63%)
Mutual labels:  build, packer, virtualbox, box, hashicorp, role
Packer Centos 6
This build has been moved - see README.md
Stars: ✭ 78 (+143.75%)
Mutual labels:  packer, virtualbox, vmware, box, fusion
Packer Ubuntu 1804
This build has been moved - see README.md
Stars: ✭ 101 (+215.63%)
Mutual labels:  packer, virtualbox, vmware, fusion
Packer Boxes
Jeff Geerling's Packer build configurations for Vagrant boxes.
Stars: ✭ 495 (+1446.88%)
Mutual labels:  packer, debian, virtualbox, box
Robox
The tools needed to robotically create/configure/provision a large number of operating systems, for a variety of hypervisors, using packer.
Stars: ✭ 303 (+846.88%)
Mutual labels:  packer, debian, virtualbox, vmware
packer-windows
Windows Templates for Packer: Windows 11, Windows 10, Windows Server 2022, 2019, 2016, also with Docker
Stars: ✭ 1,116 (+3387.5%)
Mutual labels:  packer, virtualbox, vmware
Packer Templates
Packer templates for Vagrant base boxes
Stars: ✭ 471 (+1371.88%)
Mutual labels:  packer, virtualbox, vmware
Osx Vm Templates
macOS templates for Packer and VeeWee.
Stars: ✭ 1,050 (+3181.25%)
Mutual labels:  packer, virtualbox, vmware
Vagrant Boxes
baseboxes build with packer.io for use with vagrant
Stars: ✭ 291 (+809.38%)
Mutual labels:  packer, virtualbox, vmware
Packer Ubuntu 1404
DEPRECATED - Packer Example - Ubuntu 14.04 Vagrant Box using Ansible provisioner
Stars: ✭ 81 (+153.13%)
Mutual labels:  packer, virtualbox, box
Packer Templates
Stars: ✭ 90 (+181.25%)
Mutual labels:  packer, debian, virtualbox
local-hashicorp-stack
Local Hashicorp Stack for DevOps Development without Hypervisor or Cloud
Stars: ✭ 23 (-28.12%)
Mutual labels:  packer, virtualbox, hashicorp
Bento
Packer templates for building minimal Vagrant baseboxes for multiple platforms
Stars: ✭ 3,779 (+11709.38%)
Mutual labels:  packer, virtualbox, vmware
Packer Centos 7
This build has been moved - see README.md
Stars: ✭ 223 (+596.88%)
Mutual labels:  packer, virtualbox, box
docker-hands-on-guide
Hands on guide for docker, k8s cluster lightweight virtualization.
Stars: ✭ 25 (-21.87%)
Mutual labels:  packer, virtualbox, vmware
ansible-role-test-vms
DEPRECATED - A Vagrant configuration to test Ansible roles against a variety of Linux distributions.
Stars: ✭ 42 (+31.25%)
Mutual labels:  virtualbox, vmware, fusion
packer-ubuntu
No description or website provided.
Stars: ✭ 29 (-9.37%)
Mutual labels:  packer, virtualbox, vmware
Packer Build
Packer Automated VM Image and Vagrant Box Builds
Stars: ✭ 199 (+521.88%)
Mutual labels:  packer, debian, virtualbox
packer-centos
Create CentOS images for different hypervisors with Packer
Stars: ✭ 18 (-43.75%)
Mutual labels:  packer, virtualbox, vmware
insaneworks-packer-template
CentOS 7-8 8Stream / AlmaLinux 8 / FreeBSD 12 - 13 x64 + VirtualBox / VMWare for Packer Template + FreeBSD 13 / AlmaLinux 9 + Parallels
Stars: ✭ 38 (+18.75%)
Mutual labels:  packer, virtualbox, vmware

Ansible Role: Packer Debian/Ubuntu Configuration for Vagrant VirtualBox

CI

This role configures Debian/Ubuntu (either minimal or full install) in preparation for it to be packaged as part of a .box file for Vagrant/VirtualBox or Vagrant/Vmware_desktop deployment using Packer.

Requirements

Prior to running this role via Packer, you need to make sure Ansible is installed via a shell provisioner, and that preliminary VM configuration (like adding a vagrant user to the appropriate group and the sudoers file) is complete, generally by using a Kickstart installation file (e.g. ks.cfg) or preseeding with Packer. An example array of provisioners for your Packer .json template looks something like:

"provisioners": [
  {
    "type": "shell",
    "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
    "script": "scripts/ansible.sh"
  },
  {
    "type": "ansible-local",
    "playbook_file": "ansible/main.yml",
    "role_paths": [
      "/Users/jgeerling/Dropbox/VMs/roles/geerlingguy.packer-debian",
    ]
  }
],

The files should contain, at a minimum:

scripts/ansible.sh:

An example for Ubuntu 16.04

#!/bin/bash -eux
# Install Ansible repository and Ansible.
apt -y install software-properties-common
apt-add-repository ppa:ansible/ansible
apt-get update
apt-get install ansible

An example for Debian 8.8

#!/bin/bash -eux
# Install Ansible repository and Ansible.
apt -y install software-properties-common
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
apt -y update
apt -y install ansible

ansible/main.yml:

---
- hosts: all
  sudo: yes
  gather_facts: yes
  roles:
    - geerlingguy.packer-debian

You might also want to add another shell provisioner to run cleanup, erasing free space using dd, but this is not required (it will just save a little disk space in the Packer-produced .box file).

If you'd like to add additional roles, make sure you add them to the role_paths array in the template .json file, and then you can include them in main.yml as you normally would. The Ansible configuration will be run over a local connection from within the Linux environment, so all relevant files need to be copied over to the VM; configuratin for this is in the template .json file. Read more: Ansible Local Provisioner.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

vmware_install_open_vm_tools: false

(VMware only) Using the vmware_install_open_vm_tools variable, you can select what kind of integration components will be installed into the VMware box. The default (false) installs VMware Tools, and not open-vm-tools.

Read more:

Dependencies

None.

Example Playbook

---
- hosts: all
  roles:
    - geerlingguy.packer-debian

License

MIT / BSD

Author Information

This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].