Bug #697
closedFix "Found variable using reserved name: port" (ansible-role-ssh role)
0%
Description
ansible-role-ssh: Don't use reserved name 'port'
Fix this warning:
[WARNING]: Found variable using reserved name: port
Once merged the following patch will be required on the main repository:
--- a/ansible/roles/dc-base/tasks/main.yml +++ b/ansible/roles/dc-base/tasks/main.yml @@ -52,7 +52,7 @@ import_role: name: ssh vars: - port: "{{ ssh.port }}" + sshd_port: "{{ ssh.port }}" listen_addresses: "{{ ssh.listen_addresses }}" # for GuiHome streaming enable_gatewayports: "{{ inventory_hostname == 'Toushirou' }}"
Updated by Marc Dequènes almost 5 years ago
I agree this is an annoying message, but as far as I can read in the Ansible documentation this is not a reserved variable. So maybe it's a mistake but it needs to be clarified first.
If it happens to be a documentation mistake, then I'd like to understand what this variable is used for since I have no recollection of any base Ansible feature using it and never stumbled into any conflict.
I would also point out that this PR does not change all occurrences of port (for DC at least the coturn role is in the same situation); I know it's in the issue title and maybe you planned more updates, just to keep this in mind.
Updated by Pierre-Louis Bonicoli almost 5 years ago
It looks like this warning exists since Ansible 2.3.
I proposed this PR https://github.com/ansible/ansible/pull/69585 in order to document the current behavior.
Updated by Marc Dequènes almost 5 years ago
Thanks for the explanation and Ansible PR, because it really looked like a mistake int he warning function. I had no idea play's parameters were like variables and I did not know there was a `port` parameter either. I honestly do not get why it conflicts with role variables, probably some internal mystery but having certain very handy word taken from us is really annoying.
Merge. I adapted `roles/dc-base/tasks/main.yml` accordingly.
I spotted at least one remaining case.
Updated by Marc Dequènes almost 5 years ago
- Status changed from In Progress to Resolved