Update make-osd-partitions.yml

When ansible do not load the file host_vars/{{ ansible_hostname }}.yml and host_vars/default.yml it will show syntactic err, so add keyword "skip" to fix it. 

Exit the playbook if the user not define devices  in both  host_vars/{{ ansible_hostname }}.yml and host_vars/default.yml
host_vars/default.yml
pull/1336/head
WingKai Ho 2017-03-06 10:33:22 +08:00 committed by GitHub
parent 4cc489f2ba
commit 2861a483d7
1 changed files with 9 additions and 2 deletions

View File

@ -34,8 +34,15 @@
- name: load a variable file for devices partition - name: load a variable file for devices partition
  include_vars: "{{ item }}"   include_vars: "{{ item }}"
  with_first_found:   with_first_found:
- files:
- "host_vars/{{ ansible_hostname }}.yml" - "host_vars/{{ ansible_hostname }}.yml"
- "host_vars/default.yml" - "host_vars/default.yml"
skip: true
- name: exit playbook, if devices not defined
fail:
msg: "devices must be define in host_vars/default.yml or host_vars/{{ ansible_hostname }}.yml"
when: devices is not defined
- name: install sgdisk(gdisk) - name: install sgdisk(gdisk)
package: package: