Linux 每个主机上的ansible复制配置文件

Linux 每个主机上的ansible复制配置文件,linux,ansible,administration,Linux,Ansible,Administration,我有一个主机名为2的虚拟机 bishkek-01 bishkek-02 我有两个配置文件,名为 bishkek-01.cfg bishkek-02.cfg 例如,如何将bishkek-01.cfg复制到bishkek-01,将bishkek-02.cfg复制到bishkek-02虚拟机?使用组变量可以像这样使用复制模块 - name: Copying the config file to remote machine copy: src: {{ inventory_ho

我有一个主机名为2的虚拟机

bishkek-01
bishkek-02
我有两个配置文件,名为

bishkek-01.cfg
bishkek-02.cfg

例如,如何将bishkek-01.cfg复制到bishkek-01,将bishkek-02.cfg复制到bishkek-02虚拟机?使用组变量可以像这样使用复制模块

- name: Copying the config file to remote machine
    copy: 
      src: {{ inventory_hostname }}.cfg 
      dest: <Your destination goes here>

@乌拉尔斯克很高兴听到这个消息。你可以接受这个答案;