zoukankan      html  css  js  c++  java
  • Ansible Playbooks入门介绍

    1、目录结构

    2、详细目录

    3、主任务文件main.yaml

    主任务文件main.yaml
      - name: print server name and user to remote testbox        # 任务名称
        shell: "echo 'Currently {{  user }} is logging {{ server_name }}' > {{ output }}    
      # shell模块执行命令,变量是iventory/testenv中的 testservers:vars 部分的key/value

    4、任务入口文件deploy.yaml

    5、SSH免密码秘钥认证

     6、部署到目标服务器

    (.py3-a2.5-env) [deploy@ansible test_playbooks]$ ansible-playbook -i inventory/testenv ./deploy.yaml 
    
    PLAY [testservers] *********************************************************************
    
    TASK [Gathering Facts] *****************************************************************
    ok: [test.pso.com]
    
    TASK [testbox : Print Server name and user to remote testbox] **************************
    changed: [test.pso.com]
    
    PLAY RECAP *****************************************************************************
    test.pso.com               : ok=2    changed=1    unreachable=0    failed=0  

  • 相关阅读:
    css 样式表的书写顺序
    强大的动画插件。
    百叶窗特效(用move.js库)
    jq基础
    js动态控制表单表格
    js事件对象
    js事件
    js_DOM操作
    小明年龄、成绩、名次的求解问题
    如何获取亿图中的高质量图片?
  • 原文地址:https://www.cnblogs.com/vincenshen/p/10468046.html
Copyright © 2011-2022 走看看