Coder Social home page Coder Social logo

fedejaure / dev-setup Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 944 KB

My own Ansible collection for development setup.

License: MIT License

Python 97.52% Jinja 2.48%
ansible ansible-role ansible-playbook ansible-collection ubuntu xubuntu macos python flutter

dev-setup's Introduction

Development Setup

GitHub release (latest SemVer) Tests License

pre-commit Contributor Covenant

My own Ansible collection for development setup (use by your own risk).

Features

Mac OS

Applications installed with Mac App Store

Applications installed with Homebrew Cask

Tools/Package installed with Homebrew

Tools installed with pipx

Other installed Tools

Quickstart

Starting from a brand-new Mac

  1. Ensure Apple's command line tools are installed (xcode-select --install to launch the installer).

  2. Download this repository to your local drive.

  3. Install requirements:

    Create a temporary virtualenv, activate the virtualenv and install ansible:

    $ /usr/bin/python3 -m venv .venv
    $ . .venv/bin/activate
    (.venv)$ pip3 install ansible
  4. Install ansible requirements ansible-galaxy install -r requirements.yml.

  5. Copy inventory.example into inventory.

  6. Run ansible-playbook playbooks/main.yml --ask-become-pass -i inventory.

Note: You need to agree to Xcode's license.

$ sudo xcodebuild -license

Configuring a remote Mac

Starting from a configured machine

  1. Clone this repository.

  2. Install dependencies:

    $ poetry install --no-root
    Using python3.10 (3.10.8)
    Creating virtualenv .venv
    Installing dependencies from lock file
    
    Package operations: 97 installs, 0 updates, 0 removals
    
    ...
  3. Activate the virtual environment:

    $ poetry shell
    Using python3.10 (3.10.8)
    Spawning shell within .venv
    (dev-setup)$
  4. Install required Ansible roles:

    (dev-setup)$ inv galaxy-install
  5. Configure the inventory file:

    • Local target:

      Copy inventory.example into inventory.

    • Remote target:

      Configure the inventory file as:

      [macos]
      <ip address or hostname of the target> ansible_user=<target user> ansible_python_interpreter=/usr/bin/python3

      On the target Mac:

      1. Ensure Apple's command line tools are installed (xcode-select --install to launch the installer).

      2. Go to System Preferences > Sharing.

      3. Enable 'Remote Login'.

      You can also enable remote login on the command line:

      $ sudo systemsetup -setremotelogin on

      Note: You need to agree to Xcode's license.

      $ sudo xcodebuild -license
  6. Run the playbook:

    (dev-setup)$ inv playbook --ask-pass --ask-become-pass
  7. Enjoy!

Running a specific set of tagged tasks

The tags available are:

  • always
  • dock
  • homebrew
  • mas
  • oh-my-zsh
  • pipx
  • pyenv

Overriding Defaults

You can override the defaults configured in default..config.yml by creating a .config.yml file and setting the overrides in that file. e.g.:

---
mas_email: "[email protected]"

homebrew_installed_packages:
  - git
  - openssl
  - readline
  - xz
  - sqlite
  - gcc
  - cmake
  - zlib
  - tcl-tk
  - pipx
  - luarocks
  - neovim
  - tmux
  - chezmoi
  - jesseduffield/lazydocker/lazydocker
  - esolitos/ipa/sshpass
  - htop
  - dust
  - duf
  - bat
  - fish
  - starship
  - awscli
  - tfenv
  - ffmpeg

homebrew_cask_apps:
  - firefox
  - google-chrome
  - docker
  - openvpn-connect
  - hpedrorodrigues/tools/dockutil
  - font-terminess-ttf-nerd-font
  - visual-studio-code
  - zoom
  - tad
  - keybase
  - obsidian
  - google-cloud-sdk
  - ultimaker-cura
  - elgato-stream-deck
  - spotify
  - alacritty

pyenv_python_versions:
  - 3.7.15
  - 3.8.15
  - 3.9.15
  - 3.10.8
  - 3.11.0

Development

To display available tasks run:

(dev-setup)$ inv --list
Available tasks:

  ansible-lint     Run ansible linter.
  clean            Run all clean sub-tasks.
  clean-python     Clean up python file artifacts.
  format           Format code.
  galaxy-install   Install ansible-galaxy requirements.
  hooks            Run pre-commit hooks.
  install-hooks    Install pre-commit hooks.
  lint             Run all linting.
  mypy             Run mypy.
  playbook         Run Ansible playbooks, executing the defined tasks on the targeted hosts.
  ruff             Run ruff.
  security         Run security related checks.
  tests            Run ansible molecule test.
  version          Bump version.
  yamllint         Run yamllint, a linter for YAML files.

Author Information

This playbook was created in 2020 by Federico Jaureguialzo.

dev-setup's People

Contributors

dependabot[bot] avatar fedejaure avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

dev-setup's Issues

Add Keybase for M1-pro

Add Keybase for M1-pro.

Now it looks like it's broken for that architecture:

Error: Failure while executing; `/Applications/Keybase.app/Contents/SharedSupport/bin/keybase install-auto` exited with 127. Here's the output:
    Bad CPU type in executable - /Applications/Keybase.app/Contents/SharedSupport/bin/keybase

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.