Y

yoho-ansible-roles

yoho-ansible-roles

Forked from ops
bb9a56ae Update bigdata inventory file · by root

YOHO ANSIBLE ROLES

准备ansible的环境

1.创建用户: useradd ansible -g root -d /home/ansible.

2.安装ansible

3.将被管理的服务器的private key copy 到 ~/.ssh/

4.git clone 本项目即可

Roles

openresty: 同步JAVA NGINX的配置

java nginx 静态文件位置: http://git.yoho.cn/ops/yoho-ansible-roles/tree/master/roles/openresty/files

如何同步java nginx的配置? ansible-playbook playbooks/java-nginx.yml -i inventories/az2/hosts

rsyslog: rsyslog的配置

resolv: 配置服务器的'/etc/resolv.conf'

How to Run

jump to server: ansible@10.66.233.9

Default inventory file in [ansible.cfg] is : [./inventories/test]

You should identify inventory file by [-i]


ansible-playbook site.yml -i inventories/az3/hosts
ansible-playbook site.yml --limit nginx  -i inventories/az3/hosts

# run playbooks
ansible-playbook playbooks/nginx.yml  -i inventories/az3/hosts

# run shell
ansible all -m shell -a "cat /etc/resolv.conf"  -i inventories/az3/hosts