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
阅读(2424) | 评论(0) | 转发(0) |