![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ansible
yushi6310
这个作者很懒,什么都没留下…
展开
-
ansible安装操作
环境准备创建redhat7.2或者centos7.2的操作系统环境,建议使用7以后的版本,因为ansible是python编写的,其中依赖的东西很多创建yum源 – 将CentOS-7.2-x86_64-DVD-1511.iso上传到 /home 目录。 # mkdir /mnt/centos # mount -o loop /home/CentOS-7.2-x86_64-原创 2017-09-05 13:17:14 · 671 阅读 · 0 评论 -
ansible技术学习总结
最近因项目需要使用ansible编写自动化部署的脚本,下面做一些小结,目前知涉及到项目中用到的一些东西环境:redhat7.2执行命令ansible-playbook -i host xxx_init.yml ansible的hosts文件[MANAGE:children]#管理节点,分主备MANAGE_PRIMARYMANAGE_BACKUP[MANAGE_PRIMARY]10.1原创 2017-06-11 11:47:50 · 939 阅读 · 0 评论 -
ansible判定文件或者文件夹是否存在
---- name: judge a file or dir is exits shell: ls /home/ ignore_errors: True register: result- shell: echo "file exit" when: result|succeeded- shell: echo "file not exit" when: result|failed原创 2017-11-30 19:18:08 · 21693 阅读 · 2 评论 -
ansible-playbook设置java环境变量后不生效解决方法
ansible playbook脚本中有安装jdk操作,并且设置环境变量后且source了 /etc/profile文件,还会提示没有JAVA_HOME 代码如下:- name: check jdk variable shell: cat /etc/profile register: result#jdk_version 在变量文件中有定义- name: jdk variable co原创 2017-12-01 09:15:30 · 8357 阅读 · 0 评论