如何使用firewalld模块同时启用多个服务?我正在使用这段代码,它在运行 ansible-playbook 后启用一项服务(https)。它工作得很好。但是,我不知道如何在此代码中启用多个服务,而不仅仅是一个服务(https)。
- name: firewalld configuration
firewalld:
zone: public
service: https
permanent: yes
state: enabled
notify: reload firewalld
我尝试了用于安装多个软件包的相同方法(见下文),但没有成功。它回答错误(见下文)
- name: firewalld configuration
firewalld:
zone: public
service:
name:
- https
- http
permanent: yes
state: enabled
notify: reload firewalld
错误:
fatal: [192.168.0.101]: FAILED! => {"changed": false, "msg": "ERROR: Exception caught: org.fedoraproject.FirewallD1.Exception: INVALID_SERVICE: '{'name': ['https', 'http']}' not among existing services Permanent operation, Services are defined by port/tcp relationship and named as they are in /etc/services (on most systems)"}