
ansible
小二来碗面
这个作者很懒,什么都没留下…
展开
-
ansible跳板机
首先我先讲讲这个过程,由于从来没接触过跳板机,昨天按照网上的方法设置了一下午和一晚上都没有成功,后来今天早上醒来一想,是不是把ansible主机的公钥也发送到目标机是不是也就OK了?刚才试了一下,果然是啊。。。目的:ssh访问没有公网IP的阿里云服务器(类似于下图)我的场景:ansible主机:192.168.10.150(本地虚拟机)跳板机:跳板机公网IP (具有公网IP的服务器)目标机:172.17.3.155 (和跳板机处于同于内网的服务器)步骤:一、将ansible主机的公钥发送到原创 2020-10-20 09:42:14 · 1196 阅读 · 0 评论 -
ansible各模块的使用
启动:source ./hacking/env-setup查看是否能ping通:ansible all -m pingansible all -m ping -k(输入密码,最好事先建立免密登录)查看用法:ansible-doc -lansible-doc -ping…列举host组:ansible webservers --list使用其他用户登录:ansible webservers -u root -m shell -a “ls /root”#其他用户登录执行(需要先原创 2020-10-02 13:56:45 · 815 阅读 · 0 评论 -
ansible搭建
从源码安装的步骤$ git clone git://github.com/ansible/ansible.git --recursive$ cd ./ansible使用 Bash:$ source ./hacking/env-setup如果没有安装pip, 请先安装对应于你的Python版本的pip:$ sudo easy_install pip以下的Python模块也需要安装 [1]_:$ sudo pip install paramiko PyYAML Jinja2 httplib2 s原创 2020-10-02 10:04:30 · 227 阅读 · 0 评论 -
ansible.cfg
# config file for ansible -- https://ansible.com/# ===============================================# nearly all parameters can be overridden in ansible-playbook# or with command line flags. ansible will read ANSIBLE_CONFIG,# ansible.cfg in the current转载 2020-10-02 10:01:33 · 279 阅读 · 0 评论