浏览代码

current

master
父节点
当前提交
286aaf1b43
共有 6 个文件被更改,包括 9 次插入24 次删除
  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 查看文件

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

+ 0
- 8
tasks/gdisk.yml 查看文件

@@ -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 查看文件

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

+ 0
- 3
templates/set_fact-hard_disks.j2 查看文件

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

+ 0
- 9
templates/sgdisk_args.j2 查看文件

@@ -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 查看文件


正在加载...
取消
保存