Ansible-based workflow automation for seamlessly setting up a consistent development environment across different systems. This playbook allows quick cloning of dotfiles, installation of necessary packages, and configuration of workflow on the go.
- Cross-System Compatibility: Easily adapt the setup to different operating systems.
- Dotfiles Management: Automatically clones and sets up dotfiles using
yadm
. - SSH Key Management: Securely stores and deploys SSH keys using Ansible Vault.
- Customizable: Variables for GitHub username and dotfiles repository allow for flexible configuration.
- Automated Setup: Installs essential packages and tools, and configures the environment to your liking.
- Ansible (version 2.9 or later)
- Git
- Basic understanding of YAML and Ansible playbooks
-
Clone this repository:
git clone https://github.com/YourUsername/ansible-dots.git cd ansible-dots
-
Create an
ssh_keys.yml
file with your SSH keys:ssh_private_key: | -----BEGIN OPENSSH PRIVATE KEY----- Your private key here -----END OPENSSH PRIVATE KEY----- ssh_public_key: | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJHmZ... your public key here
-
Encrypt the SSH keys file:
ansible-vault encrypt ssh_keys.yml
You'll be prompted to create a password for the vault.
Run the playbook with:
ansible-playbook playbook.yml --ask-vault-pass --ask-become-pass --extra-vars "github_username=YourUsername dotfiles_repo=YourDotfilesRepo"
Replace YourUsername
and YourDotfilesRepo
with your GitHub username and dotfiles repository name.
- Modify
playbook.yml
to add or remove tasks as needed. - Adjust variables in
playbook.yml
or create a separatevars.yml
file for more complex setups. - Add or modify tasks in the
tasks/
directory to tailor the setup to your needs.
After running the playbook, verify the setup:
-
Check SSH key installation:
ls -l ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
-
Test SSH functionality:
ssh -T [email protected]
-
Verify installed packages and configurations as needed.
- If SSH key deployment fails, ensure the
ssh_keys.yml
file is correctly formatted and encrypted. - For permission issues, check that the playbook is run with appropriate privileges (using
--ask-become-pass
). - Review Ansible output for specific task failures and adjust accordingly.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.