From 3ce63d845e5c2f2df6fbaf7129cf4094903761fe Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Wed, 21 Nov 2012 14:10:10 +0100 Subject: [PATCH] remote_port is None by default --- lib/ansible/playbook/play.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 15d103ab63..90435b5807 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -69,7 +69,7 @@ class Play(object): self._tasks = ds.get('tasks', []) self._handlers = ds.get('handlers', []) self.remote_user = utils.template(basedir, ds.get('user', self.playbook.remote_user), self.vars) - self.remote_port = utils.template(basedir, ds.get('port', self.playbook.remote_port), self.vars) + self.remote_port = ds.get('port', self.playbook.remote_port) self.sudo = ds.get('sudo', self.playbook.sudo) self.sudo_user = utils.template(basedir, ds.get('sudo_user', self.playbook.sudo_user), self.vars) self.transport = ds.get('connection', self.playbook.transport) @@ -77,6 +77,9 @@ class Play(object): self.gather_facts = ds.get('gather_facts', None) self.serial = ds.get('serial', 0) + if self.remote_port is not None: + self.remote_port = utils.template(basedir, self.remote_port, self.vars) + self._update_vars_files_for_host(None) self._tasks = self._load_tasks(self._ds, 'tasks')