Browse Source

Merge pull request #730 from tomassedovic/always-refresh-hosts

Clear the previous inventory during provisioning
tzumainn 7 years ago
parent
commit
0f7b04e1b4
1 changed files with 8 additions and 0 deletions
  1. 8 0
      roles/static_inventory/tasks/main.yml

+ 8 - 0
roles/static_inventory/tasks/main.yml

@@ -1,4 +1,12 @@
 ---
+- name: Remove any existing inventory
+  file:
+    path: "{{ inventory_path }}/hosts"
+    state: absent
+
+- name: Refresh the inventory
+  meta: refresh_inventory
+
 - name: Generate in-memory inventory
   include: openstack.yml