summaryrefslogtreecommitdiff
path: root/roles/ubuntu-ws/tasks/main.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ubuntu-ws/tasks/main.yaml')
-rw-r--r--roles/ubuntu-ws/tasks/main.yaml35
1 files changed, 33 insertions, 2 deletions
diff --git a/roles/ubuntu-ws/tasks/main.yaml b/roles/ubuntu-ws/tasks/main.yaml
index 20a66b5b..5e980483 100644
--- a/roles/ubuntu-ws/tasks/main.yaml
+++ b/roles/ubuntu-ws/tasks/main.yaml
@@ -1,16 +1,47 @@
---
-- name: resize root filesystem
+- name: resize root logical volume
lvol:
vg: "{{ inventory_hostname }}"
lv: root
size: "{{ ubuntu_ws_root_fs_size }}"
-- name: create filesystem
+- 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 /dev/mapper/{{ inventory_hostname | replace('-', '--') }}-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:
+ - debug:
+ msg: "TODO: implement this"
+
# - name: prohibited packages
# template:
# src: prohibited-package.j2