diff --git a/defaults/main.yml b/defaults/main.yml index 6985c0c..6feab78 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ partitioning_base_profile: bios-gpt -partitioning_raid_profile: auto +partitioning_raid_profile: "{{ ( hard_disks | length > 1 ) | ternary('mirror','single') }}" partitioning_crypt_profile: none hard_disks_scan: false diff --git a/tasks/host_vars.yml b/tasks/host_vars.yml index 9c02a64..d9e44f7 100644 --- a/tasks/host_vars.yml +++ b/tasks/host_vars.yml @@ -9,8 +9,8 @@ - name: host_vars file local_action: template args: - src: host_vars.yml.j2 - dest: "{{ playbook_dir }}/host_vars/{{inventory_hostname}}/{{_host_vars_filename}}.yml" + src: host_vars.yaml.j2 + dest: "{{ playbook_dir }}/host_vars/{{inventory_hostname}}/{{_host_vars_filename}}.yaml" - name: include host_vars include_vars: diff --git a/tasks/raid_profile.yml b/tasks/raid_profile.yml index a334eae..29f6532 100644 --- a/tasks/raid_profile.yml +++ b/tasks/raid_profile.yml @@ -1,10 +1,5 @@ --- -- name: set raid profile to mdraid if more than one disk and to single if one - set_fact: - partitioning_raid_profile: "{{ ( hard_disks | length > 1 ) | ternary('mirror','single') }}" - when: partitioning_raid_profile == 'auto' - - name: load raid profile vars include_vars: file: "raid_profiles/{{partitioning_raid_profile}}.yml" diff --git a/templates/host_vars.yml.j2 b/templates/host_vars.yaml.j2 similarity index 66% rename from templates/host_vars.yml.j2 rename to templates/host_vars.yaml.j2 index 78bf958..ee4195c 100644 --- a/templates/host_vars.yml.j2 +++ b/templates/host_vars.yaml.j2 @@ -1 +1 @@ -{% if ("host_vars/"+inventory_hostname+'/'+_host_vars_filename+'.yml') | is_file %}{{ _host_vars_default | combine( lookup('file','host_vars/'+inventory_hostname+'/'+_host_vars_filename+'.yml') | from_yaml ) | combine( _host_vars | to_json | from_json ) | to_nice_yaml }}{% else %}{{ _host_vars_default | combine( _host_vars | to_json | from_json ) | to_nice_yaml }}{% endif %} +{% if ("host_vars/"+inventory_hostname+'/'+_host_vars_filename+'.yaml') is file %}{{ _host_vars_default | combine( lookup('file','host_vars/'+inventory_hostname+'/'+_host_vars_filename+'.yaml') | from_yaml ) | combine( _host_vars | to_json | from_json ) | to_nice_yaml }}{% else %}{{ _host_vars_default | combine( _host_vars | to_json | from_json ) | to_nice_yaml }}{% endif %} diff --git a/vars/profile.yml b/vars/profile.yml index c27999a..aac763e 100644 --- a/vars/profile.yml +++ b/vars/profile.yml @@ -33,9 +33,8 @@ debian_boot_packages: - busybox-static - lvm2 - e2fsprogs - - btrfs-tools + - btrfs-progs - openssh-server - python - console-setup - acpi-support - - bridge-utils