ansible
Posted larlly
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ansible相关的知识,希望对你有一定的参考价值。
fetch实现将多台服务器的同名文件拷贝到本地且不覆盖
--- - hosts: lly user: root gather_facts: no vars: eccpt: - /etc/ceilometer/pipeline.yaml - /etc/ceilometer/ceilometer.conf - /etc/nova/nova.conf - /etc/libvirt/libvirtd.conf tasks: - name: copy needed files fetch: src={{item}} dest=/var/check_back/lly/{{ lookup(‘pipe‘, ‘date +%Y%m%d‘) }}/{{inventory_hostname}}/ flat=yes with_items: - "{{eccpt}}" ansible clm -m fetch -a ‘src=/etc/keep dest=/var/check_back/lly/{{ lookup(‘pipe‘, ‘date +%Y%m%d‘) }}/{{inventory_hostname}}/ flat=yes ‘ ansible -i inventory_all clm -m fetch -a ‘src=/etc/keepalived/keepalived.conf dest=/home/deployer/luoliyu/keepalived/20170908/{{inventory_hostname}}/ flat=yes ‘
ansible -i inventory_all hosts -m fetch -a ‘src=/etc/ceph/ceph.conf dest=/home/onest/luoliyu/config_dir/20170922/{{inventory_hostname}}_ceph.conf flat=yes ‘
以上是关于ansible的主要内容,如果未能解决你的问题,请参考以下文章