lefilament / ansible

Ansible playbook
GNU Affero General Public License v3.0
5 stars 4 forks source link

use ansible_* vars in place of ansible_ssh_* #1

Closed nqb closed 3 years ago

nqb commented 3 years ago

Hello,

I replaced some ansible_ssh_* variables by ansible_* vars.

According to https://github.com/geerlingguy/ansible-for-devops/issues/230 and to my tests (on Ansible 2.10), these variables have been deprecated.

It means that you have to define new variables in inventory if you don't want your playbooks to fail even if you use default value (for example: ansible_port: 22)

I only changed files in current repository, there is certainly some changes to handle in roles linked through submodules.

nqb commented 3 years ago

There is no other references to ansible_ssh_* vars in roles linked to this repo using submodules.

EDIT: I'm wrong. There is other references to fix in git submodules.

nqb commented 3 years ago

Another important thing I noticed during my tests.

I expect that ansible_port has a default value of 22 when using a SSH connection plugin but that's not the case. In fact, ansible_port need to be defined in inventory to use it. That's not the case for ansible_host which has a value.

remi-filament commented 3 years ago

Thanks @nqb that was on my todo ! Both variables are defined normally in this repo:

robz2 commented 1 year ago

I have found that even in the latest version of ansible it seems to be prioritising ansiblessh over the ansible_. I have ansible_port declared in the playbook but ansible_ssh_port in group_vars/all but the playbook was using the ansible_ssh_port from group_vars.