Browse Source

infrastructure: mkfs on encrypted mountpoint

keep-around/9896074892078475a2178941c3ad314df54a359b
singuliere 2 years ago
parent
commit
cc540249aa
No known key found for this signature in database GPG Key ID: 900857755EF189C2
  1. 12
      molecule/infrastructure/roles/encrypted_device/tasks/main.yml
  2. 1
      molecule/infrastructure/test-encrypted-volume.yml
  3. 1
      molecule/infrastructure/tests/test_encrypted_volume.py

12
molecule/infrastructure/roles/encrypted_device/tasks/main.yml

@ -52,3 +52,15 @@
fi
register: result
changed_when: '"Changed" in result.stdout'
- name: mkfs.ext4 /dev/mapper/spare
filesystem:
fstype: ext4
dev: /dev/mapper/spare
- name: mount /dev/mapper/spare {{ encrypted_device_mount_point }}
mount:
path: "{{ encrypted_device_mount_point }}"
src: /dev/mapper/spare
fstype: ext4
state: mounted

1
molecule/infrastructure/test-encrypted-volume.yml

@ -4,5 +4,6 @@
roles:
- role: encrypted_device
encrypted_device_mount_point: /opt
become: True

1
molecule/infrastructure/tests/test_encrypted_volume.py

@ -5,6 +5,7 @@ def test_encrypted_volume(host):
cmd = host.run("""
set -xe
test -e /dev/mapper/spare
grep -q /opt /etc/fstab
""")
print(cmd.stdout)
print(cmd.stderr)

Loading…
Cancel
Save