摘要:
1.磁盘挂载mount模块 1)帮助语法 EXAMPLES: # Before 2.3, option 'name' was used instead of 'path' - name: Mount DVD read-only mount: path: /mnt/dvd #挂载的目录(nfs客户端) 阅读全文
摘要:
1.group模块 1)帮助语法 EXAMPLES: - name: Ensure group "somegroup" exists group: name: somegroup #组名字 state: present #创建用户组 absent #删除用户组 gid: 666 #用户组ID 2)实 阅读全文
摘要:
1. get_url 模块 1)帮助语法 [root@m01 ~]# ansible-doc get_url EXAMPLES: - name: Download foo.conf get_url: url: http://example.com/path/file.conf dest: /etc/ 阅读全文
摘要:
1.yum模块 1)语法帮助 [root@m01 ~]# ansible-doc yum EXAMPLES: - name: install the latest version of Apache yum: name: httpd state: latest name: httpd #服务的名字 阅读全文
摘要:
1.command模块 [root@m01 ~]# ansible 'web01' -m command -a 'free -m' web01 | CHANGED | rc=0 >> total used free shared buff/cache available Mem: 972 110 4 阅读全文
摘要:
1.什么是ad-hoc ad-hoc简而言之就是远程执行“临时命令”,执行完即结束,并不会保存 2.ad-hoc使用场景 比如在多台机器上查看某个进程是否启动,或拷贝指定文件到本地,等等 3.ad-hoc使用 [root@m01 ~]# ansible 'web01' -m shell -a 'fr 阅读全文
摘要:
1)方式一: #ip+端口+用户+密码 [root@m01 ~]# vim /etc/ansible/hosts [web01] 172.16.1.7 ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass='1' [web03] 172 阅读全文