Skip to content

Commit 319a2ec

Browse files
committed
deploy: install packer and vagrant using robertdebock.hashicorp role
1 parent 23a7f81 commit 319a2ec

File tree

2 files changed

+13
-43
lines changed

2 files changed

+13
-43
lines changed

deploy/intellabs/kafl/roles/examples/tasks/template_windows.yml

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,16 @@
33
name: gcc-mingw-w64-x86-64
44
become: true
55

6-
- name: Check hashicorp repo key
7-
ansible.builtin.stat:
8-
path: /usr/share/keyrings/hashicorp-archive-keyring.gpg
9-
register: key_stat
10-
11-
- name: Add Hashicorp repo key
12-
when: not key_stat.stat.exists
13-
block:
14-
- name: Download Hashicorp key
15-
ansible.builtin.get_url:
16-
url: https://apt.releases.hashicorp.com/gpg
17-
dest: /tmp/hashicorp.key
18-
19-
- name: Unpack GPG key
20-
ansible.builtin.shell: set -o pipefail && cat /tmp/hashicorp.key | gpg --batch --yes --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
21-
args:
22-
executable: /bin/bash
23-
become: true
24-
25-
- name: Remove temp file
26-
ansible.builtin.file:
27-
path: /tmp/hashicorp.key
28-
state: absent
29-
30-
- name: Add Hashicorp repository
31-
ansible.builtin.apt_repository:
32-
repo: "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com {{ ansible_lsb.codename }} main"
33-
filename: hashicorp
34-
state: present
35-
become: true
36-
376
- name: Ensure packer and vagrant are installed
38-
ansible.builtin.apt:
39-
name:
40-
- packer
41-
- vagrant
42-
# dependency for vagrant plugins
43-
- ruby-dev
44-
# dependency for vagrant-libvirt
45-
- libvirt-dev
46-
- libvirt-daemon-system
47-
update_cache: true
487
become: true
8+
block:
9+
- name: Ensure packer and vagrant are installed
10+
ansible.builtin.include_role:
11+
name: robertdebock.hashicorp
12+
vars:
13+
hashicorp_products:
14+
- name: packer
15+
- name: vagrant
4916

5017
- name: Install vagrant plugins
5118
ansible.builtin.command: vagrant plugin install vagrant-libvirt vagrant-host-shell
@@ -59,7 +26,7 @@
5926
- name: Ensure /etc/qemu/bridge.conf is configured to allow virbr0
6027
ansible.builtin.lineinfile:
6128
path: /etc/qemu/bridge.conf
62-
line: 'allow virbr0'
29+
line: "allow virbr0"
6330
mode: 0644
6431
group: "{{ ansible_user_id }}"
6532
backup: true
@@ -74,5 +41,5 @@
7441
- name: Ensure qemu-bridge-helper is setuid
7542
ansible.builtin.file:
7643
path: /usr/lib/qemu/qemu-bridge-helper
77-
mode: 'u+s'
44+
mode: "u+s"
7845
become: true

deploy/requirements.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
collections:
22
- source: ./intellabs/kafl
33
type: dir
4+
roles:
5+
- name: robertdebock.hashicorp
6+
version: 3.4.7

0 commit comments

Comments
 (0)