Skip to content

Commit

Permalink
Brought over some changes made on the GitLab Repo:
Browse files Browse the repository at this point in the history
Added some new necessary libraries to auto install
Included argument in build file to make sure user is set to "packer"
  • Loading branch information
“Ryan committed Oct 5, 2023
1 parent e359a6b commit aeb6572
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions os_builders/packfiles/build.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ build{
]

provisioner "ansible" {
user = "packer"
playbook_file = "../provision_image.yml"
extra_arguments = [
# Include safety checks
Expand Down
29 changes: 17 additions & 12 deletions os_builders/roles/prep_builder/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
- name: Install required packages
apt:
name: "{{ item }}"
state: present
loop:
- gpg
- make
- git
- qemu-kvm
- libvirt-daemon-system
- libvirt-clients
- libguestfs-tools
- bridge-utils
- virtinst

- name: Add Hashicorp apt key
apt_key:
url: https://apt.releases.hashicorp.com/gpg
Expand All @@ -13,19 +28,8 @@
- name: Install Packer
apt:
name: packer
state: latest

- name: Install required packages
apt:
name: "{{ item }}"
state: present
loop:
- qemu-kvm
- libvirt-daemon-system
- libvirt-clients
- libguestfs-tools
- bridge-utils
- virtinst


- name: Add user to required groups
user:
Expand All @@ -38,6 +42,7 @@

- name: Enable libvirt service
service:
daemon_reload: yes
name: libvirtd
enabled: yes
state: started
Expand Down

0 comments on commit aeb6572

Please sign in to comment.