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

Problem: update of the 'content' field for the alias doesn't work as expected #71

Open
rhaido opened this issue Apr 29, 2024 · 1 comment
Assignees
Labels
support Environmental problems and so on triage

Comments

@rhaido
Copy link

rhaido commented Apr 29, 2024

Modules

alias

Version

ansibleguy.opnsense 1.2.8

Ansible Version

ansible [core 2.14.3]

OPNSense Version

24.1.3_1

OPNSense-Plugin Version

No response

Issue

Dear Ansible Guy,

It seems, that update of an alias is not really working correctly. I have the following situation:

vars/test.yml:
  - { name: "LIST", type: "urltable", content: ['https://ex.net/test'], ufq: 0.5 }

Playbook:

- hosts: localhost
  gather_facts: yes
  vars_files:
    - vars/test.yml
  module_defaults:
    group/ansibleguy.opnsense.all:
      ...

  tasks:
    - name: Configure Firewall Aliases
      ansibleguy.opnsense.alias:
        name: "{{ item.name }}"
        type: "{{ item.type }}"
        content: "{{ item.content }}"
        updatefreq_days: "{{ item.ufq }}"
        state: "{{ item.state | default('present') }}"
        reload: true
      with_items: "{{ aliases }}"

If I run the playbook with ansible-playbook -D opnsense.yml it gives me OK, but doesn't change the value of LIST alias. Is it the expected behaviour? Creation works as expected though.

Thanks!
M.

Config Ansible

no special configuration used

Config OPNSense

No response

Debug Output

PLAY [localhost] ***********************************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************************
ok: [localhost]

TASK [Configure Firewall Aliases] ******************************************************************************************************
ok: [localhost] => (item={'name': 'LIST', 'type': 'urltable', 'content': ['https://ex.net/test'], 'ufq': 0.5})

PLAY RECAP *****************************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Profiling Output

No response

@rhaido rhaido added the triage label Apr 29, 2024
@ansibleguy ansibleguy self-assigned this May 13, 2024
@ansibleguy
Copy link
Owner

ansibleguy commented May 13, 2024

Greetings @rhaido
Sorry for the delay.

To clarify: Are you changing the URLs inside the URLTable alias or would you expect the IPs from the URLs to be updated?

As I understand the alias type (behavior of OPNSense; not the modules) - its content is not refreshed (fetching IPs from URLs) on change. But I may be wrong.

The update handling of the alias module(s) should basically work - as seen in the module tests

@ansibleguy ansibleguy added the support Environmental problems and so on label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Environmental problems and so on triage
Projects
None yet
Development

No branches or pull requests

2 participants