zoukankan      html  css  js  c++  java
  • ARTS-S ansible-playbook

    文件a.yml

    ---
    - hosts: cluster
      remote_user: ksotest
      gather_facts: false
      tasks:
        - name: delete dir if exists
          file:
            state: absent
            path: /home/ksotest/apps/te
        - name: create dir
          file:
            path: /home/ksotest/apps/te
            state: directory
        - name: copy extract_api
          copy:
            src: /home/ksotest/extract_api
            dest: /home/ksotest/apps/te/extract_api
            owner: ksotest
            group: ksotest
            mode: u=rwx,g=rx,o=rx
        - name: copy create config shell
          copy:
            src: /home/ksotest/create_config.sh
            dest: /home/ksotest/apps/te/create_config.sh
            owner: ksotest
            group: ksotest
            mode: u=rwx,g=rx,o=rx
        - name: create config
          shell: /home/ksotest/apps/te/create_config.sh /home/ksotest/apps/te/conf
        - name: copy run_te.sh
          copy:
            src: /home/ksotest/run_te.sh
            dest: /home/ksotest/apps/te/run_te.sh
            owner: ksotest
            group: ksotest
            mode: u=rwx,g=rx,o=rx
    

    执行anible-playbook

    ansible-playbook -i ansible_hosts.cfg a.yml
    

    其中ansible_hosts.cfg的内容为

    [cluster]
    10.0.0.1
    10.0.0.2
    10.0.0.3
    10.0.0.4
    
  • 相关阅读:
    hdu5249
    hdu5673-Robot
    hihoCoder 1033
    simpleOS 1.0
    hdu3511-Prison Break
    单调栈
    关于每次取PC的值为PC+4的问题
    hdu3652
    Linux MySQL5.7.18安装手册
    Linux MySQL5.6.36安装手册
  • 原文地址:https://www.cnblogs.com/zhouyang209117/p/10217039.html
Copyright © 2011-2022 走看看