随笔分类 -  自动化运维

摘要:一、supervisor安装: yum install supervisorecho_supervisord_conf > /etc/supervisord.conf 二、生成基础配置:vi /etc/supervisord.conf最后添加两行[include]files = /etc/super 阅读全文
posted @ 2019-11-12 20:37 凯文队长 阅读(1364) 评论(0) 推荐(0)
摘要:expect时用与提供自动交互的工具。比如如果想要用ssh登陆服务器,每次都输入密码你觉得麻烦,那你就可以使用expect来做自动交互,这样的话就不用每次都输入密码了。 先看例子: 解释: 1.#!/usr/bin/expect :需要先安装软件,然后来说明用expect来执行 2.spawn ss 阅读全文
posted @ 2019-03-27 11:18 凯文队长 阅读(331) 评论(0) 推荐(0)
摘要:系统:centos7 一、安装nginx yum install -y nginx yum install -y createrepo 安装建yum源仓库的工具,可以用来建立yum仓库yum install -y yum-plugin-priorities 安装控制yum源更新优先级工具,这个工具可 阅读全文
posted @ 2019-02-02 14:46 凯文队长 阅读(751) 评论(0) 推荐(0)
摘要:if exist C:\Python27 ::空格 ( ::(与if在同一行 echo file %python_exe% exist ) ::空格 else ::空格 ( ::默认安装目录为C:\Python27 ECHO Start to install python-2.7.3.amd64 ) 阅读全文
posted @ 2018-12-18 11:12 凯文队长 阅读(306) 评论(0) 推荐(0)
摘要:@ECHO OFF ::定于初始变量SET python_home=C:\Python27SET python_exe=%python_home%\python.exe ::判断python是否安装if exist %python_exe% ( echo file %python_exe% is e 阅读全文
posted @ 2018-12-18 10:05 凯文队长 阅读(2355) 评论(0) 推荐(0)
摘要:https://github.com/ansible/ansible/raw/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 环境: python2.7 centos7 ansible yum install ansible 一、pyth 阅读全文
posted @ 2018-12-17 15:25 凯文队长 阅读(1712) 评论(0) 推荐(0)
摘要:include_vars: '{{ ansible_os_family }}.yml' tags: always when: ansible_os_family == 'RedHat' tags: yum 阅读全文
posted @ 2018-12-07 14:44 凯文队长 阅读(148) 评论(0) 推荐(0)
摘要:主控机 10.22.0.185 centos7 被控机 10.22.0.186 centos7 一、主控机安装ansible yum install -y ansible 二、主控机生产秘钥 ssh-keygen -t rsa 三、主控机编写ansible文件(这个才是重点) 3.1 取消每次敲命令 阅读全文
posted @ 2018-11-22 15:10 凯文队长 阅读(560) 评论(0) 推荐(0)
摘要:参考另外一篇文章 http://blog.51cto.com/weiweidefeng/1895261 when条件 参考http://blog.51cto.com/breezey/1757593 安装目录: ansible playbook roles/{mysql,nginx,..}/ 目录结构 阅读全文
posted @ 2018-11-21 10:59 凯文队长 阅读(1143) 评论(0) 推荐(1)