summaryrefslogtreecommitdiffstats
path: root/roles/static_inventory/tasks/checkpoint.yml
blob: c0365bd3d80f199b60d5ba57f62798847dc09448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
- name: check for static inventory dir
  stat:
    path: "{{ inventory_path }}"
  register: stat_inventory_path

- name: create static inventory dir
  file:
    path: "{{ inventory_path }}"
    state: directory
    mode: 0750
  when: not stat_inventory_path.stat.exists

- name: create inventory from template
  template:
    src: inventory.j2
    dest: "{{ inventory_path }}/hosts"