Skip to content

Commit

Permalink
feat!: playbook refactored
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removed redundant tasks, added integration test
  • Loading branch information
AlexNabokikh committed May 16, 2023
1 parent ab0ff13 commit 165a878
Show file tree
Hide file tree
Showing 20 changed files with 198 additions and 3,476 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: CI
on:
push:
branches:
- master
pull_request:

jobs:
lint:
name: ansible and yaml lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v3
with:
python-version: "3.x"

- name: Install test dependencies.
run: pip3 install yamllint ansible-lint

- name: Lint code.
run: |
yamllint .
ansible-lint -x 403
tests:
name: Integration test
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Python 3.
uses: actions/setup-python@v3
with:
python-version: "3.x"

- name: Uninstall GitHub Actions' built-in Homebrew.
run: tests/uninstall-homebrew.sh

- name: Install test dependencies.
run: |
sudo pip3 install --upgrade pip
sudo pip3 install ansible
- name: Set up test environment
run: |
cp tests/ansible.cfg ./ansible.cfg
cp tests/inventory ./inventory
cp tests/test_config.yml ./config.yml
ansible-galaxy install -r requirements.yml
- name: Test the playbook's syntax
run: ansible-playbook main.yml --syntax-check

- name: Test the playbook.
run: ansible-playbook main.yml
25 changes: 0 additions & 25 deletions .github/workflows/lint.yml

This file was deleted.

38 changes: 7 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# macOS Ansible Playbook

![badge-gh-actions]
![badge-gh-tests]
![badge-gh-release]
![badge-license]

This playbook installs and configures most of the software I use on my OSX machine for software development.
Expand All @@ -11,7 +12,6 @@ This playbook installs and configures most of the software I use on my OSX machi
- [Installation](#installation)
- [Running a specific set of tagged tasks](#running-a-specific-set-of-tagged-tasks)
- [Overriding Defaults](#overriding-defaults)
- [Included Applications / Configuration (Default)](#included-applications--configuration-default)

## Playbook capabilities

Expand All @@ -31,16 +31,13 @@ This playbook installs and configures most of the software I use on my OSX machi
- Install chosen custom fonts.
- **directories**
- Create custom user directories.
- **gpg config**
- Copy users' gpg config and agent config to the home directory.
- **Terminal Settings**
- **Sudoers**
- Configure custom sudoers.
- **Vim**
- Install [Vim-plug plugin manager](https://github.com/junegunn/vim-plug).
- Install and update plugins from your .vimconfig.
- **Oh-My-Zsh**
- **Zsh**
- Install and configure [ohmyzsh](https://github.com/ohmyzsh/ohmyzsh).
- **TMUX**
- Install and configure tmux with TPM (plugin manager)

## Installation

Expand Down Expand Up @@ -100,8 +97,6 @@ installed_nerdfonts:

homebrew_installed_packages:
- git
- tmux
- vim

homebrew_cask_appdir: /Applications
homebrew_cask_apps:
Expand All @@ -115,26 +110,6 @@ mas_email: ""
mas_password: ""
```
## Included Applications / Configuration (Default)
Packages (installed with Homebrew):
- appcleaner
- docker
- dozer
- firefox
- fzf
- git
- gpg
- helm
- htop
- jq
- tfenv
- tflint
- tmux
- vim
- visual-studio-code
## Author
This project was created by [Alexander Nabokikh](https://www.linkedin.com/in/nabokih/) (originally forked from Jeff Geerling's repository: [geerlingguy/mac-dev-playbook](https://github.com/geerlingguy/mac-dev-playbook)).
Expand All @@ -145,5 +120,6 @@ This software is available under the following licenses:
- **[MIT](https://github.com/AlexNabokikh/mac-playbook/blob/master/LICENSE)**
[badge-gh-actions]: https://github.com/AlexNabokikh/windows-playbook/actions/workflows/release.yaml/badge.svg
[badge-gh-tests]: https://github.com/AlexNabokikh/mac-playbook/actions/workflows/ci.yml/badge.svg
[badge-gh-release]: https://github.com/AlexNabokikh/mac-playbook/actions/workflows/release.yaml/badge.svg
[badge-license]: https://img.shields.io/badge/License-MIT-informational
81 changes: 12 additions & 69 deletions default.config.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,31 @@
---
downloads: ~/.ansible-downloads/

configure_dotfiles: true
configure_gpg: false
configure_osx: false
configure_terminal: true
configure_tmux: false
install_oh_my_zsh: true
install_vim_plug: false
configure_osx: true
configure_zsh: true
zsh_plugins:
- zsh-syntax-highlighting
- zsh-history-substring-search

configure_tmux: true
tmux_dir: $HOME/.tmux

create_directories: true
directories:
- $HOME/Documents/repositories

install_extra_packages: true
pip_executable: pip
pip_packages:
- name: awscli
- name: pip
state: latest

configure_dock: true
dockitems_remove:
- TV
- Podcasts

dockitems_persist:
- name: Firefox
path: /Applications/Firefox.app/
pos: 1
- name: Visual Studio Code
path: /Applications/Visual Studio Code.app/
pos: 2

configure_sudoers: true
sudoers_custom_config: |
# Allow users in admin group to use sudo with no password.
%admin ALL=(ALL) NOPASSWD: ALL
npm_packages:
- name: neovim
state: latest

install_fonts: true
installed_nerdfonts:
- Meslo

dotfiles_repo: https://github.com/AlexNabokikh/dotfiles
dotfiles_repo_accept_hostkey: true
dotfiles_repo_local_destination: ~/Documents/repositories/dotfiles
dotfiles_files:
- .gitconfig
- .inputrc
- .osx
- .p10k.zsh
- .tmux.conf
- .vimrc
- .zshrc

homebrew_installed_packages:
- fzf
- git
- gpg
- helm
- htop
- jq
- tfenv
- tflint
- tmux
- vim

homebrew_taps:
- homebrew/bundle
- homebrew/cask

homebrew_cask_appdir: /Applications
homebrew_cask_apps:
- appcleaner
- docker
- dozer
- firefox
- visual-studio-code

mas_installed_apps:
- {id: 937984704, name: Amphetamine}
mas_email: ""
mas_password: ""

osx_script: ~/.osx --no-restart

# Glob pattern to ansible task files to run after all other tasks are finished.
post_provision_tasks: []
4 changes: 0 additions & 4 deletions files/gpg/gpg-agent.conf

This file was deleted.

20 changes: 0 additions & 20 deletions files/gpg/gpg.conf

This file was deleted.

Loading

0 comments on commit 165a878

Please sign in to comment.