Skip to content

sborrazas/dotfiles

Repository files navigation

Provision local machine with Ansible

Template for provisioning local OSX/Ubuntu machine for software development

Previous steps

  • Go to "Sharing" and change the machine's name.
  • Update the group_vars/all.yml accordingly.

OSX Local provision

  • Install latest Xcode from App Store.
  • Make sure latest command line tools are installed (run xcode-select --install).
  • Make sure Python is installed (usually bundled with OSX).
  • Install pip sudo easy_install pip.
  • Install Ansible sudo pip install ansible.
  • Get this repo directory into the machine somehow.
  • Run ansible-playbook -v --ask-become-pass --skip-tags=osx -i local provision.yml in this directory.

OSX Remote provision

  1. Make sure you copied the priv/pub keys to the backup HD, together with all the other home files that you'll need.
  2. Install XCode from the AppStore.
  3. Install Chrome, Docker, Brave, Emacs and Spotify using the official sites.
  4. Install all other AppStore apps that you'll need.
  5. In OSX, open terminal and change default shell to /bin/bash.
  6. Once XCode is installed run xcode-select --install.
  7. Copy files from the backup HD.
  8. Clone this repo into ~/work.
  9. Copy SSH keys.
  10. Import GPG keys
  11. Build docker image to provision with ansible:
    docker build -t ansible_provisioner -f Dockerfile.ansible .
    
  12. Create a container with this image and create a new ssh keypair.
    docker run -it --rm -v=$(pwd):/app --workdir=/app ansible_provisioner /bin/bash
    # ...
    keygen
    
  13. Copy this key to the host .ssh/authorized_keys.
  14. Run the ansible playbook:
    ansible-playbook --skip-tags=ubuntu -i remote provision.yml
    

Ubuntu Remote provision

  1. Make sure you copied all backup files that you'll need to the home directory, including SSH keys.
  2. Install Docker and make sure it starts on boot.
  3. Instal the SSH server in the Ubuntu host machine:
    sudo apt install -y ssh
    sudo systemctl enable --now ssh
    
  4. Build docker image to provision with ansible:
    docker build -t ansible_provisioner -f Dockerfile.ansible .
    
  5. Create a container with this image and create a new ssh keypair.
    docker run -it --rm -v=$(pwd):/app --workdir=/app ansible_provisioner /bin/bash
    # ...
    ssh-keygen
    
  6. Copy this key to the host .ssh/authorized_keys.
  7. Run the ansible playbook:
    ansible-playbook --skip-tags=osx -i remote provision.yml
    
  8. Install the following Gnome extensions:
    • WinTile
    • Application Menu
  9. Set the numix theme under settings.
  10. Add the remapping keys script to the startup apps:
    • Name: remap keys
    • Command: bash -c "xkbcomp /home/sborrazas/.xkbmap $DISPLAY"
  11. Change the local Wifi DNS to be 8.8.8.8,8.8.4.4.
  12. Run bleachbit cleanups (and continue to do so every couple of months).

Notes

If the remote host has a password to connect through SSH you should also append the following parameters to the ansible-playbook command: --ask-become.

Post provision

  • Import the terminal config file located in the Desktop and set it as the default profile.
  • Go into iTunes, on the menu "Store", "Authorize this computer" so you're able to download the songs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published