首页 > 解决方案 > 找不到python模块防火墙

问题描述

当我尝试在防火墙中打开端口时:

- name: Open port 80 for http access
firewalld:
  service: http
  permanent: true
  state: enabled

我收到错误:

致命:[virtual_server]:失败!=> {"changed": false, "msg": "Python Module not found: firewalld and its python module is required for this module, version 0.2.11 or later (0.3.9 or newer for offline operations)"}

我还尝试ansible-galaxy collection install ansible.posix在 macbook 上使用 ansible.posix.firewall,并使用 ansible.posix.firewall,仍然出现此错误。

谁能告诉我有什么问题?

标签: ansible

解决方案


Ansible 基本上是说firewalld没有安装,安装解决问题:

apt-get install  firewalld

Firewalld 默认安装在 Centos 上,但不安装在 Debian 上。


推荐阅读