Browse Source

current

master
parent
commit
286aaf1b43
6 changed files with 9 additions and 24 deletions
  1. +1
    -2
      tasks/debian.yml
  2. +0
    -8
      tasks/gdisk.yml
  3. +8
    -2
      templates/parted_args.j2
  4. +0
    -3
      templates/set_fact-hard_disks.j2
  5. +0
    -9
      templates/sgdisk_args.j2
  6. +0
    -0
      vars/main.yml

+ 1
- 2
tasks/debian.yml View File

@@ -5,6 +5,5 @@
pkg: "{{ item }}" pkg: "{{ item }}"
state: installed state: installed
with_items: with_items:
#- gdisk
- hdparm - hdparm
- parted
- parted

+ 0
- 8
tasks/gdisk.yml View File

@@ -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"

+ 8
- 2
templates/parted_args.j2 View File

@@ -8,8 +8,14 @@ mkpart
"{{ part.fs_type }}" "{{ part.fs_type }}"
{% endif %} {% endif %}
{% if part.name is defined %} {% if part.name is defined %}
"{{ part.name }}
"{% endif %}
"{{ part.name }}"
{% endif %}
"{{ part.start }}" "{{ part.start }}"
"{{ part.end }}" "{{ 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 %} {% endfor %}

+ 0
- 3
templates/set_fact-hard_disks.j2 View File

@@ -1,3 +0,0 @@
{% for disk in hard_disks %}
- {{ _hard_disk_default | combine(disk) | to_json }}
{% endfor %}

+ 0
- 9
templates/sgdisk_args.j2 View File

@@ -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 }}

+ 0
- 0
vars/main.yml View File


Loading…
Cancel
Save