涛子 - 简单就是美

成单纯魁增,永继振国兴,克复宗清政,广开家必升

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2015年1月4日

摘要: ####Accelerated Modeport 5099持续连接30min```yaml---- hosts: all accelerate: true tasks: - name: some task command: echo {{ item }} with_items: ... 阅读全文
posted @ 2015-01-04 16:05 北京涛子 阅读(276) 评论(0) 推荐(0)

摘要: ####Content Organization```bashproduction # inventory file for production serversstage # inventory file for stage e... 阅读全文
posted @ 2015-01-04 15:30 北京涛子 阅读(411) 评论(0) 推荐(0)

摘要: ####Standard Loops####with_items```yaml- name: add several users user: name={{ item }} state=present groups=wheel with_items: - testuser1 - ... 阅读全文
posted @ 2015-01-04 15:29 北京涛子 阅读(655) 评论(1) 推荐(0)

摘要: ####when```yamltasks: - name: "shutdown Debian flavored systems" command: /sbin/shutdown -t now when: ansible_os_family == "Debian"tasks: - co... 阅读全文
posted @ 2015-01-04 15:06 北京涛子 阅读(331) 评论(0) 推荐(0)

摘要: ####变量命名支持数字、字母、下划线```bash有效:foo_port, foo5无效:foo-port, foo port, foo.port, 12```####playbook定义```yaml- hosts: webservers vars: http_port: 80```##... 阅读全文
posted @ 2015-01-04 11:27 北京涛子 阅读(2416) 评论(0) 推荐(0)

摘要: ####task include```yaml---# possibly saved as tasks/foo.yml- name: placeholder foo command: /bin/foo- name: placeholder bar command: /bin/bartasks: ... 阅读全文
posted @ 2015-01-04 10:13 北京涛子 阅读(462) 评论(0) 推荐(0)

2014年12月31日

摘要: playbook是ansible用于配置部署的语言。使用YAML格式。####示例```yaml---- hosts: webservers vars: http_port: 80 max_clients: 200 remote_user: root tasks: - name:... 阅读全文
posted @ 2014-12-31 11:17 北京涛子 阅读(472) 评论(0) 推荐(0)

摘要: 默认位置```bash/etc/ansible/hosts```标准```bashmail.example.com[webservers]foo.example.combar.example.com[dbservers]one.example.comtwo.example.comthree.exam... 阅读全文
posted @ 2014-12-31 10:20 北京涛子 阅读(872) 评论(0) 推荐(0)

2014年12月30日

摘要: 并发与shell```bash# bruce用户身份,-m指定模块名称,默认模块名command,all所有目标主机,也可以指定组名或者主机名ansible all -m ping -u bruce# bruce用户身份,sudoing到root用户ansible all -m ping -u br... 阅读全文
posted @ 2014-12-30 17:30 北京涛子 阅读(946) 评论(0) 推荐(0)

摘要: ####参考文档```bashhttp://docs.ansible.comhttps://github.com/leucos/ansible-tuto```####控制机安装ansible控制机通过ssh控制远程主机,远程主机不需要安装任何agent.```bashgit clone git://... 阅读全文
posted @ 2014-12-30 12:43 北京涛子 阅读(459) 评论(0) 推荐(0)