18. Ansibleの外部モジュールの使い方
‣
ansible-docコマンドでモジュールのオプションを確認する
[書式] ansible-doc <モジュール名>
(app) $ ansible-doc file
> FILE
!
!
Sets attributes of files, symlinks, and directories, or removes
files/symlinks/directories. Many other modules support the same
options as the [file] module - including [copy], [template], and
[assemble].
Options (= is mandatory):
!
- force
force the creation of the symlinks in two cases: the source
file does not exist (but will appear later); the destination
exists and a file (so, we need to unlink the "path" file and
create symlink to the "src" file in place of it). (Choices:
yes, no)
<…>
Notes:
!
See also [copy], [template], [assemble]
- file: path=/etc/foo.conf owner=foo group=foo mode=0644
- file: src=/file/to/link/to dest=/path/to/symlink owner=foo group=foo state=link
18