The ansible files for the pains-perdus infra.
Find a file
2021-10-08 22:36:59 +02:00
books install blackbox exporter 2021-10-07 22:53:28 +02:00
group_vars/all user prod room 2021-10-08 17:48:49 +02:00
host_vars update rossum networking config 2021-09-07 11:42:42 +02:00
roles add label 'value' to alerts 2021-10-08 22:36:59 +02:00
utils add script to generate vpn keys 2021-04-23 15:12:12 +02:00
.gitignore add keys 2021-04-22 22:12:57 +02:00
ansible.cfg working role (I hope) using debian network/interface config instead of wg-quick 2021-07-05 02:32:59 +02:00
hosts register nodes on the server 2021-09-21 14:53:25 +02:00
LICENSE Initial commit 2020-10-05 09:38:11 +02:00
README.md user the user module's password parameter 2021-01-30 16:21:27 +01:00
run_playbook centralize the declaration of the intranet ip plan 2021-04-23 19:14:28 +02:00
TODO.md toto list 2021-08-02 03:39:11 +02:00

ansible

The ansible files for the pains-perdus infra.

Deploy a playbook

ansible-playbook playbook.yml

Add --check to do a dry run

Edit the vault

ansible-vault edit group_vars/all/vault

with the edditor defined in the env varible $EDITOR and the password of the vault in the file .vault_password (Carefull not to commit it!!!)

SSH key whith passphrase

To avoid entering the passphrase of the ssh key for each host, we have to use an ssh-agent. The ssh-agent with xonsh does not really works, so in my case I have to use ansible and the agent inside a sh process:

sh
eval `ssh-agent -s`
ssh-add
ansible all -m ping # or whatever you want to do with ansible
exit

Vault managment

To use multiple vaults with multiple password, we use vault id. The mapping vault-id@password-file is done in ansible.cfg under [defaults] in vault_identity_list: vault_identity_list = main_vault@.main_vault_password , user_vault@.user_vault_password

To create a new vault with an id and password registered in ansible.cfg: ansible-vault create --encrypt-vault-id user_vault group_vars/all/user_vault

User managment

The user managment role allows to manage user.

Especially, it generate the described users on each hosts.

The password are stored in the variables in there hash form. The script hash_passwd.py can give you the hash of a password.