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

Partial playbook execution not working: dhcp #57

Closed
rvalle opened this issue Feb 1, 2024 · 7 comments
Closed

Partial playbook execution not working: dhcp #57

rvalle opened this issue Feb 1, 2024 · 7 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@rvalle
Copy link

rvalle commented Feb 1, 2024

I am attempting to use tags to update my router partially.

the actual use case I am using is update only dhcp entries.

For some reason fetch is not working, although I can see that there is an always tag. I works only if I explicitly include the "fetch" tag. I am not sure what the reason is, but it could be that the always applies only to the include-tasks, and the tasks inside are all "fetch" only.

Then there is the application and reload, I think they also need the always tag. when: config.changed will not be processed unless the task is selected by tags first, I think.

Partial execution would be a nice to have feature as configuration of the router keeps growing. would provide more agility while building the router configuration.

@rvalle
Copy link
Author

rvalle commented Feb 1, 2024

it may also help to use a block for the last set of tasks: clean, copy, upload, reload.... all should be processed always when the config has changed, etc.

@zerwes
Copy link
Collaborator

zerwes commented Feb 1, 2024

Hello @rvalle
We use selective runs using tags to.
Our fetch method is a little bit different (see https://github.com/Rosa-Luxemburgstiftung-Berlin/ansible-opnsense-playbook)

I'll have a look at the fetch issue and be back soon ...

The block hint has to be considered in #12

@zerwes zerwes self-assigned this Feb 1, 2024
@zerwes zerwes added bug Something isn't working enhancement New feature or request labels Feb 1, 2024
@rvalle
Copy link
Author

rvalle commented Feb 1, 2024

I see @zerwes

in your setup you do an tagged import role, while in the vanilla role it is an include_tasks. Perhaps they behave differently. I think they have to be applied always instead of fetch.

Yes, finer grain handlers would be a great tool too.

I think these features will make a difference during configuration work on the firewalls, making it more agile.

@zerwes zerwes closed this as completed in b716bd1 Feb 1, 2024
@zerwes
Copy link
Collaborator

zerwes commented Feb 1, 2024

well, by enforcing the tag inheritance for the always tag on the included task, the fetch task is now implicit invoked, except it is explicitly excluded by adding fetch or alwaysto --skip-tags
hope this helps

@zerwes
Copy link
Collaborator

zerwes commented Feb 1, 2024

@rvalle I just took the chance and implemented a dhcp handler for #12 on the branch issue-12-dhcp-handler
would you mind testing this?

@zerwes
Copy link
Collaborator

zerwes commented Feb 1, 2024

#58 works for me ...
just using ansible-playbook -t dhcp,copy ... will bypass the big reload and leave you with the right dhcp config in /var/dhcpd//etc/dhcpd.conf and a reloaded service ...
can you approve this?

@rvalle
Copy link
Author

rvalle commented Feb 1, 2024

thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants