ansible git pull

pull

[code lang=text] - hosts: site become: true tasks: - name: git clone astel   git: repo=git@github.com:astail/ansible.git dest={{ tmp }}/astel version=master accept_hostkey=yes   become: false [/code]

これで試す

/tmpにastelをいうディレクトリができて問題なくファイルがおかれている

でgitのほうで修正してもう一度流す 確認してみるとpullされている

ちゃんと読んでないけど毎回持ってきてくれるっぽい とくにpullとか指定しなくてよかった

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

20190206追記

もう少しcertbot例に綺麗に書く

[code lang=text] - name: git clone certbot/certbot git: version: master repo: git@github.com:certbot/certbot dest: "{{ tmp }}/certbot" accept_hostkey: yes become: false ignore_errors: true [/code]