Chinaunix首页 | 论坛 | 博客
  • 博客访问: 235693
  • 博文数量: 49
  • 博客积分: 246
  • 博客等级: 二等列兵
  • 技术积分: 1034
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-02 13:18
文章分类

全部博文(49)

分类: 系统运维

2014-07-28 13:23:20

copy yml
- name: copy soft
  hosts: all
  user: root
  gather_facts: false


  tasks:
  - name: copy mysql file
    action: copy src=/root/mysql-5.6.17
      dest=/root

----------------------------------------------------------------------
yum yml
- name: yum install cmake
  hosts: all
  user: root
  gather_facts: false


  tasks:
  - name: install the cmake 
    yum: name=cmake state=latest
    yum: name=ncurses state=latest
    yum: name=ncurses-devel state=latest
-------------------------------------------------------------------------------
command yml
- name: disabled selinux
  hosts: all
  user: root
  gather_facts: false


  tasks:
  - name: disabled selinux
    command: /usr/sbin/setenforce 0
    sudo: true
-----------------------------------------------------------------------------------

- name: copy soft
  hosts: all
  user: root
  gather_facts: false


  tasks:
  - name: "install mysql"
    script: /usr/local/src/mysql.sh

重启服务yml
[root@icaile10 ansible]# cat service.yml 
---
- hosts: all
  tasks:
   - service: name=mysqld state=restarted

ansible 追加文件:
        ---
- hosts: syslogB
  tasks:
  - name: 70-remote.conf configuration file
    copy: src=/home/www/script/70-remote.conf  dest=/etc/rsyslog.d/70-remote.conf owner=root group=root mode=0644 backup=yes


  - name: rsyslog.conf
    lineinfile: dest=/etc/rsyslog.conf line="$SystemLogRateLimitInterval 0"
    notify:
      - restart rsyslog


  handlers:
  - include: handlers/rsyslog.yaml


阅读(2375) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~