@@ -1,11 +0,0 @@ | |||||
--- | |||||
dependencies: | |||||
- role: static_host_vars | |||||
static_host_vars_filename: partitions | |||||
static_host_vars: | |||||
hard_disks: "{{ hard_disks }}" | |||||
mdraid_devices: "{{ mdraid_devices }}" | |||||
dmcrypt_devices: "{{ dmcrypt_devices }}" | |||||
volume_groups: "{{ volume_groups }}" | |||||
logical_volumes: "{{ logical_volumes }}" | |||||
filesystems: "{{ filesystems }}" |
@@ -0,0 +1,17 @@ | |||||
--- | |||||
- name: host_vars directory | |||||
local_action: | |||||
file | |||||
path={{ playbook_dir }}/host_vars/{{inventory_hostname}} | |||||
state=directory | |||||
- name: host_vars file | |||||
local_action: | |||||
template | |||||
src=host_vars.yml.j2 | |||||
dest={{ playbook_dir }}/host_vars/{{inventory_hostname}}/{{_host_vars_filename}}.yml | |||||
- name: include host_vars | |||||
include_vars: | |||||
dir: "{{ playbook_dir }}/host_vars/{{inventory_hostname}}/" |
@@ -0,0 +1,3 @@ | |||||
--- | |||||
- include: host_vars.yml |
@@ -0,0 +1,5 @@ | |||||
{% 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_nice_yaml }} | |||||
{% else %} | |||||
{{ _host_vars_default | combine( _host_vars ) | to_nice_yaml }} | |||||
{% endif %} |
@@ -1,3 +1,13 @@ | |||||
_host_vars_filename: partitions | |||||
_host_vars: | |||||
hard_disks: "{{ hard_disks }}" | |||||
mdraid_devices: "{{ mdraid_devices }}" | |||||
dmcrypt_devices: "{{ dmcrypt_devices }}" | |||||
volume_groups: "{{ volume_groups }}" | |||||
logical_volumes: "{{ logical_volumes }}" | |||||
filesystems: "{{ filesystems }}" | |||||
filesystem_uuid_namespace: "{{ lookup('pipe','uuid -v4') }}" | filesystem_uuid_namespace: "{{ lookup('pipe','uuid -v4') }}" | ||||
_fs_uuid_root: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' root') }}" | _fs_uuid_root: "{{ lookup('pipe','uuid -v5 '+filesystem_uuid_namespace+' root') }}" | ||||