]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Update make-osd-partitions.yml
authorWingKai Ho <sanguosifang@163.com>
Mon, 6 Mar 2017 02:33:22 +0000 (10:33 +0800)
committerGitHub <noreply@github.com>
Mon, 6 Mar 2017 02:33:22 +0000 (10:33 +0800)
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

infrastructure-playbooks/make-osd-partitions.yml

index 4adc5a64446594b40befbd98eb2457cce5f35a1e..1dd8db7a1b1b00f477c4b9be8d190598e63bfa98 100644 (file)
   - name: load a variable file for devices partition
     include_vars: "{{ item }}"
     with_first_found:
-      - "host_vars/{{ ansible_hostname }}.yml"
-      - "host_vars/default.yml"
+      - files:
+          - "host_vars/{{ ansible_hostname }}.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)
     package: