Sat, 30 May 2015 04:14:54 -0400
Add some useful comments
roles/devbox/tasks/debian.yml | file | annotate | diff | comparison | revisions | |
roles/devbox/tasks/main.yml | file | annotate | diff | comparison | revisions |
--- a/roles/devbox/tasks/debian.yml +++ b/roles/devbox/tasks/debian.yml @@ -1,5 +1,6 @@ --- +# Not used here, but nice to have ready - name: add backports apt_repository: repo: "deb http://http.debian.net/debian {{ansible_distribution_release}}-backports main" @@ -40,14 +41,8 @@ tags: packages, install -- name: Check for lightdm.conf +- name: Set default X session to i3 when: with_gui - stat: - path: /etc/lightdm/lightdm.conf - register: lightdmconf - -- name: Set default X session to i3 - when: with_gui and lightdmconf.stat.exists ini_file: dest: /etc/lightdm/lightdm.conf section: SeatDefaults
--- a/roles/devbox/tasks/main.yml +++ b/roles/devbox/tasks/main.yml @@ -1,24 +1,10 @@ --- -# - repos ? -# - backports -# - pgdg -# x update -# x upgrade -# x packages: build-essentials, git, hg, vim-gtk, i3, ffx, ag, ctags, zsh, tmux, ruby, fonts? -# - vbox exts? -# - default x session -# - user -# - dotfiles -# - authorized keys? -# - ssh ids from vault? pgp? -# - homedir-setup -# - sudo group -# - plenv - rbenv build? - - include: debian.yml when: ansible_distribution == 'Debian' + +# sudo may not be everywhere. wheel is a common alternative - name: Enable sudo for sudo group lineinfile: dest: /etc/sudoers @@ -26,6 +12,8 @@ regexp: '^%sudo' line: '%sudo ALL=(ALL:ALL) ALL' + +# Create/update my user, don't clobber my extra groups. - name: User setup user: name: "{{user.name}}" @@ -35,7 +23,8 @@ append: true register: user -- name: Pubkey for user + +- name: ssh | Pubkey for user authorized_key: manage_dir: true user: "{{user.name}}" @@ -43,7 +32,7 @@ with_file: - public_keys/{{user.name}} -- name: Ensure hostkeys +- name: ssh | Ensure known_hosts keys sudo: true sudo_user: "{{user.name}}" lineinfile: @@ -54,7 +43,7 @@ mode: 0600 with_dict: hostkeys -- name: Purge hostkeys +- name: ssh | Purge invalid known_hosts keys sudo: true sudo_user: "{{user.name}}" lineinfile: @@ -63,6 +52,10 @@ line: "{{item.value}}" with_dict: hostkeys_removed + +# I like to make my ~ my dotfiles working directory (some folks symlink +# everything) Here that means I clone, move hg, then checkout, clobbering any +# conflicts with /etc/skel stuff. - name: Check for dotfiles checkout in homedir stat: path={{user.home}}/.hg register: dotfiles @@ -76,6 +69,9 @@ && chown -R {{user.name}}:{{user.group}} {{user.home}}/.hg && sudo -u {{user.name}} hg -R {{user.home}} update -C + +# This is an existing script that clones/updates oh-my-zsh, rbenv, and plenv. +# My dotfiles use each if the right directory exists. - name: Run homedir-setup sudo: true sudo_user: "{{user.name}}"