ansible

http://docs.ansible.com/ansible/intro_inventory.html

http://yteraoka.github.io/ansible-tutorial/

copy

Files modules — Ansible Documentation

Ansible ~copyモジュール~ - Qiita

ansible ディレクトリ削除

http://blog.withsin.net/2014/12/22/ansible-remove-directory/

src は、配布元サーバにある ファイルを絶対パスまたは yaml ファイルからの相対パスで指定する。 hosts は ...

lineinfile

https://github.com/yteraoka/ansible-tutorial/wiki/module-lineinfile

?複数行でbackupが上書きされない方法

notify

handler が実行されるタイミングは対象の task 実行後ではなく、 Playbook の最後になります。
また、複数の task から同じ handler が notify されていた場合でも一度だけしか実行されません。

http://d.hatena.ne.jp/akishin999/20130815/1376520672

- name: template configuration file
  template: src=template.j2 dest=/etc/foo.conf
  notify:
     - restart memcached
     - restart apache

http://docs.ansible.com/ansible/playbooks_intro.html

複数のタスクをループさせる

includeもまたwith_itemsでループ可能です。 したがって、次のように記述すればinner-tasks.ymlが2回実行されます。

- include: inner-tasks.yml
 with_items:
    - hoge
    - huga

Ansibleのincludeとloop_varで複数のタスクを適切な変数名でループする | DevelopersIO