Bläddra i källkod

current state from 2015-11-29

master
Markus Brecchtel 8 år sedan
incheckning
f2dcb4bf18
4 ändrade filer med 39 tillägg och 0 borttagningar
  1. +1
    -0
      .gitignore
  2. +30
    -0
      tasks/main.yml
  3. +3
    -0
      templates/set_fact-hard_disks.j2
  4. +5
    -0
      vars/main.yml

+ 1
- 0
.gitignore Visa fil

@@ -0,0 +1 @@
*~

+ 30
- 0
tasks/main.yml Visa fil

@@ -0,0 +1,30 @@
---

- name: set default partitions
set_fact:
hard_disks: "{{ _hard_disks }}"

- name: clear all partition table informations from disks
command:
sgdisk
--clear
{{ item.device }}
with_items: "{{ hard_disks }}"
- name: create new partition table information
command:
sgdisk
"--new={{ item.1.partnum }}:{{ item.1.start }}:{{ item.1.end }}"
"--change-name={{ item.1.partnum }}:{{ item.1.name }}"
"--typecode={{ item.1.partnum }}:{{ item.1.typecode }}"
{{ item.0.device }}
with_subelements:
- "{{ hard_disks }}"
- partitions

- name: sync
command: sync
- name: reread partition tables
command: hdparm -z {{ item.device }}
with_items: "{{ hard_disks }}"

+ 3
- 0
templates/set_fact-hard_disks.j2 Visa fil

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

+ 5
- 0
vars/main.yml Visa fil

@@ -0,0 +1,5 @@
_hard_disks: "{{ lookup('template','set_fact-hard_disks.j2') | from_yaml }}"

_hard_disk_default:
partition_label: "{{ default_partition_label }}"
partitions: "{{ default_partitions }}"

Laddar…
Avbryt
Spara