Creating and managing users and authentication options
In the last section, you created the ansible superuser manually to initiate an account to execute automation. An account with that level of privilege isn’t suitable for all tasks.
In this recipe, you will create a new read-only user named ansible-ro. This user will be authenticated using a password and won’t be able to authenticate using a public key, to provide some variety:
- First, you will use
ansible-vaultto encrypt the password for theansible-rouser:root@cookbook-lab:~/cookbook-lab/chapters/ch05# ansible-vault encrypt_string New Vault password: *** (1) Confirm New Vault password: *** Reading plaintext input from stdin. (ctrl-d to end input, twice if your content does not already have a newline) ansible123 (2) Encryption successful !vault | $ANSIBLE_VAULT;1.1;AES256 32356 ... omitted output ...
The numbered references from the preceding code are explained as follows...