From 2967772f6abc483265eca3ce3b48c1114387cc06 Mon Sep 17 00:00:00 2001 From: WingKai Ho Date: Wed, 1 Mar 2017 17:27:57 +0800 Subject: [PATCH] Load a variable file for devices parrition load device partition file in directory host_vars 1) if the user define host_vars/hostname.yml load the devices partition on this file. 2) otherwise load host_vars/default.yml for default --- infrastructure-playbooks/make-osd-partitions.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/infrastructure-playbooks/make-osd-partitions.yml b/infrastructure-playbooks/make-osd-partitions.yml index 6f49124fd..192c3ccbf 100644 --- a/infrastructure-playbooks/make-osd-partitions.yml +++ b/infrastructure-playbooks/make-osd-partitions.yml @@ -1,5 +1,5 @@ --- -# This playbook will make custom partition layout for your osd hosts. +# This playbook will make custom layout for your osd hosts. # You should define `devices` variable for every host. # # For example, in host_vars/hostname1 @@ -30,6 +30,13 @@ - "{{ osd_group_name }}" tasks: + + - name: Load a variable file for devices partition +   include_vars: "{{ item }}" +   with_first_found: + - "host_vars/{{ ansible_hostname }}.yml" + - "host_vars/default.yml" + - name: install sgdisk(gdisk) package: name: gdisk