Create a generic FortiOS deploy-config task#2605
Create a generic FortiOS deploy-config task#2605a-v-popov wants to merge 2 commits intoipspace:devfrom
Conversation
This is not exactly a promising start of a PR 🤔 Whatever the root cause is, it has to be fixed, or we have to agree to migrate all FortiOS functionality to the new way of doing things. @ssasso @sdargoeuves do you want to look at this? Does it make sense to go down this path? It might make things easier if we ever decide to implement more functionality, but I have no idea how well this would play with older releases (you know, the ones where the licensing was still reasonable). |
|
The initial provisioning is still done as it was, with ansible tasks, and it works for me. No migration was required. My motivation was to enable these two features. |
|
I tested both the latest dev branch and the forked branch on two images: a freshly built I’m not making much use of |
ssasso
left a comment
There was a problem hiding this comment.
IMHO, if @a-v-popov wants (and has time) to go down this path, it would be great to migrate all the existing config "actions" (initial, ospf, firewall) to this new methodology.
It would be great for the following reasons:
- consistency in config methods
- better "extra config", and config backup & restore (if i'm not wrong we still miss the fetch config?)
- allow people with no ansible knowledge to contribute to config templates, or even write additional plugins with less effort
|
I think I clearly stated my motivation. I am not proposing or advocating in any way template-only configurations. |
I understood your motivation, and this PR is ok. I was just giving my opinion of what I personally think it could be good as future improvement, also enabling other potential contributors to work on fortigate features. |
|
I amended the commit to address linter's complaints, hope it was the right thing to do. |
Yes it was. Thank you!
I made a few changes to get back those two variables you removed, and to prevent crashes when a task has no corresponding template. We're losing a bit of a resilience with this setup, but as we have a single device that uses task lists to configure stuff, additional complications are simply not worth it. Please check whether these changes work for you. If they do, I'll merge the PR. |
No other I will return control to external playbooks in my setup. Sorry for the inconvenience. |
Because none of the other devices is ever configured though a task list. All of them are configured through configuration templates and (mostly) shared deployment task list.
No. We try to generate sane error messages instead of crashing. The "missing template" will be caught before the deployment task list is called.
Look, we had two deployment models:
You effectively added the hybrid option, but in a way that would break (at least) custom config deployment using task lists but no templates because you removed those two parameters (with "I am not sure what side effects this change might have" comment, which is a red flag in itself). I know what effects that change might have, and breaking what worked before without a really good reason is unacceptable (to me, YMMV). I tried to implement your idea with the minimum possible impact on what's already out there. An alternative would be to modify the core Ansible playbooks/task lists to support the hybrid option, and that's probably not worth the effort for the minor inconvenience of a slightly different behavior of a single device. Anyway, let me get this straight: you're not saying "your proposed change does not work" but "I don't like it"?
I would be OK with merging the final version that just adds the "deploy-config" task list, but it's your choice 🤷♂️ |
No, I didn't. It is described in your documentation referenced above.
This should be expected, read the big red warning in your own documentation.
OK. On my mileage, either your 'core Ansible playbooks' or your documentation, or potentially both, are broken.
I am saying that I will be using external tools to achieve what I need without this PR. |
Introducing a generic FortiOS deploy-config task using
config-scriptAPI to enablenetlab config ....Based on a comment here #2271 (reply in thread)
FortiOS feature documentation: https://docs.fortinet.com/document/fortigate/7.6.3/administration-guide/780930/configuration-scripts
Ansible module: https://ansible-galaxy-fortios-docs.readthedocs.io/en/latest/fortios_monitor.html
I had to update fortios.yml to stop normalize task from failing, although I am not sure what side effects this change might have.