f5devcentral / ansible-role-f5_atc_deploy_declaration

Ansible role used to deploy declaratives to F5 Automated Tool Chain services: AS3, DO, and TS
Apache License 2.0
7 stars 11 forks source link

provider.server_port is required #19

Open wncocz opened 4 years ago

wncocz commented 4 years ago

For consistency with all other F5 Ansible modules, provider.server_port should not be required and should default to 443 (or even env var F5_SERVER_PORT). But atc_deploy throws an error when not provided:

The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'server_port'
focrensh commented 4 years ago

Thank you for the feedback. Tracking

tabernarious commented 4 years ago

I have worked up the changes I believe are needed to handle default provider values.

Due to variable order of precedence, a set_fact used within a role cannot overwrite the provider included in a playbook as a role parameter. To work around this I set a default_provider in defaults/main.yml, created a role_provider dictionary in tasks/main.yml using the combine filter (to combine the defaults with the role parameters set in the playbook), and updated all of the references from provider.xxx to role_provider.xxx. I'm open to other ideas/methods.

https://github.com/tabernarious/ansible-role-f5_atc_deploy_declaration/tree/default_server_port

I will create a Pull Request for this, but have another Pull in play for something else...