The ansible files for the pains-perdus infra.
Find a file
2021-03-02 11:33:34 +01:00
group_vars/all add config fore sharing file over http 2021-03-02 11:33:34 +01:00
roles add net-tools to utils 2021-02-07 21:40:36 +01:00
.gitignore setup new vault 2021-01-29 22:27:04 +01:00
ansible.cfg setup new vault 2021-01-29 22:27:04 +01:00
base.yml add user managment to the base playbook 2021-01-30 16:34:20 +01:00
dns.yml free the port 53 for nginx 2021-01-23 13:45:25 +01:00
gitea.yml one more 2021-01-27 02:04:44 +01:00
hash_passwd.py user the user module's password parameter 2021-01-30 16:21:27 +01:00
hosts re2o->my-mail 2021-02-06 16:48:09 +01:00
keycloak.yml generate self signed certificate 2021-01-26 19:36:59 +01: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
users.yml setup new vault 2021-01-29 22:27:04 +01:00
web_services.yml add config fore sharing file over http 2021-03-02 11:33:34 +01: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.