Hi,
I know there are lots of examples on the internet but I can't make it work
ansible-playbook --private-key=/root/docker/aatool/ky.pem --extra-vars
admin_password=T3est@ chpass.yml
[WARNING]: provided hosts list is empty, only localhost is available.
Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: ansible2
The password field must be hashed for all unices. You’re using plaintext for that. The ansible docs:
Optionally set the user's password to this crypted value.
On macOS systems, this value has to be cleartext. Beware of security issues.
To create a disabled account or Linux systems, set this to '!' or '*'.
See [https://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module](https://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module) for details on various ways to generate these password values.
But I'm using a hashing filter inside the platbook for that -
password_hash('sha512')
From your link - "Use the integrated Hashing filters to generate a
hashed version of a password. You shouldn’t put plaintext passwords in
your playbook or host_vars; instead, use Using Vault in playbooks to
encrypt sensitive data."
I don't know Ansible too much but the error "skipping: no hosts
matched" doesn't seem related to the hashing issue
What intrigues me is that I specified the hostname ansible2, which can
be found in /etc/hosts
I already worked with inventory files but since I did it only few
times i missed it. The thing is that Ansible uses /etc/hosts file in a
way, because the hostname you place into inventory file, or in
ansible hosts file must be found in /etc/hosts file in order to be
associated to a IP Address if I'm not mistaken.