#yum
需要在vim /etc/ansible/hosts里面给执行的主机配置 远程调用python的路径不知道为什么默认值认识python2.6.6

vim /etc/ansible/hosts
[test] 10.4.90.46 ansible_python_interpreter=/usr/bin/python.old
10.4.90.47 ansible_python_interpreter=/usr/bin/python.old

#yum
安装某个包

ansible test -m yum -a "name=httpd state=latest"

卸载某个包

ansible test -m yum -a "name=httpd state=absent"

删除旧版gcc

yum: name={{ item }} state=removed
with_items:
- gcc
- httpd
- php
- mysql
- httpd
- mariadb
- openssl098e

安装新版gcc编译器

yum: name={{ item }} state=present
with_items:
- gcc
- redhat-lsb-core
- openssh-server
- openssh-clients
- python-devel
- lrzsz
- yum-utils

更新部分版本

yum: name={{ item }} state=latest
with_items:
- libattr
- libstdc++
- pcre
- audit-libs
- libselinux
- elfutils-libelf
- elfutils-libs
- libcap
- pam
- nss-softokn-freebl
- libdb
- libsepol

ansible-yum的更多相关文章

  1. [svc][op]pip安装ansible && yum安装python34

    相对yum安装,pip安装的好处是jinjia版本到了2.8 pip安装ansible Successfully installed MarkupSafe-1.0 PyYAML-3.12 ansibl ...

  2. ansible yum 模块 安装 vsftp

    [root@ftp:/root] > ansible ansible01 -u root -k -m yum -a 'name=vsftpd state=latest' SSH password ...

  3. 通过自制yum源离线安装ansible

    系统环境 --CentOS release 7 python版本--Python 3.5.4   背景:在企业环境中,安装ansible的服务器往往不能访问互联网,简单的下载ansible源码安装,会 ...

  4. 自制yum源离线安装ansible

    适应场景 在实际生产环境中,服务器往往是不能访问互联网,如果简单的下载ansible源码安装,会碰到缺少各种依赖包的问题,因此,推荐制作yum源,然后使用yum安装ansible. 实验环境 模拟可以 ...

  5. ansible 批量安装yum包

    1.首先安装一下ansible yum install ansible 2.修改一下ansible的参数以防ssh过去的时候需要首次判断yes  或者no sed -i 's/#host_key_ch ...

  6. ansible使用文档

    假设A机器上安装ansible yum install ansible vim /etc/ansible/hosts 对每个主机加key认证ssh-copy-id -i ~/.ssh/id_rsa.p ...

  7. ansible非root用户批量修改root密码

    前言: 由于线上服务器密码长久没有更新,现领导要求批量更换密码.线上的之前部署过salt,但由于各种因素没有正常使用. 使用自动化工具批量修改的计划搁浅了,后来领导给了个python多线程修改密码脚本 ...

  8. ansible 自动化(1)

    安装篇: yum安装 1.安装第三方epel源 centos 6的epel rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-rel ...

  9. 自动化运维工具ansible学习+使用ansible批量推送公钥到远程主机

    目录: 一.ansible简介 1.1.ansible是什么 1.2.ansible如何工作 1.3.ansible优缺点 1.4.ansible安装方式 1.5.ansible文件简单介绍 1.6. ...

  10. ansible 安装使用

    ansible ansible源码安装 yum -y install python-jinja2 PyPAML python-parmiko python-babel python-crypto ta ...

随机推荐

  1. php5.3之命名空间

    在php5.3之后,php像c++那样新 命名空间. 1.在同一个文件中不能实例化同一个名字相同的类和同时包含两个不同目录下的相同文件,中包含相同的函数和常量.为了解决这个问题,因此引入了命名空间. ...

  2. webpack打包工具的初级使用方法

    这里下载的是webpack的3.8.1版本(新版更新的使用有些问题) 什么是webpack? 他是一个前端资源加载或打包工具,. 资源: img css json等. 下载的话 用 npm webpa ...

  3. Linux 中 IDEA 不能调试(Debug)项目

    问题描述: can't debug project on idea linux. 在Linux 中, IDEA能运行项目,但是点击调试项目,弹出警告.警告内容如下: Required connecto ...

  4. 巧妙解决element-ui下拉框选项过多的问题

    1. 场景描述 不知道你有没有这样的经历,下拉框的选项很多,上万个选项甚至更多,这个时候如果全部把数据放到下拉框中渲染出来,浏览器会卡死,体验会特别不好 用人会说element-ui的select有一 ...

  5. MySQL5.7高版本 疑似内存泄露

    I have an instance running on mysql-5.7.19. However, I found that its physical memory and virtual me ...

  6. HDU 1025:Constructing Roads In JGShining's Kingdom(LIS+二分优化)

    http://acm.hdu.edu.cn/showproblem.php?pid=1025 Constructing Roads In JGShining's Kingdom Problem Des ...

  7. Flink会话窗口测试

    Flink会话窗口测试 一.测试结论: 1.会话窗口的间隔时间和水位线作用一样,表示输出现在时间 - 间隔时间之前所有未结算时间的数据,作用类似于水位线,但是和水位线开闭不一样. 2.会话窗口显示的数 ...

  8. 学Redis这篇就够了

    Redis 简介 Redis 优势 Redis 数据类型 string hash list set Zset 小总结 基本命令 发布订阅 简介 实例 发布订阅常用命令 事务 实例 Redis 事务命令 ...

  9. 串门赛: NOIP2016模拟赛——By Marvolo 丢脸记

    前几天liu_runda来机房颓废,顺便扔给我们一个网址,说这上面有模拟赛,让我们感兴趣的去打一打.一开始还是没打算去看一下的,但是听std说好多人都打,想了一下,还是打一打吧,打着玩,然后就丢脸了. ...

  10. QRowTable表格控件(二)-红涨绿跌

    目录 一.开心一刻 二.概述 三.效果展示 四.任务需求 五.指定列排序 六.排序 七.列对其方式 八.相关文章 原文链接:QRowTable表格控件(二)-红涨绿跌 一.开心一刻 一天,五娃和六娃去 ...