一。配密钥先在一台服务器里生成密钥http://406647516.blog.51cto.com/2249087/1921413用ssh-copy-id复制密钥foriin`catahost`;dossh-copy-id-i/root/.ssh/id_rsa.pubroot@$i;doneforiin`catahost`;dossh-copy-id-i/root/.ssh/id_rsa.pub"-p2234root@$i";done此处需要输入各服..
分类:
其他好文 时间:
2017-05-11 14:42:15
阅读次数:
156
importjson
fromcollectionsimportnamedtuple
fromansible.parsing.dataloaderimportDataLoader
fromansible.varsimportVariableManager
fromansible.inventoryimportInventory
fromansible.playbook.playimportPlay
fromansible.executor.task_queue_managerimportTaskQueueMa..
分类:
Windows程序 时间:
2017-05-10 22:01:07
阅读次数:
1536
最近看AnsibleAPI中引用了collections的namedtuple()网上搜了一番后,发现是一个集合模块,提供了多种集合类。In[1]:fromcollectionsimport
CallableHashableMappingnamedtupleValuesView_field_template_itemgetter
ContainerItemsViewMappingViewOrderedDict_abcoll_get_iden..
分类:
编程语言 时间:
2017-05-10 17:51:51
阅读次数:
214
lineinfile模块详解 lineinfile模块类似linux工具中的sed工具,但是网上的文章一般都只有简单的实例,复杂点的的就需要自己摸索了。 下面是我根据实际操作总结出来的lineinfile模块的常见需求方法,分享给大家参考 目录 ansible-doc lineinfile官方文档( ...
分类:
其他好文 时间:
2017-05-10 12:52:03
阅读次数:
309
一。安装软件1.查看是否有安装软件ansiblehost31-mshell-a"rpm-qa|grephttpd"如果显示host31|FAILED|rc=1>>则表示没安装如果显示172.16.10.239|success|rc=0>>httpd-tools-2.2.15-54.el6.centos.x86_64httpd-2.2.15-54.el6.centos.x86_64则表示已安装。2.使用yum模..
分类:
其他好文 时间:
2017-05-09 22:30:12
阅读次数:
200
python3下 import sqlite3 报错: NO module named '_sqlite3' 是因为多版本ptyhon问题,需要重新编译python 步骤如下: ...
分类:
其他好文 时间:
2017-05-09 15:43:08
阅读次数:
275
批量设置主机名系统环境:debian8本机ip:180.76.169.6被管理机:218.60.33.2、218.60.33.3、218.60.33.4、218.60.33.5更新时间:2017-2-271.在/etc/ansible/hosts配置主机信息(主机名需先在hosts设置好)zhaojia@sredev2:~$cat/etc/ansible/hosts#Thisisthedefaultansible‘host..
分类:
其他好文 时间:
2017-05-09 13:46:12
阅读次数:
796
需求:远程在windowsserver2012R2上安装vcredist2008,2010,2012和2013四个版本。首先在ansible的官方文档找了一下看有没有适合的模块直接能使用的。最开始找到的是win_package模块:http://docs.ansible.com/ansible/win_package_module.html,同时看到它给出来的例子.感觉可以..
学习记录:安装配置ansible更新日期:2016-11-30系统环境:centos6.5本机ip:192.168.233.123被管理机ip:192.168.233.124—————————————————————————————————————py版本:默认python2.6ansible版本:ansible1.7.2ansible参数:-m模块名(执..
分类:
其他好文 时间:
2017-05-09 09:33:33
阅读次数:
246
官方文档见 http://docs.ansible.com/ansible/dev_guide/developing_api.html 拿官方的例子修改如下 如果需要统一输出可以重写 ...