Use Ansible to (re)define root and first user password?

https://forums.rockylinux.org/t/use-ansible-to-re-define-root-and-first-user-password/10202

post by iwalker on Jun 7, 2023 post by microlinux on Jun 7, 2023 post by iwalker on Jun 7, 2023 post by microlinux on Jun 7, 2023 post by microlinux on Jun 7, 2023 post by iwalker on Jun 7, 2023

iwalker Community Team Jun 2023 You’ll need on all the hosts that you connect to as well. The playbook is ran on each of the servers you connect to. So python3-passlib needs to be installed there also.

post by microlinux on Jun 7, 2023

microlinux Jun 2023 Nope, still no luck. Installed python3-passlib on the controller and all the hosts, and I still get the deprecation warning. I’m puzzled.

post by iwalker on Jun 7, 2023

iwalker Community Team Jun 2023 Same version of ansible on the controller and all the hosts? Assuming there is no ansible mixmatch in between. Or python differences.

I sometimes had deprecated things popup on my Fedora control host, then compared to a Debian 11 control host - due to ansible versions. So if something like this, the deprecation can be ignored for now.

post by jjb on Jun 13, 2023

jjb Jun 2023

  • name: Set password for root

I defined the root password as an encrypted group var and call this task to set it:

  • name: Set password for root ansible.builtin.shell: | echo ‘root:{{ root_password | default(‘*’) }}’ | chpasswd –encrypted become: true

2 months later Closed on Aug 25, 2023

Closed on Aug 25, 2023

Updated: