• ansible使用9-Playbooks: Special Topics


    Accelerated Mode

    port 5099
    持续连接30min

    ---
    
    - hosts: all
      accelerate: true
    
      tasks:
    
      - name: some task
        command: echo {{ item }}
        with_items:
        - foo
        - bar
        - baz
    
    # change port
    ---
    
    - hosts: all
      accelerate: true
      # default port is 5099
      accelerate_port: 10000
    
    or
    # /etc/ansible/ansible.cfg
    [accelerate]
    accelerate_port = 5099
    
    accelerate_multi_key = yes
    
    UNIX socket file
    default $ANSIBLE_REMOTE_TEMP/.ansible-accelerate/.local.socket
    

    Asynchronous Actions and Polling

    ---
    - hosts: all
      remote_user: root
    
      tasks:
    
      - name: simulate long running op (15 sec), wait for up to 45 sec, poll every 5 sec
        command: /bin/sleep 15
        async: 45
        poll: 5
    
    ---
    - hosts: all
      remote_user: root
    
      tasks:
    
      - name: simulate long running op, allow to run for 45 sec, fire and forget
        command: /bin/sleep 15
        async: 45
        poll: 0
    
    ---
    # Requires ansible 1.8+
    - name: 'YUM - fire and forget task'
      yum: name=docker-io state=installed
      async: 1000
      poll: 0
      register: yum_sleeper
    
    - name: 'YUM - check on fire and forget task'
      async_status: jid={{ yum_sleeper.ansible_job_id }}
      register: job_result
      until: job_result.finished
      retries: 30
    
  • 相关阅读:
    react 样式继承 属性传递
    react css-in-js
    react 利用高阶组件给页面加上动画
    react路由过渡动画效果
    REACT列表过度
    react 过渡动画组件
    VueJs之计算属性
    VueJs之判断与循环
    VusJs之入门
    MYSQL之数据报表
  • 原文地址:https://www.cnblogs.com/liujitao79/p/4201369.html
Copyright © 2020-2023  润新知