Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
---
name: Code quality
name: CI

on:
push:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
lint-ansible:
name: Ansible Lint
runs-on: ubuntu-latest
integration:
name: Integration
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-12

steps:
- uses: actions/checkout@v3

- name: Set up Ansible
uses: ansible-community/ansible-lint-action@main
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt

- name: Set up the test environment.
run: |
cp tests/ansible.cfg ./ansible.cfg
ansible-galaxy install -r requirements.yaml

- name: Test the playbook's syntax.
run: ansible-playbook macOS.yaml --syntax-check

- name: Test the playbook.
run: ansible-playbook macOS.yaml
env:
ANSIBLE_FORCE_COLOR: '1'
4 changes: 4 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[defaults]
nocows = True
roles_path = ./roles:/etc/ansible/roles
inventory = inventory.ini
stdout_callback = yaml
bin_ansible_callbacks = True

[diff]
always = true
2 changes: 1 addition & 1 deletion dotfiles/roles/asdf/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
failed_when:
- asdf_add_golang.rc != 0
- '"already added" not in asdf_add_golang.stderr'
ansible.builtin.command: 'asdf plugin add golang'
ansible.builtin.command: 'asdf plugin add golang https://github.com/kennyp/asdf-golang.git'

- name: asdf - Install latest Go version
register: asdf_golang_installed
Expand Down
2 changes: 2 additions & 0 deletions dotfiles/roles/git/files/.gitconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[color]
ui = auto
[user]
name = James Brookes
email = jpebrookes@gmail.com
Expand Down
3 changes: 2 additions & 1 deletion dotfiles/roles/git/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: Git - Ensure Git is installed
become: true
when: ansible_os_family == 'Debian'
ansible.builtin.package:
name: git
state: present
Expand All @@ -9,5 +10,5 @@
ansible.builtin.copy:
src: .gitconfig
dest: "{{ ansible_user_dir }}/.gitconfig"
mode: '0644'
mode: "0644"
force: false
17 changes: 5 additions & 12 deletions dotfiles/roles/zsh/files/.zshrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

zstyle :omz:plugins:ssh-agent identities id_ed25519

export GOPATH=$HOME/go
export PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/go/bin:$GOPATH/bin:/opt/homebrew/bin
export PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/go/bin:$GOPATH/bin
export EDITOR="nano"

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
Expand All @@ -17,7 +11,7 @@ export ZSH="$HOME/.oh-my-zsh"
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
# ZSH_THEME="powerlevel10k/powerlevel10k"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
Expand Down Expand Up @@ -79,7 +73,7 @@ ENABLE_CORRECTION="true"
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git zsh-autosuggestions dirhistory sudo ssh-agent direnv asdf copyfile golang colored-man-pages)
plugins=(asdf colored-man-pages command-not-found copyfile direnv dirhistory docker git golang ssh-agent sudo zsh-autosuggestions)

source $ZSH/oh-my-zsh.sh

Expand Down Expand Up @@ -114,5 +108,4 @@ alias la="exa -la --icons"
alias lsa="exa -la --icons"
alias lsd='exa -aD'

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
eval $(starship init zsh)
7 changes: 5 additions & 2 deletions dotfiles/roles/zsh/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
name: "{{ ansible_user_id }}"
shell: /bin/zsh

- import_tasks: tasks/oh-my-zsh.yaml
- import_tasks: tasks/powerlevel10k.yaml
- ansible.builtin.import_tasks: tasks/oh-my-zsh.yaml

- name: Setup powerlevel10k on Ubuntu
ansible.builtin.import_tasks: tasks/powerlevel10k.yaml
when: ansible_os_family == 'Debian'
10 changes: 9 additions & 1 deletion macOS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
homebrew_installed_packages:
- coreutils
- zsh
- starship
- ssh-copy-id
- git
- pv
Expand All @@ -14,8 +15,13 @@
- tmux
- watch
- cowsay
- tldr
- direnv
- exa
- bat
- fzf
- nano
- asdf
- openjdk
- kubectl
- helm

Expand All @@ -36,6 +42,7 @@
- keepingyouawake
- visual-studio-code
- docker
- font-fira-code-nerd-font
- font-anonymice-nerd-font
- insomnia
- bitwarden
Expand All @@ -52,3 +59,4 @@
- role: geerlingguy.mac.homebrew
- role: jamesbrookes.dotfiles.zsh
- role: jamesbrookes.dotfiles.asdf
- role: jamesbrookes.dotfiles.git
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ansible
2 changes: 2 additions & 0 deletions tests/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[defaults]
inventory = inventory.ini