Refactor requirements-dev.txt and remove molecule-vagrant
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
- name: Check for required variables
|
||||
ansible.builtin.fail:
|
||||
msg: "The following variables are required: size, name, key_file_url, mount_point"
|
||||
msg: "The following variables are required: size, name, key_server, mount_point"
|
||||
when:
|
||||
- item.size is not defined
|
||||
- item.name is not defined
|
||||
- item.key_file_url is not defined
|
||||
- item.key_server is not defined
|
||||
- item.mount_point is not defined
|
||||
|
||||
- name: Set required facts
|
||||
@@ -12,7 +12,7 @@
|
||||
encryption_volumes_path: "{{ encryption_volumes_path | default('/var/lib/encrypted_volumes') }}"
|
||||
size: "{{ item.size | default(encryption_volumes_default_size) }}"
|
||||
fstype: "{{ item.fstype | default('ext4') }}"
|
||||
key_file_url: "{{ item.key_file_url }}"
|
||||
key_server: "{{ item.key_server }}"
|
||||
key_file_path: "{{ ansible_env.TMPDIR }}/{{ item.name }}.key"
|
||||
disk_image_path: "{{ encryption_volumes_path }}/{{ item.name }}.img"
|
||||
device_name: "{{ item.name }}_luks"
|
||||
@@ -41,9 +41,14 @@
|
||||
when: disk_image is changed
|
||||
become: true
|
||||
block:
|
||||
- name: Read system id
|
||||
ansible.builtin.command: |
|
||||
read_system_id
|
||||
register: system_id
|
||||
|
||||
- name: Download key file from Key server
|
||||
ansible.builtin.uri:
|
||||
url: "{{ key_file_url }}"
|
||||
url: "{{ key_server }}/{{ system_id.stdout }}"
|
||||
dest: "{{ key_file_path }}"
|
||||
mode: "0600"
|
||||
args:
|
||||
@@ -95,9 +100,7 @@
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
ExecStartPre=/usr/bin/curl -o {{ key_file_path }} "{{ key_file_url }}"
|
||||
ExecStart=/usr/sbin/cryptsetup luksOpen {{ disk_image_path }} {{ device_name }} -d {{ key_file_path }}
|
||||
ExecStartPost=/bin/rm -f {{ key_file_path }}
|
||||
ExecStart=/usr/local/bin/open_volume "{{ key_server }}" {{ disk_image_path }} {{ device_name }}
|
||||
ExecStop=/usr/sbin/cryptsetup close {{ device_name }}
|
||||
|
||||
[Install]
|
||||
|
||||
Reference in New Issue
Block a user