Browse Source

do fstab configuration in this role

master
parent
commit
bbb8b7a121
2 changed files with 15 additions and 0 deletions
  1. +1
    -0
      defaults/main.yml
  2. +14
    -0
      tasks/main.yml

+ 1
- 0
defaults/main.yml View File

@@ -1 +1,2 @@
filesystems_state: mounted
fstab_file: "{{ root_target_directory | default('') }}/etc/fstab"

+ 14
- 0
tasks/main.yml View File

@@ -50,3 +50,17 @@
when:
filesystems_state == "mounted" or
filesystems_state == "formated"

- name: fstab
mount:
name: "{{ item.mount_point }}"
src: "{{ (item.uuid is defined | ternary('UUID=','')) + item.uuid | default(item.device) }}"
fstype: "{{ item.fstype }}"
opts: "{{ item.opts | default('defaults') }}"
state: present
fstab: "{{ fstab_file }}"
with_items: "{{ filesystems }}"
when:
filesystems_state == "configured" or
filesystems_state == "mounted" or
filesystems_state == "formated"

Loading…
Cancel
Save