- Shell 100%
| .idea | ||
| files | ||
| .gitconfig | ||
| ansible.cfg | ||
| basic-setup.yaml | ||
| check-password.yaml | ||
| inventory.yaml | ||
| README.md | ||
Ansible playbooks to personalise your base dev account
This just reflects my personal approach, but it might be helpful for others as a template to personalise their own accounts.
Requirements
Ansible
Make sure to have ansible installed:
uv venv .venv
source .venv/bin/activate
uv pip install ansible
SSH config
This setup assumes that you have your SSH client configured so that you
can log in on all machines with a single ssh machine-name (so username,
port and ssh key file are set appropriately). You can generate the relevant
config settings (which you then need to add to your ~/.ssh/config) with the
following bash script (replacing the username and the path to your
public SSH key with yours):
USERNAME=aklaura
KEYPATH=/home/jackie/.ssh/id_ed25519_uniak
for host in $(grep ansible_host inventory.yaml | cut -f2 -d: | cut -f1 -d.); do
echo -e "Host $host $host.uni-ak.ac.at\n HostName $host.uni-ak.ac.at\n Port 2200\n User $USERNAME\n IdentityFile $KEYPATH\n"
done
Adaptation
- Adapt at least the name and e-mail in the files/gitconfig.
- In the inventory.yaml you might want to adapt the
all:host group to only include the tiers you have accounts for. - The rest is personal preference.
Execution
Once everything is nicely configured run the playbook:
ansible-playbook -i inventory.yaml basic-setup.yaml
Checking for passwords
If you want to check, whether your password works (assuming you have sudo), do the following:
ansible-playbook -i inventory.yaml check-password.yaml --ask-become-pass
In the play recap all hosts where the password worked should be marked yellow. All those where it did not work are red with 1 failed task.