[root@ftp:/root]
> ansible ansible01 -u root -k -m shell -a 'hostname'
SSH password:
ansible01 | CHANGED | rc=0 >>
ansible01
[root@ftp:/root]
> ansible ansible01 -u root -k -m shell -a 'uptime'
SSH password:
ansible01 | CHANGED | rc=0 >>
16:11:53 up 2:49, 2 users, load average: 0.00, 0.01, 0.05
[root@ftp:/root]
> ansible ansible01 -u root -k -m shell -a 'free -m'
SSH password:
ansible01 | CHANGED | rc=0 >>
total used free shared buff/cache available
Mem: 1839 119 1259 8 460 1525
Swap: 1023 0 1023

ansible shell模块的更多相关文章

  1. Ansible 常用模块(一)

    一.Ansible简介 Ansible是新出现的自动化运维工具,基于python开发,集合了众多运维工具(puppet(ruby).cfengine.chef.func.fabric.)的优点,实现了 ...

  2. ansible shell 之运行后台程序

    最近在使用ansible shell模块启动一个shell编写的脚本,该脚本主要功能式加载java的classpath并在后台运行这个java程序. 该脚本在linux shell中可以正常启动和停止 ...

  3. ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory

    命令: ansible -i hosts_20 st  -m shell -a 'service zabbix_agentd star'  -K --become ansible -i hosts_2 ...

  4. ansible使用shell模块在受控机上执行命令(ansible2.9.5)

    一,ansible的shell模块和command模块的区别? shell模块:在远程主机上执行主控端发出的shell/python脚本 command模块:不能调用shell指令,没有bash的环境 ...

  5. ansible常见模块

    模块的使用 查看模块帮助 ansible-doc -l 查看所有模块 ansible-doc -s MODULE_NAME 查看指定模块的详细帮助 ansible命令应用基础 语法: ansible ...

  6. ansible常用模块入门

    常用模块有以下几个 command copy shell crond yum service setup 1.command模块 ansible george -m command -a " ...

  7. Linux之ansible 常用模块

    目的 代码发布系统 代码发布:把本地的代码通过某些方式弄到线上,可以供别人访问 部署 前戏 ansible 批量在远程主机上执行命令 puppet ruby ansible saltstack pyt ...

  8. Ansible常用模块介绍及使用(week5_day1_part2)--技术流ken

    Ansible模块 在上一篇博客<Ansible基础认识及安装使用详解(一)--技术流ken>中以及简单的介绍了一下ansible的模块.ansible是基于模块工作的,所以我们必须掌握几 ...

  9. ansible的模块使用说明

    参考官方链接: https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html#parallelism-and-shell-co ...

随机推荐

  1. HTML5学习(一)

    HTML5学习 HTML5的基本结构 <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content ...

  2. Problem 2

    Problem 2 # Problem_2.py """ Each new term in the Fibonacci sequence is generated by ...

  3. python第五周:模块、标准库

    模块相关知识: 定义:用来从逻辑上组织python代码(变量.函数.类.逻辑:实现一个功能)本质就是以.py结尾的python文件(文件名:test.py,对应的模块名:test) 附注:包:是用来从 ...

  4. docker安装tensorflow环境遇到的问题与解决方案

    docker安装 Tensorflow遇到问题i/o timeout. docker: Error response from daemon: Get https://gcr.io/v1/_ping: ...

  5. maven tomcat 插件

    在 pom.xml 中添加如下内容 <!-- 配置 tomcat 插件 --> <build> <plugins> <plugin> <group ...

  6. hdu 1868 水

    #include<stdio.h> int main() { int n,m,i,j,k; while(scanf("%d",&n)!=EOF) { k=2; ...

  7. MSMQ如何设置事务特性

  8. 【解决方法】UITableView 性能优化笔记

    1.网络图片异步载入,SDWebImage. 2.文字直接 drawInRect/drawAtPoint 绘制,參考 ABTableViewCell.AdvancedTableViewCells. 3 ...

  9. 在js在添版本号

    为了增加用户访问网站体验,快速打开网页,许多网站都对不常更新的js,css文件在浏览器端设置了缓存.但如果在服务器端做了更新,浏览器使用的仍是缓存在本地的js文件,除非强制清缓存(ctrl+F5).为 ...

  10. C#、SQL中的事务

    c#方法一: TransactionOptions transactionOption = new TransactionOptions(); //设置事务隔离级别 transactionOption ...