其他分享
首页 > 其他分享> > Atop监控部署 playbook

Atop监控部署 playbook

作者:互联网

 

---
- name: Install the atop and savetime 3 days and Interval 15s
  hosts: "{{ ip  }}"
  vars:
    date: 3
  gather_facts: no
  tasks:
  - name: yum atop
    yum:
name: https://www.atoptool.nl/download/atop-2.3.0-1.el7.x86_64.rpmstate: present- name: update the configfile Interval time
    lineinfile:path: /usr/share/atop/atop.dailyregexp: '^INTERVAL=600'line: INTERVAL=15- name: update the configfile Save time
    lineinfile:path: /usr/share/atop/atop.dailyregexp: '^(.*)(-mtime \+28)(.*)$'line: '\1-mtime +{{ date }}\3'backrefs: yes

  - name: atop service enabled and start
    service:name: atopenabled: truestate: started
# run the command: ansible-playbook atop_install.yml

 使用命令  ansible-playbook atop_install.yaml -e  "HostGroupName" 

 

标签:name,Atop,lineinfile,share,configfile,playbook,监控,atop
来源: https://www.cnblogs.com/oscarli/p/13140208.html