1
我有這樣的重複模式::ansible STAT然後複製with_items
- stat: path={{ home }}/.vimrc
register: st
- copy: src=.vimrc dest={{ home }}/.vimrc
when: not st.stat.exists
- stat: path={{ home }}/.gitconfig
register: st
- copy: src=.vimrc dest={{ home }}/.gitconfig
when: not st.stat.exists
...
我如何使用with_items的大名單做呢?::
with_items:
- .vimrc
- .bashrc
- .profile
- .gitconfig
旁註選項:directory_mode和remote_src。請參閱文檔[Ansible copy options](http://docs.ansible.com/ansible/latest/copy_module.html#options) – Martin