Giter Site home page Giter Site logo

ansible-new-hire-setup's Introduction

Ansible-New-Hire-Setup

The ansible playbook in this repository installs and sets up a variety of packages useful for engineering new hires. For a basic setup you need only to do steps 1-2. Step 3 is for users who want further customization beyond just package management.

If you want this tool to be usable anywhere, we suggest you fork it and populate it with your personal variables.

Terminology

Ansible - Python-based tool for predictable configuration management

Homebrew - MacOS package manager similar to apt or yum

Package/Cask - Different types of Homebrew installable applications, functionally the same thing for our purposes

Base Packages

The lists of default casks and packages installed for new-hires are found in: /roles/new-hires/tasks/main.yml.

Currently these are:

base_cask_list:
  - iterm2 # Terminal Emulator
  - lastpass
base_package_list:
  - ansible # To run this playbook
  - gh # Github CLI tool
  - awscli # AWS API CLI tool
  - diff-so-fancy # Additional diff options with Git
  - docker
  - docker-compose
  - ghq # Additional Git CLI tool for managing repos
  - htop # Performance and process monitor
  - jq # Json parser
  - pre-commit # Runs hooks against Git commits to enforce standards
  - tmux # Virtual terminal tool
  - vault # Hashicorp's secret manager
  - yq # Yaml parser

1. Prerequisites

A few things need to be done to use this playbook:

  1. Clone this repo to the local machine (requires Github access and valid SSH key uploaded to GH)
git clone [email protected]:anaconda/ansible-new-hire-setup.git
  1. Install Homebrew for Mac (M1_ARM and Intel_x86
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  1. Use Homebrew to install Ansible
brew install ansible

From the repo's base directory, install the Ansible community upstream repository

ansible-galaxy install -r requirements.yaml

These are common tools that most engineers will find useful including git tools, iTerm2, Docker, and aws-cli. Feel free to remove ones you don't want.

2. First Run - Installing Packages and Casks

The first run of this playbook will setup the base packages and generate a uservars file.

To run it, from the base directory run:

ansible-playbook setup-macbook.yml

If you don't want any customization, this is the place to stop. All of the base packages should have been installed and you're ready to go!

If there are packages, config files, or other customizations you want, please read on.

Additional Useful Commands

If you'd like to see what Ansible is doing under the hood, use the -v or --verbose tag which will outputs git-style diffs of each config change.

To install and update packages only ansible-playbook setup-macbook.yaml --tags packages

To install everything including all customization ansible-playbook setup-macbook.yaml --tags all (Please make sure you aren't going to overwrite any config files!)

3. (Optional) Further Shell and Package Customization

The playbook can optionally set up:

  • oh-my-zsh - enhances base MacOS shell and allows plugins/themes
  • powerlevel10k - ZSH theme, requires oh-my-zsh.

Configuring PowerLevel10k

After you install P10k, it must go through a setup process.

Once installed, restart iterm and run p10k configure

Font installation

  1. Answer with "Yesβ€œ once asked if you want to install the Meslo LGS Nerd Font and quit iterm once the installation is complete
  2. If opened: Restart Visual Studio Code to fix the terminal font

For infrastructure-focused roles, the following are also available:

  • Kubernetes tooling - including kubectl, helm, and related plugins and helpers
  • Terraform tooling - including tflint and tfenv, for infrastructure provisioning

You can also specify additional packages/casks here. To install any or all of these items, set the booleans to true in uservars/{{ ansible_user_id }}.yml, where the user_id is the same as your MacOS username. This will will have been created already on the first run of the playbook, if it didn't exist already.

Add your custom packages and casks to user_package_list and user_cask_list. By default it looks like this:

ohmyzsh: "false"
p10k: "false"
k8s: "false"
terraform: "false"

user_package_list:
  - vscode
user_cask_list:
  - somecask

To install those, run

ansible-playbook setup-macbook.yml --tags custom

4. (Very Optional) Advanced Customization - Directory, Config, and File Templating

You can also define specific paths, template files, and configurations to be created and populated. This is useful for quickly templating such files as vscode, git, and shell configurations.

This supports:

  • plain files (user_file_list)
  • templates (user_template_list)
  • downloads from remote URLS (user_url_list). Defaults to overwriting files every time.

Beware: Running the below will overwrite files in the destination directories defined here, potentially causing data loss!

To run these tasks, enter:

ansible-playbook setup-macbook.yml --tags adv-custom

This will install all custom paths and templates. All of this in contained in your personal uservar file.

ansible-new-hire-setup's People

Contributors

agustingarciaflores avatar anaconda-renovate-bot avatar anaconda-renovate[bot] avatar bandwidthninja avatar ekeih avatar mattkram avatar morremeyer avatar pww217 avatar tyu0912 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ansible-new-hire-setup's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

ansible-galaxy
requirements.yaml
  • community.general 9.0.0
pre-commit
.pre-commit-config.yaml
  • alessandrojcm/commitlint-pre-commit-hook v9.16.0
  • pre-commit/mirrors-prettier v3.1.0

  • Check this box to trigger a request for Renovate to run again on this repository

[renovate on-prem migration] Obsolete Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

ansible-galaxy
requirements.yaml
  • community.general 7.2.0
pre-commit
.pre-commit-config.yaml
  • alessandrojcm/commitlint-pre-commit-hook v9.5.0
  • pre-commit/mirrors-prettier v3.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.