PS: The web page for Ansible password is still broken https://docs.ansible.com/ansible/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module
[image: image.png] On Tue, Feb 9, 2021 at 11:17 PM Jeremey Wise <[email protected]> wrote: > Sorry for not being clear.. > > What I did .. was .. nothing. No code change from the code posted. > > I use Visual Studio Code ... and did not between changes save file before > running test... which then got back false "failure"... and do kept trying > other things. > > The below code works > from global variables file /group_var/all.yml > vault_nut_ssh: nut # Account used for UPS services client and server side > vault_nut_ssh_password: !vault | > $ANSIBLE_VAULT;1.1;AES256 > 643963626666<snip > 3330613639316532350a373634653566326338636565346539663366646338303861623030326263 > 3532 > > User create.. in this case "nut" for ups monitoring. > # Setup "nut" user as both client and server need it > - name: > Add the user 'nut' with a bash shell, appending the group 'wheel'and generate > ssh key for hosts "{{ target_hosts }}" > user: > name: '{{ vault_nut_ssh }}' > shell: /bin/bash > groups: wheel > state: present > generate_ssh_key: yes > ssh_key_bits: 2048 > ssh_key_file: .ssh/id_rsa > createhome: yes > password: > "{{ vault_nut_ssh_password | string | password_hash('sha512') }}" > > > > > > On Tue, Feb 9, 2021 at 5:49 PM Antony Stone < > [email protected]> wrote: > >> On Tuesday 09 February 2021 at 23:43:41, Jeremey Wise wrote: >> >> > Correction: >> > >> > This was an error where I was trying too many things and did not >> re-test >> > with all correct variables set. >> > >> > This does work: >> > Co-worker pointed out to dump password out as variable and I saw it was >> > read that in wrong as I changed several times to test things >> > ############ >> >> For the benefit of future visitors to this forum / archive, please could >> you >> make clear what you did need to do differently so that things worked as >> expected / required. >> >> That way, at least some people will not have to ask the same question >> again :) >> >> Thanks, >> >> >> Antony. >> >> -- >> I conclude that there are two ways of constructing a software design: One >> way >> is to make it so simple that there are _obviously_ no deficiencies, and >> the >> other way is to make it so complicated that there are no _obvious_ >> deficiencies. >> >> - C A R Hoare >> >> Please reply to the >> list; >> please *don't* >> CC me. >> > > > -- > [email protected] > -- [email protected] -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFr%2BZBn45a8sbtw%2BOG0L2V%3DBQicjJmeKOHHhaZL5rBv8T0%3DnRA%40mail.gmail.com.
