Provide idempotent fully automated deployment mechanism for my computers from a versioned controlled source targeting Ubuntu|Windows
that is easy to set up and maintain.
Verify your Ubuntu|Windows
installation has all latest packages installed before running the playbook. OTE: This might take some time.
# Ubuntu
sudo apt-get update && sudo apt-get upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y
# Windows
Install-Module PSWindowsUpdate; Get-WindowsUpdate; Install-WindowsUpdate
The default.yml
file contains generic variable required for common setup. These can be modified but not often.
The all.yml
file allows you to personalize your setup to your needs. These settings are system wide configurations mostly based on user and accounts.
The role default.yml
. This file will be created in the file located at ~/.dotfiles/inventory/group_vars/all.yaml
. After all setup configuration is complete, you can cntinue to Install this dotfiles and including your desired settings.
The vault.secret
file allows you to encrypt values with Ansible vault
and store them securely in source control. Create a file located at ~/.config/dotfiles/vault.secret
with a secure password in it.
vim ~/.ansible-vault/vault.secret
To then encrypt values with your vault password use the following:
ansible-vault encrypt_string --vault-password-file $HOME/.ansible-vault/vault.secret "mynewsecret" --name "MY_SECRET_VAR"
cat myfile.conf | ansible-vault encrypt_string --vault-password-file $HOME/.ansible-vault/vault.secret --stdin-name "myfile"
NOTE: This file will automatically be detected by the playbook when running
dotfiles
command to decrypt values. Read more on Ansible Vault here.
This playbook includes a custom shell script located at scripts/dotfiles
. This script is added to your $PATH after installation and can be run multiple times while making sure any Ansible dependencies are installed and updated.
This shell script is also used to initialize your environment after installing Ubuntu|Windows
and performing a full system upgrade as mentioned above.
# Ubuntu
bash -c "$(curl -fsSL https://raw.githubusercontent.com/irish1986/dotfiles/main/scripts/setup)"
# Windows
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$url = "https://raw.githubusercontent.com/irish1986/dotfiles/main/scripts/setup.ps1"
$file = "$env:temp\setup.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
powershell.exe -ExecutionPolicy ByPass -File $file -Verbose
This repo is heavily influenced by ALT-F4-LLC and TechDufus's repo. Go check them out !