ansible 安装salt-minion

---
- hosts: test
  remote_user: root
  vars:
    software:
      - ntp
      - lrzsz
    master_ip: 192.168.1.220

  tasks:
    - name: install ntp and lrzsz
      yum: name={{item}}  state=present
      with_items:
       - '{{software}}'
 
    - name: ntp update
      command: ntpdate -u pool.ntp.org

    - name: install python-selinux
      yum: name=libselinux-python  state=present
      tags: libselinux-python

    - name: install salt-minion
      yum: name=salt-minion state=present
      tags: salt-minion

    - name: copy salt-minion config file
      template: src=/root/minion.j2  dest=/etc/salt/minion  owner=root group=root mode=0640
      notify:
        - restart salt-minion
      tags: salt-minion

  handlers:
   - name: restart salt-minion
     service: name=salt-minion  state=restarted


你可能感兴趣的:(ansible)