ansible命令执行模块

- command模块 [执行远程命令]
$ ansible n1 -m command -a 'uname -n' - raw模块 [类似于command模块、支持管道传递]
$ ansible n1 -m raw -a "ifconfig eth0 |sed -n 2p |awk '{print \$2}' |awk -F: '{print \$2}'" - shell模块 [执行远程主机的shell/python脚本]
$ ansible n1 -m shell -a 'bash /root/test.sh' - script模块 [在远程主机执行主控端的shell/python脚本 ] (使用相对路径)
$ ansible n1 -m script -a '/etc/ansible/test.sh

查看模块帮助

ansible-doc shell

[svc]ansible自动化模块的更多相关文章

  1. 10.Python之Ansible自动化运维常用模块

    Ansible中文权威文档:http://www.ansible.com.cn/docs/ Ansible从入门到精通:https://www.bilibili.com/video/av3361175 ...

  2. [Linux]Ansible自动化运维② - 工具与模块

    目录 一.Ansible的工具 1.1 Ansible的工作前提 1.2 Ansible的安装文件 1.3 Ansible的配置文件 1.4 Ansible的相关工具 1.4.1 [帮助工具]Ansi ...

  3. Ansible自动化运维工具及其常用模块

    Ansible自动化运维工具及其常用模块 目录 Ansible自动化运维工具及其常用模块 一.Ansible简介 1. Ansible概述 2. Ansible作用 3. Ansible的工作模块 4 ...

  4. Ansible 自动化运维——剧本(playbook)

    Ansible 自动化运维--剧本(playbook) 1.playbook介绍: playbook是ansible用于配置,部署,和管理被控节点的剧本.通过playbook的详细描述,执行其中的ta ...

  5. Ansible自动化运维工具-上

    [Ansible特点] 1)Ansible与saltstack均是基于Python语言开发的 2)安装使用简单,基于不同插件和模块实现各种软件,平台,版本的管理以及支持虚拟容器多层级的部署 3)不需要 ...

  6. CentOS7系统 ansible自动化部署多台服务器部署

    CentOS7系统 ansible自动化部署多台服务器部署   Ansible工作机制  从图中可以看出ansible分为以下几个部份: 1> Control Node:控制机器2> In ...

  7. ansible 自动化运维

    Ansible 自动化运维 ansible安装epel #yum list all *ansible*#yum install *ansible*#yum info ansible#rpm -ql a ...

  8. ansible自动化

    一,工具与环境介绍   1.1 ansible简介 批量管理服务器的工具 无需部署agent,通过ssh进行管理 流行的自动化运维工具:https://github.com/ansible/ansib ...

  9. ansible自动化运维详细教程及playbook详解

    前言 当下有许多的运维自动化工具( 配置管理 ),例如:Ansible.SaltStack.Puppet.Fabric 等. Ansible 一种集成 IT 系统的配置管理.应用部署.执行特定任务的开 ...

随机推荐

  1. java LimitedThreadPool

    此线程池一直增长,直到上限,增长后不收缩(因为池子里面的线程是永生的).这个keepAliveTime参数设置的为Long.MAX_VALUE,所以池子里面的线程几乎不会因为idle而被termina ...

  2. soapUI pro :INFO:Error getting response for []; javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

    need to configure two for the https address: Step 1 export the certificate from the IE settings opti ...

  3. Knockout学习之组合监控属性

    组合监控属性 顾名思义,就是我们可以将多个属性合并为一个属性.这样在显示的时候就是整体了,并且其中任何一个属性发生改变,这个属性也都会随之发生改变从而更新视图,而这些只需要使用computed函数就可 ...

  4. django之创建第9个项目-管理后台admin

    django之创建第9个项目-管理后台admin配置 1.配置setting文件INSTALLED_APPS = (    'django.contrib.auth',    'django.cont ...

  5. Linux 破坏性修复

    1.备份数据 [root@rhel6 ~]# dd count= + records in + records out bytes ( B) copied, 0.000181577 s, 2.8 MB ...

  6. Inno Setup入门(八)——有选择性的安装文件

    这主要使用[Components]段实现,一个演示的代码如下: [setup] ;全局设置,本段必须 AppName=Test AppVerName=TEST DefaultDirName=" ...

  7. quartz.net 的配置文件资料

    java版本的文档比较全 http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigPlugins.ht ...

  8. 使用jQuery模拟鼠标点击a标签事件

    来源于:https://mo2g.com/view/42/ <html> <head> <meta charset="UTF-8"> <t ...

  9. SQLserver视图修改sql

    语法: alter view dbo.视图名 as 更新后的视图SQL go 举个栗子: 原视图名为YOUR_VIEW其中SQL为:  select * form TableA 更新视图: alter ...

  10. 【C++】不要想当然使用resize

    #include <iostream> // std::cout #include <vector> // std::vector using namespace std; i ...