From 286aaf1b43aa52d9b1ce34f2d09011b07a1e25ab Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Thu, 25 May 2017 00:03:09 +0000 Subject: [PATCH] current --- tasks/debian.yml | 3 +-- tasks/gdisk.yml | 8 -------- templates/parted_args.j2 | 10 ++++++++-- templates/set_fact-hard_disks.j2 | 3 --- templates/sgdisk_args.j2 | 9 --------- vars/main.yml | 0 6 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 tasks/gdisk.yml delete mode 100644 templates/set_fact-hard_disks.j2 delete mode 100644 templates/sgdisk_args.j2 delete mode 100644 vars/main.yml diff --git a/tasks/debian.yml b/tasks/debian.yml index 01d4f0b..a57a8c3 100644 --- a/tasks/debian.yml +++ b/tasks/debian.yml @@ -5,6 +5,5 @@ pkg: "{{ item }}" state: installed with_items: - #- gdisk - hdparm - - parted \ No newline at end of file + - parted diff --git a/tasks/gdisk.yml b/tasks/gdisk.yml deleted file mode 100644 index 7798a0f..0000000 --- a/tasks/gdisk.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- name: write gpt partition table - command: - sgdisk - {{ lookup('template','sgdisk_args.j2') }} - with_items: "{{ hard_disks }}" - when: item.partition_table == "gpt" diff --git a/templates/parted_args.j2 b/templates/parted_args.j2 index bc25938..f0aeee9 100644 --- a/templates/parted_args.j2 +++ b/templates/parted_args.j2 @@ -8,8 +8,14 @@ mkpart "{{ part.fs_type }}" {% endif %} {% if part.name is defined %} -"{{ part.name }} -"{% endif %} +"{{ part.name }}" +{% endif %} "{{ part.start }}" "{{ part.end }}" +{% if part.flags is defined %} +{% set outer_loop = loop %} +{% for flag in part.flags %} +set {{ outer_loop.index }} {{ flag }} on +{% endfor %} +{% endif %} {% endfor %} diff --git a/templates/set_fact-hard_disks.j2 b/templates/set_fact-hard_disks.j2 deleted file mode 100644 index d37c906..0000000 --- a/templates/set_fact-hard_disks.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% for disk in hard_disks %} - - {{ _hard_disk_default | combine(disk) | to_json }} -{% endfor %} diff --git a/templates/sgdisk_args.j2 b/templates/sgdisk_args.j2 deleted file mode 100644 index d9ae376..0000000 --- a/templates/sgdisk_args.j2 +++ /dev/null @@ -1,9 +0,0 @@ ---clear -"--disk-guid={{ item.guid | default('R') }}" -{% for part in item.partitions %} -"--new={{ part.partnum }}:{{ part.start }}:{{ part.end }}" -"--change-name={{ part.partnum }}:{{ part.name }}" -"--typecode={{ part.partnum }}:{{ part.typecode }}" -"--partition-guid={{ part.partnum }}:{{ part.guid | default('R') }}" -{% endfor %} -{{ item.device }} diff --git a/vars/main.yml b/vars/main.yml deleted file mode 100644 index e69de29..0000000