adulbrich/machine-setup

Easy setup of a new personal machine

★ 0Forks 0ShellGitHub ↗Compare

README

Personal Machine Setup

This repository helps quickly setup a new machine running Windows, macOS, or Ubuntu/Debian with my favorite programs.

Leverages:

  • powershell and chocolatey on Windows, and
  • bash, ansible, and brew on macOS, and
  • bash, ansible, apt, and snap on Ubuntu/Debian.

For Windows, you can use Ansible through WSL, but it requires a little more setup to make it work.

Windows local script setup

Run ./windows/standalone_windows_setup.ps1 in PowerShell. This checks and install chocolatey then installs packages (applications) with it. Packages are listed in ./windows/packages.yml. The packages' names come from the chocolatey package repository.

macOS local script setup

Run ./macos/standalone_macos_setup.sh. It will check and install brew and yq. It will then proceed to install packages with brew (macOS). Brew packages (taps, formulae, and casks) are defined in ./macos/packages.yml.

macOS local Ansible setup

An alternative to the above, you can use Ansible. to configure your machine. Install brew, then install Ansible with brew install ansible. You can then run the playbook using ansible-playbook ./macos/playbook.yml. You don't need to specify an inventory file because the hosts is set to localhost in the playbook.

The playbook will read the ./macos/packages.yml to find the lists of packages. There is a pre-task configured to check the brew installation (which is redundant for localhost but can be useful if configuring remote macOS hosts).

In order to properly catch errors and avoid the configuration to stop when encountering errors, I've encapstulated my three main tasks in separate YAML files. The post-task reports any errors encountered.

Ubuntu/Debian local Ansible setup

A simple version of the macOS Ansible configuration, using apt and snap to install packages an Ubuntu or Debian host. Two tasks are defined, one for apt packages and one for snap packages. The playbook will read the ./ubuntu/packages.yml to find the lists of packages.

You might need elevated privileges to install packages in Ubuntu/Debian:

ansible-playbook playbook.yml --ask-become-pass

Note that snap task might fail on arm64 because the packages are not available for that architecture.

Ansible Manual Installation

You can check if the installation is successful by running ansible --version.

Install with brew (macOS)

brew install ansible
brew install ansible-lint
brew link ansible

Install with pip

sudo -H pip3 install ansible

Contributors

adulbrich

Issues