This project automates the installation and configuration of development tools, ensuring a consistent and reproducible environment across different machines.
- Python 3.12+ installed on the system (download here)
- make (usually pre-installed on macOS and Linux)
- Administrative access (sudo) for package installationx
git clone https://github.com/your-username/dotfiles.git
cd dotfiles
make init
This command will:
- Create a Python virtual environment
- Install Ansible and development tools (ansible-lint, yamllint)
- Isolate dependencies from your system Python
make vault-edit
Add your sensitive information such as:
- API tokens
- Passwords
- Private keys
- Other credentials
make run
You'll be prompted for the vault password you created earlier.
dotfiles/
├── Makefile # Automation commands
├── inventory.ini # Ansible hosts (localhost)
├── main.yml # Main playbook
├── roles/ # Directory for your custom roles
├── group_vars/ # Centralized variables
│ └── all/
│ ├── main.yml # Public variables
│ └── vault.yml # Secret variables (encrypted)
├── venv/ # Virtual environment (auto-created)
└── README.md # This file
Command | Description |
---|---|
make help |
List all available commands |
make init |
Create virtualenv and install Ansible |
make run |
Run the main playbook |
make vault-create |
Create encrypted credentials file |
make vault-edit |
Edit credentials file |
make lint |
Check code quality |
make clean |
Remove virtualenv and temporary files |
- Create a new role directory in
roles/your-role-name/
- Add the standard Ansible role structure:
roles/your-role-name/ ├── tasks/main.yml # Main tasks for the role ├── defaults/main.yml # Default variables ├── templates/ # Jinja2 templates └── files/ # Static files
- Add the role to
main.yml
:roles: - role: your-role-name tags: ['your-tag']
- Public variables: Edit
group_vars/all/main.yml
- Secret variables: Use
make vault-edit
to editgroup_vars/all/vault.yml
All sensitive information is stored encrypted using Ansible Vault:
- Never commit the decrypted
vault.yml
file - Use a strong password for the vault
- Keep the vault password in a secure password manager
- The
.gitignore
file is already configured to ignore temporary files
- Always use
make vault-edit
to edit credentials - Never store passwords in plain text
- Review changes before running the playbook
- Keep backups of your configurations
Run only specific parts of the configuration using tags:
# Run specific role by tag
playbook -i inventory.ini main.yml --tags your-tag --ask-vault-pass
# Run multiple roles by tags
playbook -i inventory.ini main.yml --tags "tag1,tag2" --ask-vault-pass
This project is under the MIT license. See the LICENSE file for more details.