From ae1d12429363c6cc1fa387508afa26393d36f3c0 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Wed, 11 Oct 2017 21:36:59 +0000 Subject: [PATCH] finally made role working --- tasks/default.yml | 1 + tasks/main.yml | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 tasks/default.yml diff --git a/tasks/default.yml b/tasks/default.yml new file mode 100644 index 0000000..3ae781d --- /dev/null +++ b/tasks/default.yml @@ -0,0 +1 @@ +fstab_file: "{{ root_target_directory | default('') }}/etc/fstab" diff --git a/tasks/main.yml b/tasks/main.yml index ff3a5bb..1b8c2c5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,12 @@ --- +--- -- name: swap +- name: format + command: mkswap -U {{ item.uuid }} {{ item.device }} + with_items: "{{ swap_devices }}" + when: + swap_devices_state == "formated" + +- name: fstab for swap devices mount: name: none src: UUID={{ item.uuid }} @@ -9,4 +15,7 @@ passno: 0 dump: 0 state: present + fstab: "{{ fstab_file }}" with_items: "{{ swap_devices }}" + when: + swap_devices_state == "configured"