From 2e5b51cc24b6f6c91e7f969fe14e3adc2d4e80f2 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 21 Apr 2018 23:28:35 +0200 Subject: rename all .yaml to .yml --- roles/ubuntu-ws/tasks/fs.yaml | 99 ------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 roles/ubuntu-ws/tasks/fs.yaml (limited to 'roles/ubuntu-ws/tasks/fs.yaml') diff --git a/roles/ubuntu-ws/tasks/fs.yaml b/roles/ubuntu-ws/tasks/fs.yaml deleted file mode 100644 index 07358b99..00000000 --- a/roles/ubuntu-ws/tasks/fs.yaml +++ /dev/null @@ -1,99 +0,0 @@ ---- -- name: resize root logical volume - lvol: - vg: "{{ inventory_hostname }}" - lv: root - size: "{{ ubuntu_ws_root_fs_size }}" - -- name: create/resize root filesystem - filesystem: - fstype: ext4 - dev: "/dev/mapper/{{ inventory_hostname | replace('-', '--') }}-root" - resizefs: yes - -- name: create/resize home logical volume - lvol: - vg: "{{ inventory_hostname }}" - lv: home - size: "{{ ubuntu_ws_home_fs_size }}" - -- name: create/resize home filesystem - filesystem: - fstype: ext4 - dev: "/dev/mapper/{{ inventory_hostname | replace('-', '--') }}-home" - resizefs: yes - -- name: check if home is already mounted - command: "mountpoint -q /home" - register: home_mounted - check_mode: False - failed_when: False - changed_when: False - -- name: check if there are files in /home - find: - paths: /home - file_type: any - register: home_files - -- name: move existing files to new filesystem - when: home_mounted.rc == 1 and home_files.matched != 0 - block: - - name: create temporary mountpoint (1/2) - tempfile: - state: directory - suffix: mnt-home - register: mnt_home_temp - - - name: create temporary mountpoint (1/2) - file: - state: directory - path: "{{ mnt_home_temp.path }}/mnt" - - - name: temporarly mount new home filesystem - mount: - path: "{{ mnt_home_temp.path }}/mnt" - src: "/dev/mapper/{{ inventory_hostname | replace('-', '--') }}-home" - state: mounted - fstype: ext4 - fstab: "{{ mnt_home_temp.path }}/fstab" - - - name: check if target fs is empty - find: - paths: "{{ mnt_home_temp.path }}/mnt" - file_type: any - register: home_files_target - failed_when: home_files_target.matched > 1 or (home_files_target.matched == 1 and home_files_target.files[0].path != mnt_home_temp.path + "/mnt/lost+found") - - - name: copy all files from old /home to new filesystem - command: "find -maxdepth 1 -exec cp -a {} {{ mnt_home_temp.path }}/mnt/ \\;" - args: - chdir: /home - - - name: remove all files from old /home - file: - path: /home - state: absent - - - name: recreate /home mountpoint - file: - path: /home - state: directory - - - name: umount temporarly mounted home filesystem - mount: - path: "{{ mnt_home_temp.path }}/mnt" - state: unmounted - - - name: remove temporary mountpoint - file: - state: absent - path: "{{ mnt_home_temp.path }}" - -- name: mount home filesystem - mount: - path: /home - src: "/dev/mapper/{{ inventory_hostname | replace('-', '--') }}-home" - state: mounted - fstype: ext4 - opts: nodev -- cgit v1.2.3