Ansible Module file: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 8: Line 8:


=Create a Directory=
=Create a Directory=
<syntaxhighlight lang='yaml'>
- name: create local storage mount point
  file:
    path: "{{ item }}"
    state: directory
    owner: root
  with_items:
    - "/mnt/ebs0"
  when:
    - inventory_hostname in groups['kube-node']
</syntaxhighlight>

Revision as of 06:44, 12 December 2019

External

Internal

Overview

Manage file, directory and symlinks properties: create, set attributes, remove.

Create a Directory

- name: create local storage mount point
  file:
    path: "{{ item }}"
    state: directory
    owner: root
  with_items:
    - "/mnt/ebs0"
  when:
    - inventory_hostname in groups['kube-node']