安装的 playbook:
---
- name: ansible playbook
hosts: all
remote_user: root
become: yes
tasks:
- name: "安装 epel"
yum:
name: epel-release
state: latest
测试:
ansible all -a "yum repolist"
删除的 playbook
playbook:
---
- name: ansible playbook
hosts: all
remote_user: root
become: yes
tasks:
- name: "安装 epel"
yum:
name: epel-release
state: removed