--- - name: "Enable swap partition" command: "swapon /dev/{{ vg_name }}/{{ item.name }}" loop: "{{ lvs }}" when: "'swap' in item.type" tags: - mount - name: "Set swappiness value" sysctl: name: vm.swappiness value: "{{ swapiness }}" state: present tags: - mount - name: "Create mountpoints base dir" file: path: "{{ mount_base_dir }}" state: directory tags: - mount - name: "Create mountpoints" file: path: "{{ item.mount_dir }}" state: directory loop: "{{ lvs }}" when: "item.mount_dir is defined" tags: - mount - name: "Mount partition" mount: path: "{{ item.mount_dir }}" src: "/dev/{{ vg_name }}/{{ item.name }}" fstype: "{{ item.type }}" state: mounted loop: "{{ lvs }}" when: "item.mount_dir is defined" tags: - mount