Skip to content

Commit

Permalink
ubuntu 24
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwn committed Aug 30, 2024
1 parent 306023b commit 2116971
Show file tree
Hide file tree
Showing 64 changed files with 574 additions and 376 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
exclude_paths:
- .github/
- config.yml
skip_list:
- yaml[line-length]
28 changes: 19 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CI

on:
Expand All @@ -11,37 +12,46 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Check out repo
uses: actions/checkout@v4

- name: Lint
uses: pre-commit/action@v3.0.0
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- run: |
python -m pip install pre-commit
pre-commit run --all-files
integration:
name: Integration Test
strategy:
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Install python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Install ansible
run: pip3 install ansible

- name: Test syntax
run: ansible-playbook u22-box.yml --syntax-check -i inventory
- name: Setup playbook
run: |
cp inventory.ini.example inventory.ini
cp env.yml.example env.yml
- name: Integration Test
run: ansible-playbook u22-box.yml -i inventory
run: >
ansible-playbook -i inventory.ini -l local -e "integration_testing=true" ubuntu24.yml
env:
ANSIBLE_FORCE_COLOR: '1'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.venv

vars_private.yml
env.yml
inventory.ini
14 changes: 5 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-yaml

- repo: https://github.com/adrienverge/yamllint
rev: v1.32.0
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamllint

- id: yamlfmt
- repo: https://github.com/ansible-community/ansible-lint
rev: v6.17.0
rev: v24.7.0
hooks:
- id: ansible-lint
5 changes: 5 additions & 0 deletions .yamlfmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
formatter:
include_document_start: true
pad_line_comments: 2
retain_line_breaks_single: true
10 changes: 0 additions & 10 deletions .yamllint.yml

This file was deleted.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,23 @@

![ci](https://github.com/nathan-wien/dev-env-playbook/actions/workflows/ci.yml/badge.svg)

A collection of Ansible playbooks to setup my personal dev environment.

Inspired by [Jeff Geerling's Mac Development Ansible Playbook](https://github.com/geerlingguy/mac-dev-playbook).

## Setting up a VirtualBox VM

My usual way of setting up a VirtualBox VM is through ssh from the host machine.

### Enable SSH port forwarding for a VM

Modify the network settings of the VM:

* navigate through `Settings -> Networks -> Advanced -> Port forwarding`
* In the Port forwarding rules table, add a row with:
* `Name`: `SSH` (or any name would do)
* `Protocol`: `TCP`
* `Host Port`: I typically go with `43219` but can go with something else.
* `Guest Port`: `22`

Add the following to `~/.ssh/config` on the host machine:
3 changes: 0 additions & 3 deletions alacritty

This file was deleted.

16 changes: 12 additions & 4 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ delta:
release: "0.16.5"
direnv:
release: "v2.34.0"
emacs:
release: "29.4"
go:
release: "1.22.3"
checksum: "sha256:8920ea521bad8f6b7bc377b4824982e011c19af27df88a815e3586ea895f1b36"
gocloc:
release: "0.5.2"
hugo:
release: "0.131.0"
hyperfine:
release: v1.18.0
kitty:
Expand All @@ -22,14 +28,16 @@ lazygit:
nerd_fonts:
release: "v3.2.0"
fonts:
- "ComicShannsMono"
# - "ComicShannsMono"
- "JetBrainsMono"
- "Iosevka"
- "RobotoMono"
# - "Iosevka"
# - "RobotoMono"
nvim_nightly:
release: "nightly"
nvim:
release: "v0.10.1"
pandoc:
release: "3.3"
python:
versions:
- semver: "3.6.15"
Expand All @@ -53,7 +61,7 @@ terraform:
vivid:
release: "0.9.0"
wez:
release: "20240128-202157-1e552d76"
release: "20240203-110809-5046fc22"
zsh:
plugins:
zsh_completions:
Expand Down
1 change: 1 addition & 0 deletions env.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
env:
6 changes: 0 additions & 6 deletions get_versions.sh

This file was deleted.

2 changes: 0 additions & 2 deletions inventory

This file was deleted.

10 changes: 10 additions & 0 deletions inventory.ini.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Example: ansible-playbook -i inventory.ini u24-box.yml --limit u24_box

[all:vars]
ansible_python_interpreter=auto_silent

[local]
localhost ansible_connection=local

[u24_box]
vbox ansible_host=127.0.0.1 ansible_port=12345 ansible_user=nathan ansible_ssh_private_key_file=~/.ssh/id_ed25519
60 changes: 1 addition & 59 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
hosts: localhost
vars_files:
- config.yml
connection: local

pre_tasks:
- name: Display system info.
Expand All @@ -12,12 +11,10 @@
loop:
- ansible_os_family = {{ ansible_os_family }}
- ansible_distribution == {{ ansible_distribution }}
- ansible_distribution_major_version ==
{{ ansible_distribution_major_version }}
- ansible_distribution_major_version == {{ ansible_distribution_major_version }}
- ansible_architecture == {{ ansible_architecture }}
tags:
- always

- name: Ensure certain directories exist.
ansible.builtin.file:
path: "{{ lookup('env', 'HOME') }}/{{ item }}"
Expand All @@ -35,27 +32,12 @@
tags:
- core

- name: Install fonts.
ansible.builtin.import_tasks: "tasks/fonts.yml"
tags:
- fonts

- name: Install nvim.
ansible.builtin.import_tasks: "tasks/nvim.yml"
tags:
- nvim

- name: Install Python.
ansible.builtin.import_role:
name: python
tags:
- python

- name: Install Go.
ansible.builtin.import_tasks: "tasks/go.yml"
tags:
- go

- name: Install cargo.
ansible.builtin.import_tasks: "tasks/cargo.yml"
tags:
Expand All @@ -66,62 +48,22 @@
tags:
- i3

- name: Install starship.
ansible.builtin.import_tasks: "tasks/starship.yml"
tags:
- starship

- name: Install direnv.
ansible.builtin.import_tasks: "tasks/direnv.yml"
tags:
- direnv

- name: Install terraform.
ansible.builtin.import_tasks: "tasks/terraform.yml"
tags:
- terraform

- name: Install texlive.
ansible.builtin.import_tasks: "tasks/texlive.yml"
tags:
- tex

- name: Install vivid.
ansible.builtin.import_tasks: "tasks/vivid.yml"
tags:
- vivid

- name: Install XFCE4.
ansible.builtin.import_tasks: "tasks/xfce4.yml"
tags:
- xfce4

- name: Install zsh.
ansible.builtin.import_tasks: "tasks/zsh.yml"
tags:
- zsh

- name: Install kitty.
ansible.builtin.import_tasks: "tasks/kitty.yml"
tags:
- kitty

- name: Install cue.
ansible.builtin.import_tasks: "tasks/cue.yml"
tags:
- cue

- name: Install wez.
ansible.builtin.import_tasks: "tasks/wez.yml"
tags:
- wez

- name: Install souffle.
ansible.builtin.import_tasks: "tasks/souffle.yml"
tags:
- souffle

- name: Install delta.
ansible.builtin.import_tasks: "tasks/delta.yml"
tags:
- delta
Loading

0 comments on commit 2116971

Please sign in to comment.