Playbook ディレクトリを作成するサンプル

環境
Ansible
Playbook

操作例
ディレクトリ /etc/cft を作成する
サンプルコード

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
- hosts: linux
gather_facts: no
become: yes
tasks:
- file:
path: /etc/cft
state: directory
mode: 0755
- hosts: linux gather_facts: no become: yes tasks: - file: path: /etc/cft state: directory mode: 0755
- hosts: linux
  gather_facts: no
  become: yes

  tasks:
    - file:
        path: /etc/cft
        state: directory
        mode: 0755

説明
path オプション
ディレクトリ名のパスを指定します。
state オプション
state: directory を指定します。
mode オプション
対象ファイルの mode を指定します。

Ansible

Posted by arkgame