- 使用firewalld模块可以配置防火墙策略
[root@db04 ansible]# cat firewalld.yml --- - host: db01 tasks: - name: install firewalld yum: name: firewalld state: present - name: run firewalld service: name: firewalld state: started enabled: yes - name: set firewalld rule. firewalld: port: 80/tcp permanent: yes state: enabled [root@db04 ansible]#
- template模块(它也有拷贝功能)
[root@db04 ansible]# cat template.yml --- - hosts: db01 tasks: - name: use template copy index.html to webserver. template: src: ~/ansible/template/index.html dest: /var/www/html/index.html
[root@db04 template]# pwd /root/ansible/template [root@db04 template]# cat index.html welcome to {{ansible_hostname}}
标签:10,name,模块,firewalld,ansible,template,root,db04 From: https://www.cnblogs.com/zmc60/p/17410681.html