2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ansibleのドキュメントの読み方

Posted at

TL;DR

公式ドキュメントをちゃんと読むと色々理解できるが、そもそも公式ドキュメントをちゃんと読まないことが多いので、改めて読むことで理解が深められるよってことを伝えたい

はじめ方

使い方を調べるとき、ググったり、qiitaなどで調べたりして、公式ドキュメントをちゃんと読まないことがありますよね。
ものによっては公式ドキュメントがなかったり、内容が薄いものもありますが、あるものは読んだ方が理解が深まったりします。

まず、公式ドキュメントはこちらです
https://docs.ansible.com/ansible/latest/」
今回は最新バージョンで見てみましょう。

そして、以下がどう解釈されるか確認してみましょう。state?path?

- name: Ensure the tarball dir exists at {{ hogedir }}
  file:
    path: "{{ hogedir }}"
    state: directory

以下の中からfileを選択します
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/index.html

するとこんな感じで表示されると思います
スクリーンショット 2021-09-17 18.06.36.png

読んでみると「directory」を選択すると、 サブディレクトリも含めて、作成してくれるらしいですね。

まとめ

こんな感じで結構書いてあるのでこんな感じ調べてみると、バージョンにあった書き方などできるのではないでしょうか。
ご参考程度にしてもらえればと思います。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?