Skip to content

Commit 02ad766

Browse files
authored
Merge pull request #744 from dev-sec/fix_openbsd
Always update Vagrant Boxes before using
2 parents 66a48b4 + b0dff13 commit 02ad766

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

.github/workflows/os_hardening_vm.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ jobs:
5858
path: ansible_collections/devsec/hardening
5959
submodules: true
6060

61+
- name: Update Vagrant Box
62+
run: |
63+
vagrant box update --box ${{ matrix.molecule_distro }} || true
64+
6165
- name: Test with molecule
6266
run: |
6367
molecule --version

.github/workflows/ssh_hardening_bsd.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
path: ansible_collections/devsec/hardening
4848
submodules: true
4949

50+
- name: Update Vagrant Box
51+
run: |
52+
vagrant box update --box generic/${{ matrix.molecule_distro }} || true
53+
5054
- name: Test with molecule
5155
run: |
5256
molecule --version

molecule/os_hardening_vm/prepare.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@
2828
selection: hold
2929
when: ansible_os_family == 'Debian'
3030

31+
# we need to free up space, since the /boot partition in some Vagrant images is
32+
# pretty small and system updates might fail
33+
- name: Find all initrd.img to delete them
34+
ansible.builtin.find:
35+
paths: /boot
36+
patterns: "initrd.img*"
37+
register: find_results
38+
when: ansible_os_family == 'Debian'
39+
40+
- name: Delete all initrd.img to free space on /boot
41+
ansible.builtin.file:
42+
path: "{{ item['path'] }}"
43+
state: absent
44+
with_items: "{{ find_results['files'] }}"
45+
when: ansible_os_family == 'Debian'
46+
3147
- name: Run the equivalent of "apt-get update && apt-get upgrade"
3248
ansible.builtin.apt:
3349
upgrade: safe

0 commit comments

Comments
 (0)