【问题标题】:ansible copy config file on each host每个主机上的 ansible 复制配置文件
【发布时间】:2020-09-04 06:15:48
【问题描述】:

我有 2 个带有主机名的虚拟机

bishkek-01
bishkek-02

而且我有 2 个名为

的配置文件
bishkek-01.cfg
bishkek-02.cfg

以及如何将例如 bishkek-01.cfg 复制到 bishkek-01 和 bishkek-02.cfg 到 bishkek-02 vm?使用组变量

【问题讨论】:

    标签: linux ansible administration


    【解决方案1】:

    你可以像这样使用复制模块

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

    【讨论】:

    • @uralsk 很高兴听到这个消息。你可以接受这个答案.. ;)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-23
    • 1970-01-01
    • 2017-05-02
    • 2022-08-18
    • 1970-01-01
    相关资源
    最近更新 更多