ansible-playbooks/system/disks.ansible.yml
2024-06-27 21:52:41 +02:00

44 lines
1.1 KiB
YAML

- hosts: localhost
vars_files:
- ../map.yml
tasks:
- name: Install Disks packages
package:
name:
- btrfs-progs
state: present
- name: Append btrfs module
lineinfile:
state: present
path: /etc/modules
insertafter: EOF
line: btrfs
- name: Btrfs mount permission
file:
path: "/btrfs"
owner: root
group: root
mode: '0755'
state: directory
- name: Get ROOT_UUID
shell: |
lsblk -o LABEL,UUID | grep ROOT | awk '{print $2}'
register: root_uuid
run_once: true
- name: Get ESP_UUID
shell: |
lsblk -o LABEL,UUID | grep EFI | awk '{print $2}'
register: esp_uuid
run_once: true
- name: Deploy fstab
template:
src: files/disks_fstab.j2
dest: /etc/fstab
owner: root
group: root
mode: '0644'
vars:
ROOT_UUID: '{{ root_uuid.stdout }}'
ESP_UUID: '{{ esp_uuid.stdout }}'
TIMESTAMP: '{{ start_timestamp }}'
TMPFS_SIZE: '{{ tmpfs_size }}'