Project

General

Profile

Bug #697

Fix "Found variable using reserved name: port" (ansible-role-ssh role)

Added by Pierre-Louis Bonicoli 21 days ago. Updated 10 days ago.

Status:
In Progress
Priority:
Normal
Category:
-
Start date:
2020-05-07
Due date:
% Done:

0%

Estimated time:
Patch Available:
Confirmed:
No
Branch:
dont_use_reserved_name_port
Entity:
DuckCorp
Security:
Help Needed:

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' }}" 

History

#1

Updated by Marc Dequènes 10 days 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.

#2

Updated by Pierre-Louis Bonicoli 10 days 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.

Also available in: Atom PDF