Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible.posix.firewalld requires firewalld 0.2.11, latest release is v2.0.2 #521

Closed
buckaroogeek opened this issue Jan 5, 2024 · 1 comment

Comments

@buckaroogeek
Copy link

SUMMARY

Using ansible.posix.firewalld in role and now getting this error:

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible.posix.firewalld

ANSIBLE VERSION
ansible [core 2.16.2]
  config file = /home/bgsmith/.ansible.cfg
  configured module search path = ['/home/bgsmith/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /home/bgsmith/src/ansible_collections:/home/bgsmith/.ansible/ansible_collections
  executable location = /usr/bin/ansible
  python version = 3.12.1 (main, Dec 18 2023, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

COLLECTION VERSION
[bgsmith@pico cri (main *%)]$ ansible-galaxy collection list ansible.posix

# /usr/lib/python3.12/site-packages/ansible_collections
Collection    Version
------------- -------
ansible.posix 1.5.4  

CONFIGURATION
[bgsmith@pico cri (main *%)]$ ansible-config dump --only-changed
ANSIBLE_NOCOWS(/home/bgsmith/.ansible.cfg) = True
COLLECTIONS_PATHS(/home/bgsmith/.ansible.cfg) = ['/home/bgsmith/src/ansible_collecti>
CONFIG_FILE() = /home/bgsmith/.ansible.cfg
DEFAULT_FORKS(/home/bgsmith/.ansible.cfg) = 10
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/bgsmith/.ansible.cfg) = True
DEFAULT_ROLES_PATH(/home/bgsmith/.ansible.cfg) = ['/home/bgsmith/src-roles', '/home/>
DEFAULT_STDOUT_CALLBACK(/home/bgsmith/.ansible.cfg) = yaml
DEFAULT_VAULT_PASSWORD_FILE(/home/bgsmith/.ansible.cfg) = /home/bgsmith/.ansible_vau>
DEPRECATION_WARNINGS(/home/bgsmith/.ansible.cfg) = False
EDITOR(env: EDITOR) = vim
RETRY_FILES_ENABLED(/home/bgsmith/.ansible.cfg) = False

OS / ENVIRONMENT

Fedora 39 host, fedora 39 test vm via molecule and vagrant

STEPS TO REPRODUCE
# firewalld settings
# see https://kubernetes.io/docs/reference/ports-and-protocols/
- name: Control plane firewalld settings
  ansible.posix.firewalld:
    permanent: true
    state: enabled
    immediate: true
    port: "{{ item.port }}/{{ item.proto }}"
  with_items:
    - {port: "6443", proto: "tcp"}
    - {port: "2379-2380", proto: "tcp"}
    - {port: "10250", proto: "tcp"}
    - {port: "10259", proto: "tcp"}
    - {port: "10257", proto: "tcp"}
    - {port: "30000-32767", proto: "tcp"}
EXPECTED RESULTS

Module to modify firewalld

ACTUAL RESULTS
failed: [testf39] (item={'port': '6443', 'proto': 'tcp'}) => {"ansible_loop_var": "item", "changed": false, "item": {"port": "6443", "proto": "tcp"}, "msg": "Failed to import the required Python library (firewall) on testf39's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter. Version 0.2.11 or newer required (0.3.9 or newer for offline operations)"}
failed: [testf39] (item={'port': '2379-2380', 'proto': 'tcp'}) => {"ansible_loop_var": "item", "changed": false, "item": {"port": "2379-2380", "proto": "tcp"}, "msg": "Failed to import the required Python library (firewall) on testf39's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter. Version 0.2.11 or newer required (0.3.9 or newer for offline operations)"}
failed: [testf39] (item={'port': '10250', 'proto': 'tcp'}) => {"ansible_loop_var": "item", "changed": false, "item": {"port": "10250", "proto": "tcp"}, "msg": "Failed to import the required Python library (firewall) on testf39's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter. Version 0.2.11 or newer required (0.3.9 or newer for offline operations)"}
failed: [testf39] (item={'port': '10259', 'proto': 'tcp'}) => {"ansible_loop_var": "item", "changed": false, "item": {"port": "10259", "proto": "tcp"}, "msg": "Failed to import the required Python library (firewall) on testf39's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter. Version 0.2.11 or newer required (0.3.9 or newer for offline operations)"}
failed: [testf39] (item={'port': '10257', 'proto': 'tcp'}) => {"ansible_loop_var": "item", "changed": false, "item": {"port": "10257", "proto": "tcp"}, "msg": "Failed to import the required Python library (firewall) on testf39's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter. Version 0.2.11 or newer required (0.3.9 or newer for offline operations)"}
failed: [testf39] (item={'port': '30000-32767', 'proto': 'tcp'}) => {"ansible_loop_var": "item", "changed": false, "item": {"port": "30000-32767", "proto": "tcp"}, "msg": "Failed to import the required Python library (firewall) on testf39's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter. Version 0.2.11 or newer required (0.3.9 or newer for offline operations)"}

@buckaroogeek buckaroogeek changed the title ansible.posix.firewalld requires firewalld 0.2.11, latest release is v2.0.3 ansible.posix.firewalld requires firewalld 0.2.11, latest release is v2.0.2 Jan 5, 2024
@buckaroogeek
Copy link
Author

Looks like I need the correct python version on the vm and not just the host. Closing ! My error.,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant