From 5668cd163d66d10538faa1131be985d2ed275322 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Mon, 10 Apr 2023 22:48:13 -0700 Subject: [PATCH] Current state & start docs. --- README.org | 41 ++++++++++++++++++++++++++++ bootstrap.sh | 1 + inventory | 3 +++ roles/base/files/default-keyboard | 11 -------- roles/base/tasks/main.yml | 42 +---------------------------- roles/desktop/tasks/main.yml | 45 +++++++++++++++++++++++++++++++ roles/development/tasks/main.yml | 21 ++++++++++++++- roles/dotfiles/tasks/main.yml | 1 + roles/tailscale/tasks/main.yml | 16 +++++++++++ site.yml | 11 ++++++++ 10 files changed, 139 insertions(+), 53 deletions(-) create mode 100644 README.org create mode 100644 bootstrap.sh delete mode 100644 roles/base/files/default-keyboard create mode 100644 roles/desktop/tasks/main.yml create mode 100644 roles/tailscale/tasks/main.yml diff --git a/README.org b/README.org new file mode 100644 index 0000000..2ee2118 --- /dev/null +++ b/README.org @@ -0,0 +1,41 @@ +#+TITLE: ansible config +#+AUTHOR: kyle + +* wntrmute ansible + + This is my ansible configuration for setting up various machines. + +** Assumptions + + The systems that I use with Ansible are virtually all Ubuntu, or at + least Debian-ish systems. I do have some NixOS machines, but these + use deep NixOS magic and their configuration is stored in the Elder + Scrolls that would drive mortals mad to read. + + This is also for interactive systems, e.g. ones that I log into and + do things. It expects that I will spend time in the shell doing shell + things. + +** Bootstrapping + + Run `./bootstrap.sh`. + +** Makefile + + The Makefile has a few targets worth knowing about: + + + check: syntax checking + + all (default target): Picard this thing (make it so). + + +** Roles + +*** base + + base is the stuff I don't really want to have to live without no + matter what machine I'm on. It shouldn't expect graphical stuff. + +*** desktop + + desktop installs the heavier and GUI things that I'd want on a + desktop (or realistically, a laptop). diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100644 index 0000000..f1f641a --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1 @@ +#!/usr/bin/env bash diff --git a/inventory b/inventory index 296b41a..4767d77 100644 --- a/inventory +++ b/inventory @@ -1,2 +1,5 @@ [laptop] petrichor + +[kodiak-laptop] +kisom-x1 \ No newline at end of file diff --git a/roles/base/files/default-keyboard b/roles/base/files/default-keyboard deleted file mode 100644 index 25bb3a5..0000000 --- a/roles/base/files/default-keyboard +++ /dev/null @@ -1,11 +0,0 @@ -# KEYBOARD CONFIGURATION FILE - -# Consult the keyboard(5) manual page. - -XKBMODEL="pc105" -XKBLAYOUT="us" -XKBVARIANT="" -XKBOPTIONS="ctrl:swapcaps,compose:ralt" - -BACKSPACE="guess" - diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index c11fa1a..b96212e 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -1,35 +1,15 @@ -- name: set up keyboard controls - become: true - ansible.builtin.copy: - dest: /etc/default/keyboard - owner: root - group: root - mode: 0644 - content: | - # KEYBOARD CONFIGURATION FILE - # Consult the keyboard(5) manual page. - # managed by ansible - - XKBMODEL="pc105" - XKBLAYOUT="us" - XKBVARIANT="" - XKBOPTIONS="ctrl:swapcaps,compose:ralt" - - BACKSPACE="guess" - - name: set up common tools become: true ansible.builtin.apt: name={{ item }} state=present with_items: - - acpitool - curl - - emacs - htop - iftop - iotop - imagemagick - keychain - mg + - nvi - pandoc - par - powertop @@ -44,24 +24,4 @@ - tmux - tree - unzip - - vim-gtk - zsh - -- name: set up desktop environments - become: true - ansible.builtin.apt: name={{ item }} state=present - with_items: - - i3 - - i3lock - -- name: set up xprogs - become: true - ansible.builtin.apt: name={{ item }} state=present - with_items: - - arandr - - evince - - feh - - firefox - - gparted - - scrot - - vlc diff --git a/roles/desktop/tasks/main.yml b/roles/desktop/tasks/main.yml new file mode 100644 index 0000000..9ed0ad0 --- /dev/null +++ b/roles/desktop/tasks/main.yml @@ -0,0 +1,45 @@ +- name: set up keyboard controls + become: true + ansible.builtin.copy: + dest: /etc/default/keyboard + owner: root + group: root + mode: 0644 + content: | + # KEYBOARD CONFIGURATION FILE + # Consult the keyboard(5) manual page. + # managed by ansible + + XKBMODEL="pc105" + XKBLAYOUT="us" + XKBVARIANT="" + XKBOPTIONS="ctrl:swapcaps,compose:ralt" + + BACKSPACE="guess" + +- name: set up common desktop tools + become: true + ansible.builtin.apt: name={{ item }} state=present + with_items: + - acpitool + - emacs + - vim-gtk + +- name: set up desktop environments + become: true + ansible.builtin.apt: name={{ item }} state=present + with_items: + - i3 + - i3lock + +- name: set up xprogs + become: true + ansible.builtin.apt: name={{ item }} state=present + with_items: + - arandr + - evince + - feh + - firefox + - gparted + - scrot + - vlc diff --git a/roles/development/tasks/main.yml b/roles/development/tasks/main.yml index b068340..1dc5c92 100644 --- a/roles/development/tasks/main.yml +++ b/roles/development/tasks/main.yml @@ -79,7 +79,6 @@ - genext2fs - genisoimage - genromfs - - initramfs-tools - makebootfat - mmdebstrap - proot @@ -186,6 +185,26 @@ become: true ansible.builtin.apt: name=code state=present +## rust + +- name: check if cargo is installed + shell: command -v cargo + register: cargo_exists + ignore_errors: yes + +- name: Download Installer + when: cargo_exists is failed + get_url: + url: https://sh.rustup.rs + dest: /tmp/sh.rustup.rs + mode: '0755' + force: 'yes' + +- name: install rust/cargo + when: cargo_exists is failed + shell: /tmp/sh.rustup.rs -y + + ## AI/ML stuff - name: install machine learning and AI tools diff --git a/roles/dotfiles/tasks/main.yml b/roles/dotfiles/tasks/main.yml index a2230bb..3b6d3e1 100644 --- a/roles/dotfiles/tasks/main.yml +++ b/roles/dotfiles/tasks/main.yml @@ -27,6 +27,7 @@ - .gitignore_global - .hgrc - .mg + - .profile_custom - .vimrc - .XCompose diff --git a/roles/tailscale/tasks/main.yml b/roles/tailscale/tasks/main.yml new file mode 100644 index 0000000..f2706fc --- /dev/null +++ b/roles/tailscale/tasks/main.yml @@ -0,0 +1,16 @@ +- name: check if tailscale is installed + shell: command -v tailscale + register: tailscale_exists + ignore_errors: yes + +- name: download tailscale installer + when: tailscale_exists is failed + get_url: + url: https://tailscale.com/install.sh + dest: /tmp/tailscale.sh + mode: '0755' + force: 'yes' + +- name: install tailscale + when: tailscale_exists is failed + shell: /tmp/tailscale.sh diff --git a/site.yml b/site.yml index 6dc574c..d312d78 100644 --- a/site.yml +++ b/site.yml @@ -3,6 +3,17 @@ - base - dotfiles - development + - tailscale - heavy vars: laptop_user: kyle + +- hosts: work-laptop + roles: + - base + - dotfiles + - development + - tailscale + - heavy + vars: + laptop_user: k.isom