2016-11-07 14:00:57 +01:00
|
|
|
---
|
|
|
|
# TODO: trouver comment faire une copie initiale de /etc/fstab
|
|
|
|
# TODO: try to use the custom mount_uuid module for a different approach
|
|
|
|
|
|
|
|
- name: Fetch fstab content
|
2016-12-23 22:45:42 +01:00
|
|
|
command: "grep -v '^#' /etc/fstab"
|
2017-03-24 14:15:09 +01:00
|
|
|
check_mode: no
|
2016-11-07 14:00:57 +01:00
|
|
|
register: fstab_content
|
|
|
|
failed_when: False
|
|
|
|
changed_when: False
|
|
|
|
|
2017-04-05 17:50:50 +02:00
|
|
|
- name: /home partition is customized
|
2016-11-07 14:00:57 +01:00
|
|
|
replace:
|
|
|
|
dest: /etc/fstab
|
2017-04-14 12:10:52 +02:00
|
|
|
regexp: '([^#]\s+/home\s+\S+\s+)([a-z,]+)(\s+)'
|
2017-04-05 17:50:50 +02:00
|
|
|
replace: '\1{{ evolinux_fstab_home_options | mandatory }}\3'
|
2016-11-07 14:00:57 +01:00
|
|
|
notify: remount /home
|
2017-04-05 17:50:50 +02:00
|
|
|
when:
|
2017-10-04 14:29:19 +02:00
|
|
|
- fstab_content.stdout | regex_search('\s/home\s')
|
2017-04-05 17:50:50 +02:00
|
|
|
- evolinux_fstab_home
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2017-04-05 17:50:50 +02:00
|
|
|
- name: /tmp partition is customized
|
2016-11-07 14:00:57 +01:00
|
|
|
replace:
|
|
|
|
dest: /etc/fstab
|
2017-04-14 12:10:52 +02:00
|
|
|
regexp: '([^#]\s+/tmp\s+\S+\s+)([a-z,]+)(\s+)'
|
2017-04-05 17:50:50 +02:00
|
|
|
replace: '\1{{ evolinux_fstab_tmp_options | mandatory }}\3'
|
|
|
|
when:
|
2017-10-04 14:29:19 +02:00
|
|
|
- fstab_content.stdout | regex_search('\s/tmp\s')
|
2017-04-05 17:50:50 +02:00
|
|
|
- evolinux_fstab_tmp
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2017-04-05 17:50:50 +02:00
|
|
|
- name: /usr partition is customized
|
2016-11-07 14:00:57 +01:00
|
|
|
replace:
|
|
|
|
dest: /etc/fstab
|
2017-04-14 12:10:52 +02:00
|
|
|
regexp: '([^#]\s+/usr\s+\S+\s+)([a-z,]+)(\s+)'
|
2017-04-05 17:50:50 +02:00
|
|
|
replace: '\1{{ evolinux_fstab_usr_options | mandatory }}\3'
|
|
|
|
when:
|
2017-10-04 14:29:19 +02:00
|
|
|
- fstab_content.stdout | regex_search('\s/usr\s')
|
2017-04-05 17:50:50 +02:00
|
|
|
- evolinux_fstab_usr
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2017-04-05 17:50:50 +02:00
|
|
|
- name: /var partition is customized
|
2016-11-07 14:00:57 +01:00
|
|
|
replace:
|
|
|
|
dest: /etc/fstab
|
2017-04-14 12:10:52 +02:00
|
|
|
regexp: '([^#]\s+/var\s+\S+\s+)([a-z,]+)(\s+)'
|
2017-04-05 17:50:50 +02:00
|
|
|
replace: '\1{{ evolinux_fstab_var_options | mandatory }}\3'
|
2016-11-07 14:00:57 +01:00
|
|
|
notify: remount /var
|
2017-04-05 17:50:50 +02:00
|
|
|
when:
|
2017-10-04 14:29:19 +02:00
|
|
|
- fstab_content.stdout | regex_search('\s/var\s')
|
2017-04-05 17:50:50 +02:00
|
|
|
- evolinux_fstab_var
|
2016-11-07 14:00:57 +01:00
|
|
|
|
|
|
|
- name: /var/tmp is created
|
|
|
|
mount:
|
|
|
|
src: tmpfs
|
2016-12-26 11:36:47 +01:00
|
|
|
name: /var/tmp
|
2016-11-07 14:00:57 +01:00
|
|
|
fstype: tmpfs
|
2017-04-05 17:50:50 +02:00
|
|
|
opts: "{{ evolinux_fstab_var_tmp_options | mandatory }}"
|
2016-11-07 14:00:57 +01:00
|
|
|
state: mounted
|
2017-04-05 17:50:50 +02:00
|
|
|
when:
|
|
|
|
- evolinux_fstab_var_tmp
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2019-07-23 18:18:25 +02:00
|
|
|
- name: /dev/shm is created (Debian 10 and later)
|
|
|
|
mount:
|
|
|
|
src: tmpfs
|
|
|
|
name: /dev/shm
|
|
|
|
fstype: tmpfs
|
|
|
|
opts: "{{ evolinux_fstab_dev_shm_options | mandatory }}"
|
|
|
|
state: mounted
|
|
|
|
when:
|
|
|
|
- evolinux_fstab_dev_shm
|
2020-02-25 10:45:35 +01:00
|
|
|
- ansible_distribution_major_version is version('10', '>=')
|
2019-07-23 18:18:25 +02:00
|
|
|
|
2016-11-07 14:00:57 +01:00
|
|
|
- meta: flush_handlers
|