Merge pull request #464 from genebean/cleanup

Cleaning out the cobwebs
This commit is contained in:
Gene Liverman 2024-12-02 21:54:05 -05:00 committed by GitHub
commit ba91e6b0ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
67 changed files with 1 additions and 3038 deletions

View file

@ -112,7 +112,7 @@ $ tree . -I legacy* -I link* --gitignore --dirsfirst
## Historical bits
This repo historically contained my dot files. Historically symlinked files are still in `link/`. Most all the other old stuff is now tucked away under `legacy/` to get it out of the way until I decide what is and isn't needed.
This repo historically contained my dot files. Historically symlinked files on Windows are still in `windows/`. Everything else is just in git history now.
## Adding a new macOS host

5
Vagrantfile vendored
View file

@ -1,5 +0,0 @@
# frozen_string_literal: true
Vagrant.configure('2') do |config|
config.vm.box = 'genebean/centos-7-nocm'
end

View file

@ -1,13 +0,0 @@
# Ansible Bootstrapping
Temporary docs for Ansible as I work things out.
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH="$HOME/.local/bin:$PATH"
python3 -m pip install --user ansible ansible-lint
ansible-galaxy collection install jonellis.sudoers
ansible-galaxy install gantsign.oh-my-zsh
ansible-galaxy install jack1142.apt_signing_key
ansible-playbook -i ansible/ansible_hosts.yaml --ask-become-pass ansible/carbonbean.yaml --verbose
```

View file

@ -1,20 +0,0 @@
---
all:
hosts:
bigboy-wsl:
ansible_connection: local
blue-rock:
ansible_connection: local
children:
servers:
vars:
ansible_connection: ssh
hosts:
cloud2.technicalissues.us:
ansible_user: gene
mail.alt.technicalissues.us:
ansible_user: gliverma
mini-watcher.local:
ansible_user: gene
tart.local:
ansible_user: pi

View file

@ -1,142 +0,0 @@
---
- name: Install packages
hosts: bigboy-wsl
vars:
ansible_python_interpreter: '/usr/bin/python3'
tasks:
- name: Install Microsoft keys and repo
become: true
ansible.builtin.apt:
state: present
force: true
deb: https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
- name: Base packages from apt
become: true
ansible.builtin.apt:
update_cache: true
state: latest
pkg:
- bat
- bundler
- cmake
- dconf-editor
- dos2unix
- exa
- gh
- git
- git-lfs
- gnupg
- htop
- httpie
- hub
- hugo
- iftop
- jq
- libssl-dev
- neofetch
- pass
- pcsc-tools
- pcscd
- powershell
- rake
- ruby
- ruby-dev
- scdaemon
- snapd
- tilix
- traceroute
- tree
- vim
- xclip
- zsh
- name: Install git-credential-manager deb package
become: true
ansible.builtin.apt:
state: present
deb: https://github.com/GitCredentialManager/git-credential-manager/releases/download/v2.0.696/gcmcore-linux_amd64.2.0.696.deb
- name: Install delta via deb package on GitHub
become: true
ansible.builtin.apt:
state: present
deb: https://github.com/dandavison/delta/releases/download/0.13.0/git-delta_0.13.0_amd64.deb
- name: Base packages from Snapcraft
become: true
community.general.snap:
name:
- cctv-viewer # only available here
- name: hiera-eyaml gem
community.general.gem:
name: hiera-eyaml
state: latest
- name: vmfloaty gem
community.general.gem:
name: vmfloaty
state: latest
- name: Python packages via pip
ansible.builtin.pip:
state: latest
name:
- ansible
- ansible-lint
- flake8
- pywinrm
- name: ensure fonts directory
file:
path: "{{ lookup('env', 'HOME') }}/.fonts"
state: directory
- name: Hack exists
shell: "ls {{ lookup('env', 'HOME') }}/.fonts/Hack*Nerd*Font*Complete*"
register: hack_exists
ignore_errors: true
- name: Download Hack
when: hack_exists is failed
ansible.builtin.unarchive:
src: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hack.zip
dest: "{{ lookup('env', 'HOME') }}/.fonts/"
remote_src: true
- name: Setup Oh My ZSH
include_role:
name: gantsign.oh-my-zsh
vars:
oh_my_zsh_theme: steeef
oh_my_zsh_plugins:
- git
users:
- username: "{{ lookup('env', 'USER') }}"
# - name: Symlink .zshrc
# ansible.builtin.file:
# src: "{{ lookup('env', 'HOME') }}/repos/dots/link/nix/zshrc"
# dest: "{{ lookup('env', 'HOME') }}/.zshrc"
# state: link
# - name: Set shell to zsh and add to groups
# become: true
# ansible.builtin.user:
# name: "{{ lookup('env', 'USER') }}"
# shell: /usr/bin/zsh
# append: true
# groups:
# - dialout
- name: Add passwordless sudo entries
become: true
community.general.sudoers:
name: "{{ lookup('env', 'USER') }}-no-password"
user: "{{ lookup('env', 'USER') }}"
nopassword: true
commands:
- /usr/bin/systemctl restart pcscd
- /usr/bin/pkill -9 gpg-agent

View file

@ -1,127 +0,0 @@
---
- name: Install packages
hosts: blue-rock
vars:
ansible_python_interpreter: '/usr/local/bin/python3'
tasks:
- name: Install packages from Homebrew
community.general.homebrew:
state: latest
name:
- adr-tools
# - cdktf
- chart-testing
- coreutils
- dog
- dust
- gh
- gotop
- helm
- hub
- jq
- k9s
- kubectl
- kubectx
- mas
- neovim
- npm
- python
- subversion
- tree
- wget
- yq
# - name: Install casks from Homebrew
# community.general.homebrew:
# state: present
# name:
# - homebrew/cask/1password
# - homebrew/cask/cakebrew
# - homebrew/cask/elgato-stream-deck
# - homebrew/cask/firefox
# - homebrew/cask/google-drive
# - homebrew/cask/iterm2
# - homebrew/cask/keepingyouawake
# - homebrew/cask/logseq
# - homebrew/cask/meld
# - homebrew/cask/obs
# - homebrew/cask/signal
# - homebrew/cask/slack
# - homebrew/cask/thunderbird
# - homebrew/cask/visual-studio-code
# - homebrew/cask/vivaldi
# - homebrew/cask/whatsapp
# - homebrew/cask/zoom
# - homebrew/cask-fonts/font-hack-nerd-font
# - homebrew/cask-fonts/font-inconsolata-g-for-powerline
# - homebrew/cask-fonts/font-source-code-pro-for-powerline
# - puppetlabs/puppet/pdk
# - name: Install apps from App Store
# community.general.mas:
# state: present
# id:
# - 1569813296 # 1Password for Safari
# - 417375580 # BetterSnapTool
# - 1532419400 # MeetingBar for Meet, Zoom & Co
# - 1451685025 # WireGuard
- name: Install packages with pip
ansible.builtin.pip:
name:
- ansible
- ansible-lint
# - powerline-status # repalced with airline
# - psutil
- name: Download Hack Nerd Font
ansible.builtin.unarchive:
src: https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Hack.zip
dest: "{{ lookup('env', 'HOME') }}/Library/Fonts/"
remote_src: true
# Vim setup
- name: Symlink .vimrc
ansible.builtin.file:
src: "{{ lookup('env', 'HOME') }}/repos/dots/link/nix/vimrc"
dest: "{{ lookup('env', 'HOME') }}/.vimrc"
state: link
force: true
# - name: Symlink .vimrc_os_specific
# ansible.builtin.file:
# src: "{{ lookup('env', 'HOME') }}/repos/dots/link/mac/vimrc_os_specific"
# dest: "{{ lookup('env', 'HOME') }}/.vimrc_os_specific"
# state: link
# force: true
- name: Install Vundle
ansible.builtin.git:
repo: 'https://github.com/VundleVim/Vundle.vim'
dest: "{{ lookup('env', 'HOME') }}/.vim/bundle/Vundle.vim"
- name: Install Vundle Plugins
shell: "echo -ne '\n' | vim +PluginInstall! +qall"
# ZSH setup
- name: Clone my oh-my-zsh plugins
ansible.builtin.git:
repo: 'https://github.com/genebean/my-oh-zsh-plugins'
dest: "{{ lookup('env', 'HOME') }}/repos/customized-oh-my-zsh/plugins"
- name: Clone zsh-autosuggestions
ansible.builtin.git:
repo: 'https://github.com/zsh-users/zsh-autosuggestions'
dest: "{{ lookup('env', 'HOME') }}/repos/customized-oh-my-zsh/plugins/zsh-autosuggestions"
- name: Clone my oh-my-zsh themes
ansible.builtin.git:
repo: 'https://github.com/genebean/my-oh-zsh-themes'
dest: "{{ lookup('env', 'HOME') }}/repos/customized-oh-my-zsh/themes"
- name: Symlink .zshrc
ansible.builtin.file:
src: "{{ lookup('env', 'HOME') }}/repos/dots/link/nix/zshrc"
dest: "{{ lookup('env', 'HOME') }}/.zshrc"
state: link
force: true

View file

@ -1,362 +0,0 @@
---
- name: Install packages
hosts: carbonbean
vars:
ansible_python_interpreter: '/usr/bin/python3'
tasks:
- name: Add 1Password apt signing key
ansible.builtin.include_role:
name: jack1142.apt_signing_key
vars:
url: https://downloads.1password.com/linux/keys/1password.asc
key_name: 1password
dearmor: true
- name: Add 1Password repository
become: true
ansible.builtin.apt_repository:
repo: deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main
state: present
filename: 1password
update_cache: false
- name: Add Google Cloud apt key
become: true
ansible.builtin.apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
keyring: /usr/share/keyrings/cloud.google.gpg
state: present
- name: Add Google apt repo
become: true
ansible.builtin.apt_repository:
repo: deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main
state: present
filename: google-cloud-sdk
update_cache: false
- name: Add Okta ASA client apt signing key
ansible.builtin.include_role:
name: jack1142.apt_signing_key
vars:
url: https://dist.scaleft.com/pki/scaleft_deb_key.asc
key_name: scaleft
dearmor: true
- name: Add scaleft / Okta ASA repository
become: true
ansible.builtin.apt_repository:
repo: deb [arch=amd64 signed-by=/usr/share/keyrings/scaleft-archive-keyring.gpg] http://pkg.scaleft.com/deb linux main
state: present
filename: scaleft
update_cache: false
- name: Add HashiCorp apt key
become: true
ansible.builtin.apt_key:
url: https://apt.releases.hashicorp.com/gpg
state: present
- name: Add HashiCorp Jammy repository
become: true
ansible.builtin.apt_repository:
repo: deb [arch=amd64] https://apt.releases.hashicorp.com jammy main
state: present
filename: hashicorp
update_cache: false
- name: Add Tailscale apt signing key
ansible.builtin.include_role:
name: jack1142.apt_signing_key
vars:
url: https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg
key_name: tailscale
- name: Add Tailscale Jammy repository
become: true
ansible.builtin.apt_repository:
repo: deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/ubuntu jammy main
state: present
filename: tailscale
update_cache: false
- name: Add VirtualBox oracle_vbox apt key
become: true
ansible.builtin.apt_key:
url: https://www.virtualbox.org/download/oracle_vbox.asc
state: present
- name: Add VirtualBox oracle_vbox_2016 apt key
become: true
ansible.builtin.apt_key:
url: https://www.virtualbox.org/download/oracle_vbox_2016.asc
state: present
- name: Add VirtualBox Jammy repository
become: true
ansible.builtin.apt_repository:
repo: deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian jammy contrib
state: present
filename: virtualbox
update_cache: false
- name: Install Microsoft keys and repo
become: true
ansible.builtin.apt:
state: present
force: true
deb: https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
- name: Install puppet-tools repo via Focal (20.04) deb package
become: true
ansible.builtin.apt:
state: present
deb: http://apt.puppet.com/puppet-tools-release-focal.deb
- name: Base packages from apt
become: true
ansible.builtin.apt:
update_cache: true
state: latest
pkg:
- 1password
- bat
- boinc-manager
- boinctui
- bundler
- cmake
- code # provided by Pop OS repos
- dconf-editor
- dos2unix
- exa
- gh
- git
- git-lfs
- gnupg
- google-cloud-cli
- google-cloud-cli-gke-gcloud-auth-plugin
- gthumb
- htop
- httpie
- hub
- hugo
- iftop
- jq
- libssl-dev
- neofetch
- packer
- pass
- pcsc-tools
- pcscd
- pdk
- powershell
- puppet-bolt
- rake
- ruby
- ruby-dev
- scdaemon
- scaleft-client-tools
- scaleft-url-handler
- slack-desktop # provided by Pop OS repos
- snapd
- tailscale
- terraform
- tilix
- traceroute
- tree
- vagrant
- vim
- virtualbox-6.1
- vivaldi-stable
- xclip
- yubikey-manager
- zsh
- name: Install git-credential-manager deb package
become: true
ansible.builtin.apt:
state: present
deb: https://github.com/GitCredentialManager/git-credential-manager/releases/download/v2.0.696/gcmcore-linux_amd64.2.0.696.deb
- name: Install Profile Switcher for Firefox deb package
become: true
ansible.builtin.apt:
state: present
deb: https://github.com/null-dev/firefox-profile-switcher-connector/releases/latest/download/linux-x64.deb
- name: Install pe-client-tools via Focal (20.04) deb package
become: true
ansible.builtin.apt:
state: present
deb: https://pm.puppetlabs.com/pe-client-tools/2021.6.0/21.6.0/repos/deb/focal/PC1/pe-client-tools_21.6.0-1focal_amd64.deb
- name: Install TeamViewer via deb
become: true
ansible.builtin.apt:
state: present
deb: https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
- name: Install Webex via deb package
become: true
ansible.builtin.apt:
state: present
deb: https://binaries.webex.com/WebexDesktop-Ubuntu-Official-Package/Webex.deb
- name: Install Zoom via deb package
become: true
ansible.builtin.apt:
state: present
deb: https://zoom.us/client/latest/zoom_amd64.deb
- name: Install delta via deb package on GitHub
become: true
ansible.builtin.apt:
state: present
deb: https://github.com/dandavison/delta/releases/download/0.13.0/git-delta_0.13.0_amd64.deb
- name: Base packages from Flathub
community.general.flatpak:
method: user
name:
- app.resp.RESP
- com.belmoussaoui.Obfuscate
- com.borgbase.Vorta
- com.discordapp.Discord
- com.emqx.MQTTX
- com.feaneron.Boatswain
- flathub org.ferdium.Ferdium
- com.github.bleakgrey.tootle
- com.github.gijsgoudzwaard.image-optimizer
- com.github.joseexposito.touche
- com.github.tchx84.Flatseal
- com.mattjakeman.ExtensionManager
- com.nextcloud.desktopclient.nextcloud
- com.obsproject.Studio
- com.obsproject.Studio.Plugin.Gstreamer
- com.rafaelmardojai.SharePreview
- im.riot.Riot
- info.mumble.Mumble
- io.github.janbar.noson
- io.github.mimbrero.WhatsAppDesktop
- net.cozic.joplin_desktop
- org.ferdium.Ferdium
- org.fritzing.Fritzing
- org.gnome.meld
- org.mozilla.Thunderbird
- org.onlyoffice.desktopeditors
- org.remmina.Remmina
- org.signal.Signal
- name: Base packages from Snapcraft
become: true
community.general.snap:
name:
- cctv-viewer # only available here
- name: Snaps requiring classic mode
become: true
community.general.snap:
classic: true
name:
- gitkraken # official version
- name: Cider from Snapcraft
become: true
community.general.snap:
name: cider # official
channel: latest/edge
- name: hiera-eyaml gem
community.general.gem:
name: hiera-eyaml
state: latest
- name: vmfloaty gem
community.general.gem:
name: vmfloaty
state: latest
- name: Python packages via pip
ansible.builtin.pip:
state: latest
name:
- ansible
- ansible-lint
- flake8
- name: Install packages from Homebrew
community.general.homebrew:
state: latest
name:
- adr-tools
- cdktf
- chart-testing
- dog
- dust
- glow
- gotop
- helm
- k9s
- kubectx
- stern
- yq
- name: ensure fonts directory
file:
path: "{{ lookup('env', 'HOME') }}/.fonts"
state: directory
- name: Hack exists
shell: "ls {{ lookup('env', 'HOME') }}/.fonts/Hack*Nerd*Font*Complete*"
register: hack_exists
ignore_errors: true
- name: Download Hack
when: hack_exists is failed
ansible.builtin.unarchive:
src: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hack.zip
dest: "{{ lookup('env', 'HOME') }}/.fonts/"
remote_src: true
- name: Symlink .zshrc
ansible.builtin.file:
src: "{{ lookup('env', 'HOME') }}/repos/dots/link/nix/zshrc"
dest: "{{ lookup('env', 'HOME') }}/.zshrc"
state: link
- name: Set shell to zsh and add to groups
become: true
ansible.builtin.user:
name: "{{ lookup('env', 'USER') }}"
shell: /usr/bin/zsh
append: true
groups:
- dialout
- name: Add passwordless sudo entries
become: true
community.general.sudoers:
name: "{{ lookup('env', 'USER') }}-no-password"
user: "{{ lookup('env', 'USER') }}"
nopassword: true
commands:
- /usr/bin/systemctl restart pcscd
- /usr/bin/pkill -9 gpg-agent
- name: Disable britty so ESPHome flashing works
become: true
ansible.builtin.shell:
cmd: |
for f in /usr/lib/udev/rules.d/*brltty*.rules; do
if [ ! -L "/etc/udev/rules.d/$(basename "$f")" ]; then
ln -s /dev/null "/etc/udev/rules.d/$(basename "$f")"
udevadm control --reload-rules
fi
done
- name: Disable brltty service
become: true
ansible.builtin.service:
name: brltty.service
enabled: false
state: stopped

View file

@ -1,24 +0,0 @@
---
- name: Install and configure zsh
hosts: servers
vars:
ansible_python_interpreter: '/usr/bin/python3'
tasks:
- name: Install zsh using default package manager
become: true
ansible.builtin.package:
state: present
name:
- git
- zsh
- name: Setup Oh My ZSH
include_role:
name: gantsign.oh-my-zsh
vars:
oh_my_zsh_theme: steeef
oh_my_zsh_plugins:
- git
users:
- username: "{{ ansible_user }}"

View file

@ -1,5 +0,0 @@
---
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_JOBS: "3"
BUNDLE_PATH: "vendor/bundle"
BUNDLE_RETRY: "3"

View file

@ -1,8 +0,0 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10

View file

@ -1,15 +0,0 @@
name: Ansible Lint
on:
pull_request:
jobs:
ansbile_linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ansible-lint
uses: ansible-community/ansible-lint-action@main
with:
path: 'ansible/'

View file

@ -1,20 +0,0 @@
name: Ruby
on:
pull_request:
jobs:
ruby_testing:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: ['2.6', '2.7', '3.0', '3.1']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rake tests

View file

@ -1 +0,0 @@
--no-class_inherits_from_params_class-check

View file

@ -1,3 +0,0 @@
--format documentation
--color
--tty

View file

@ -1,9 +0,0 @@
AllCops:
Exclude:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
TargetRubyVersion: 2.5
NewCops: enable
Style/CommentedKeyword:
Enabled: false

View file

@ -1,52 +0,0 @@
# dots
My dot files and a tool to deploy them to various OS's
## The Plan
* files in [link/](link) get symlinked to `~/.{filename}`
* files in [copy/](copy) get copied to `~/.{filename}`
* this process should default to not clobbering existing files
* [bin/dots.rb](bin/dots.rb) is what users will interact with
* it should bootstrap based on the OS it is being run on
* it should run Puppet and associated tools such as r10k via bundler
* it should not utilize Git submodules; it should instead use [vcsrepo](https://forge.puppet.com/puppetlabs/vcsrepo)
* the destination of each repo may well need to be added to the parent's `.gitignore`
* it should configure [iTerm2](https://www.iterm2.com/) on Mac
* it should configure [Atom](https://atom.io/) on all platforms
* it should offer a choice to skip steps related to GUI programs
* it should permit host-specific settings / options
* this will likely be done via entries in a hiera node file
* create a Docker image with all tools preinstaleld and set to mount the current user's home directory as a volume.
* use [gosu](https://github.com/tianon/gosu) so ownership is correct.
* this may not work on Windows...
### Packages to install on Mac's
#### Vundle & Vim
Install via Puppet:
1. link `vimrc`
2. vcsrepo: https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
3. exec `vim +PluginInstall +qall`
#### Powerline
```bash
brew install coreutils python socat tmux
pip install psutil powerline-status
git clone https://github.com/powerline/fonts.git ~/repos/powerline-fonts
cd ~/repos/powerline-fonts
./install.sh
```
##### Thoughts on installing with Puppet:
* [x] install packages using a provider for homebrew
* [x] install packages using the pip provider
* [x] use vcsrepo to clone the fonts
* [x] create a refresh-only exec that runs the install script
* [x] add a notify to the vcsrepo resource that triggers the exec
* this will also take care of bringing in new fonts or updates

View file

@ -1,45 +0,0 @@
# frozen_string_literal: true
# vim:ft=ruby
source 'https://rubygems.org'
# rubocop:disable Style/ConditionalAssignment
if ENV.key?('PUPPET_VERSION')
puppetversion = ENV['PUPPET_VERSION'].to_s
else
puppetversion = ['>= 7', '< 8']
end
# rubocop:enable Style/ConditionalAssignment
group :production do
gem 'os', '~> 1.1'
gem 'puppet', puppetversion
gem 'r10k', '~> 3.15'
gem 'rugged', '~> 1.5'
gem 'xmlrpc', '~> 0.3.0' if RUBY_VERSION >= '2.3'
end
group :development, :unit_tests do
gem 'json', '>= 2.0.2'
gem 'metadata-json-lint', '~> 3.0'
gem 'puppetlabs_spec_helper', '~> 5.0'
gem 'rspec-puppet', '~> 2.12'
gem 'rubocop', '~> 1.44'
gem 'tty-command', '~> 0.6'
gem 'tty-file', '~> 0.9'
gem 'tty-prompt', '~> 0.21'
gem 'yamllint', '~> 0.0.9'
# puppet-lint and plugins
gem 'puppet-lint', '~> 2.5'
gem 'puppet-lint-absolute_classname-check', '~> 3.1'
gem 'puppet-lint-absolute_template_path', '~> 1.0'
gem 'puppet-lint-empty_string-check', '~> 1.0'
gem 'puppet-lint-leading_zero-check', '~> 1.0'
gem 'puppet-lint-resource_reference_syntax', '~> 1.2'
gem 'puppet-lint-spaceship_operator_without_tag-check', '~> 0.1'
gem 'puppet-lint-trailing_newline-check', '~> 1.1'
gem 'puppet-lint-undef_in_function-check', '~> 0.2'
gem 'puppet-lint-unquoted_string-check', '~> 2.2'
gem 'puppet-lint-variable_contains_upcase', '~> 1.3'
end

View file

@ -1,252 +0,0 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.6)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
colored2 (3.1.2)
concurrent-ruby (1.1.10)
cri (2.15.11)
deep_merge (1.2.2)
diff-lcs (1.5.0)
erubi (1.12.0)
facter (4.2.14)
hocon (~> 1.3)
thor (>= 1.0.1, < 2.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fast_gettext (2.2.0)
forwardable (1.3.3)
gettext (3.4.3)
erubi
locale (>= 2.0.5)
prime
text (>= 1.3.0)
gettext-setup (1.1.0)
fast_gettext (~> 2.1)
gettext (~> 3.4)
locale
hiera (3.11.0)
hocon (1.3.1)
json (2.6.3)
json-schema (3.0.0)
addressable (>= 2.8)
jwt (2.2.3)
locale (2.1.3)
log4r (1.1.10)
metadata-json-lint (3.0.2)
json-schema (>= 2.8, < 4.0)
spdx-licenses (~> 1.0)
minitar (0.9)
mocha (1.16.1)
multi_json (1.15.0)
multipart-post (2.2.3)
os (1.1.4)
parallel (1.22.1)
parser (3.2.0.0)
ast (~> 2.4.1)
pastel (0.8.0)
tty-color (~> 0.5)
pathspec (1.1.3)
prime (0.1.2)
forwardable
singleton
public_suffix (4.0.7)
puppet (7.22.0)
concurrent-ruby (~> 1.0, < 1.2.0)
deep_merge (~> 1.0)
facter (> 2.0.1, < 5)
fast_gettext (>= 1.1, < 3)
hiera (>= 3.2.1, < 4)
locale (~> 2.1)
multi_json (~> 1.10)
puppet-resource_api (~> 1.5)
scanf (~> 1.0)
semantic_puppet (~> 1.0)
puppet (7.22.0-universal-darwin)
CFPropertyList (~> 2.2)
concurrent-ruby (~> 1.0, < 1.2.0)
deep_merge (~> 1.0)
facter (> 2.0.1, < 5)
fast_gettext (>= 1.1, < 3)
hiera (>= 3.2.1, < 4)
locale (~> 2.1)
multi_json (~> 1.10)
puppet-resource_api (~> 1.5)
scanf (~> 1.0)
semantic_puppet (~> 1.0)
puppet-lint (2.5.2)
puppet-lint-absolute_classname-check (3.1.0)
puppet-lint (>= 1.0, < 4)
puppet-lint-absolute_template_path (1.0.1)
puppet-lint (>= 1.1, < 3.0)
puppet-lint-empty_string-check (1.0.0)
puppet-lint (>= 1.0, < 3.0)
puppet-lint-leading_zero-check (1.0.0)
puppet-lint (>= 1.0, < 3.0)
puppet-lint-resource_reference_syntax (1.2.0)
puppet-lint (>= 1.0, < 4)
puppet-lint-spaceship_operator_without_tag-check (0.1.1)
puppet-lint (>= 1.0, < 3.0)
puppet-lint-trailing_newline-check (1.1.0)
puppet-lint (>= 1.0, < 3.0)
puppet-lint-undef_in_function-check (0.2.1)
puppet-lint (>= 1.0, < 3.0)
puppet-lint-unquoted_string-check (2.2.0)
puppet-lint (>= 2.1, < 4)
puppet-lint-variable_contains_upcase (1.3.0)
puppet-lint (>= 1.0, < 4)
puppet-resource_api (1.8.14)
hocon (>= 1.0)
puppet-syntax (3.2.1)
puppet (>= 5)
rake
puppet_forge (3.2.0)
faraday (~> 1.3)
faraday_middleware (~> 1.0)
minitar
semantic_puppet (~> 1.0)
puppetlabs_spec_helper (5.0.3)
mocha (~> 1.0)
pathspec (>= 0.2, < 2.0.0)
puppet-lint (>= 2.5.2, < 4.0.0)
puppet-syntax (~> 3.0)
rspec-github (~> 2.0)
rspec-puppet (~> 2.0)
r10k (3.15.4)
colored2 (= 3.1.2)
cri (>= 2.15.10)
fast_gettext (>= 1.1.0, < 3.0.0)
gettext (>= 3.0.2, < 4.0.0)
gettext-setup (>= 0.24, < 2.0.0)
jwt (~> 2.2.3)
log4r (= 1.1.10)
minitar (~> 0.9)
multi_json (~> 1.10)
puppet_forge (>= 2.3.0, < 4.0.0)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.6.2)
rexml (3.2.8)
strscan (>= 3.0.9)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-github (2.4.0)
rspec-core (~> 3.0)
rspec-mocks (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-puppet (2.12.0)
rspec
rspec-support (3.12.0)
rubocop (1.44.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.24.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
rugged (1.5.1)
scanf (1.0.0)
semantic_puppet (1.0.4)
singleton (0.1.1)
spdx-licenses (1.3.0)
strscan (3.1.0)
text (1.3.1)
thor (1.2.1)
trollop (2.9.10)
tty-color (0.6.0)
tty-command (0.10.1)
pastel (~> 0.8)
tty-cursor (0.7.1)
tty-file (0.10.0)
diff-lcs (~> 1.3)
pastel (~> 0.8)
tty-prompt (~> 0.22)
tty-prompt (0.23.1)
pastel (~> 0.8)
tty-reader (~> 0.8)
tty-reader (0.9.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.1)
unicode-display_width (2.4.2)
webrick (1.7.0)
wisper (2.0.1)
xmlrpc (0.3.2)
webrick
yamllint (0.0.9)
trollop (~> 2)
PLATFORMS
x86_64-darwin-19
x86_64-linux
DEPENDENCIES
json (>= 2.0.2)
metadata-json-lint (~> 3.0)
os (~> 1.1)
puppet (>= 7, < 8)
puppet-lint (~> 2.5)
puppet-lint-absolute_classname-check (~> 3.1)
puppet-lint-absolute_template_path (~> 1.0)
puppet-lint-empty_string-check (~> 1.0)
puppet-lint-leading_zero-check (~> 1.0)
puppet-lint-resource_reference_syntax (~> 1.2)
puppet-lint-spaceship_operator_without_tag-check (~> 0.1)
puppet-lint-trailing_newline-check (~> 1.1)
puppet-lint-undef_in_function-check (~> 0.2)
puppet-lint-unquoted_string-check (~> 2.2)
puppet-lint-variable_contains_upcase (~> 1.3)
puppetlabs_spec_helper (~> 5.0)
r10k (~> 3.15)
rspec-puppet (~> 2.12)
rubocop (~> 1.44)
rugged (~> 1.5)
tty-command (~> 0.6)
tty-file (~> 0.9)
tty-prompt (~> 0.21)
xmlrpc (~> 0.3.0)
yamllint (~> 0.0.9)
BUNDLED WITH
2.3.5

View file

@ -1,159 +0,0 @@
# dots
[![Ansible Lint](https://github.com/genebean/dots/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/genebean/dots/actions/workflows/ansible-lint.yml)
[![Ruby](https://github.com/genebean/dots/actions/workflows/ruby.yml/badge.svg)](https://github.com/genebean/dots/actions/workflows/ruby.yml)
> **NOTICE:** this repo is undergoing a transformation. Historically it has been centered around using Puppet and r10k as ruby gems. I love Puppet for managing servers, but running it unprivledged as a gem has proven more than a little challenging in this specific use case. As a result, I am transitioning to using Ansible for the adhoc work that is needed here. Also, the `dots` tool and associated rake tasks will almost certainly be moved to Python 3 as it is universally available without some of the hastles of a bundler based setup.
This repo contains my dot files and a tool to deploy them, and the programs that use them, to various OS's. Some additional tools that I consider part of my baseline setup are also installed and, if possible, configured by dots.
Dots is written in ruby and utilizes bundler to keep all its dependancies
as self-contained as possible. Installation of programs and management of git
repositories is handled by way of the
[Puppet gem](https://rubygems.org/gems/puppet).
Everything about dots macOS assumes you are running it as a normal user,
not as root. Strange and unexpected things could well happen if you run any part
of it as root or via sudo while on macOS. That said, sudo is required on Debian
due to there not being an equivalent to homebrew as you need sudo to use apt.
## Currently Supported OS's
* macOS
* Linux Mint 18.2
## Initial Setup
```bash
git clone git@github.com:genebean/dots.git ~/.dotfiles
cd ~/.dotfiles
bin/bootstrap.sh
This script takes care of getting dots ready to use
Enter the number of the task you want to perform:
1) Mac setup
2) EL setup
3) Mint setup
4) Quit
Task:
```
After you run the setup for your OS you will want to make sure that
[puppet/production/hieradata/nodes/](puppet/production/hieradata/nodes/)
contains a file matching the hostname of your machine. That file needs to
contain at least the following:
```yaml
---
homedir: '/Users/johndoe'
```
Naturally, you will want to adjust the entry to match the real path to your
home directory. On a Mac this is generally in `/Users/` or `/home/` on Linux.
## Running dots
The primary way to interact with dots is via `bundle exec rake dots`.
This will run an interactive cli program like so:
```
$ bundle exec rake dots
/usr/local/Cellar/ruby/2.4.1_1/bin/ruby bin/dots.rb
It seems you are on macOS 10.12.5
What would you like to do? (Use arrow keys, press Enter to select)
‣ copy
link
install
```
If not on macOS then you will need to use sudo for the install step:
```
$ sudo bundle exec rake dots
```
Additional tasks are available in the
dots namespace. You can see all the available tasks via
`bundle exec rake -T`.
## Notes
#### Running Puppet
```bash
# Any of these will work:
bundle exec rake dots:run_puppet
bundle exec rake dots:run_puppet_noop
bundle exec puppet apply --environmentpath ~/.dotfiles/puppet ~/.dotfiles/puppet/production/manifests/site.pp
```
As mentioned above, when not on macOS you will need to prefix bundle with sudo.
#### Installed Homebrew packages
To see what has been installed (not the deps) run `brew leaves`
## Project structure
* `bin/`: this is where the "application" bits live
* `bin/bootstrap`: platform specific helpers called by `bin/bootstrap.sh`
* `copy/`: files directly in this directory are copied to all hosts
* `copy/mac/`: files in here get copied to Macs
* `copy/nix/`: files in here get copied to all Posix systems
* `link/`: files directly in this directory are symlinked on all hosts.
* all symlinks are prefixed with a dot. Ex: `link/gemrc` becomes `~/.gemrc`
* `link/linux/`: files in here get symlinked on all Linux distros
* `link/mac/`: files in here get symlinked on all Macs
* `link/nix/`: files in here get symlinked on all Posix systems
* `link/ssh/`: these files get symlinked under `~/.ssh/` on all Posix systems
* `puppet/`: this is basically a control repo modified to suit this setup
* `puppet/production/`: items from an environment's branch in a control repo
* this setup assumes Puppet 4 and Hiera 5. Hiera's config is parsed as part of
the environment rather than from a global config file.
* `spec/`: unit tests go here
## Adding Packages
To add additional pacakages to be installed and managed by dots you will need to
edit the associated Puppet manifest. Currently, this consists of the following:
```bash
puppet/production/site/profile/manifests/
├── base.pp
├── linux
│   └── debian.pp
├── linux.pp
└── mac.pp
```
On macOS you can easily install packages and casks from homebrew or Python
modules from pip. On Linux Mint you can easily use any package provider
that supports Debian or Ubuntu since all installs are done via sudo. On both
platforms you can also use custom exec's to to work around limitations. For
example, an exec is used on Mint to set the shell to zsh and on both platforms
to install or update the powerline fonts.
## Puppet Customizations
This repo also contains some custom facts and functions under
`puppet/production/site/custom_libs`:
### Facts
* `os_release`: this creates a structured fact out of the contents of
/etc/os-release on Linux systems. This info is needed on Mint to determine
what version of Ubuntu it is based on.
### Functions
* `find_group`: returns the owning group's GID as a string for the file or
folder at a given path
* `find_owner`: returns the owning user's UID as a string for the file or
folder at a given path

View file

@ -1,63 +0,0 @@
# frozen_string_literal: true
require 'rubocop/rake_task'
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'tty-command'
require 'yamllint/rake_task'
require_relative 'bin/rake_tasks'
exclude_paths = [
'pkg/**/*',
'vendor/**/*',
'spec/**/*'
]
# https://docs.rubocop.org/rubocop/0.86/integration_with_other_tools.html#rake-integration
RuboCop::RakeTask.new
PuppetLint::RakeTask.new :lint do |config|
config.fail_on_warnings = true
config.ignore_paths = exclude_paths
end
PuppetSyntax.exclude_paths = exclude_paths
desc 'Validate manifests, templates, and ruby files'
task :validate do
Dir['puppet/manifests/**/*.pp',
'puppet/site/*/manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
end
Dir['bin/**/*.rb',
'spec/**/*.rb'].each do |ruby_file|
# rubocop:disable Style/RegexpLiteral
sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/
# rubocop:enable Style/RegexpLiteral
end
Dir['puppet/site/*/templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end
YamlLint::RakeTask.new do |yamllint|
yamllint.paths = %w[
.*.yaml
.*.yml
*.yaml
*.yml
copy/**/*.yml
link/**/*.yml
puppet/hieradata/**/*.yml
puppet/hieradata/**/*.yaml
]
end
task :tests do
Rake::Task[:lint].invoke
Rake::Task[:yamllint].invoke
Rake::Task[:validate].invoke
Rake::Task[:rubocop].invoke
Rake::Task[:spec].invoke
end

View file

@ -1,27 +0,0 @@
#!/bin/bash
echo 'This script takes care of getting dots ready to use'
echo 'Enter the number of the task you want to perform:'
PS3='Task: '
select TASK in 'Mac setup' 'EL setup' 'Mint setup' 'Quit';
do
case $TASK in
'Mac setup' )
~/.dotfiles/bin/bootstrap/bootstrap_mac.sh now
;;
'EL setup' )
~/.dotfiles/bin/bootstrap/bootstrap_el.sh now
;;
'Mint setup' )
~/.dotfiles/bin/bootstrap/bootstrap_mint.sh now
;;
'Quit' )
echo 'Exiting'
exit 0
;;
* )
echo 'Invalid selection, quitting.'
exit 1
;;
esac
done

View file

@ -1,22 +0,0 @@
#!/bin/bash
if [[ $1 == 'now' ]]; then
# Install dot's dependencies
sudo yum install -y centos-release-scl-rh.noarch
sudo yum install rh-ruby26 rh-ruby26-ruby-devel rh-ruby26-rubygem-bundler rh-ruby26-rubygem-rake cmake gcc
# Make dot usable
cd ~/.dotfiles
cat bin/sclbundle|sudo tee /usr/local/bin/dotbundle > /dev/null
sudo chmod a+x /usr/local/bin/dotbundle
cat bin/sclruby|sudo tee /usr/local/bin/dotruby > /dev/null
sudo chmod a+x /usr/local/bin/dotruby
/usr/local/bin/dotbundle install
# Install Puppet modules
/usr/local/bin/dotbundle exec rake dots:run_r10k
# Display tasks that can be run
echo 'These are the task that can now be executed:'
/usr/local/bin/dotbundle exec rake -T |grep --color=never 'rake dots'
fi

View file

@ -1,21 +0,0 @@
#!/bin/bash
if [[ $1 == 'now' ]]; then
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install dot's dependencies
/usr/local/bin/brew install ruby@2.7 cmake pkg-config
/usr/local/bin/gem install --no-ri --no-rdoc bundler
# Make dot usable
cd ~/.dotfiles
/usr/local/bin/bundle install
# Install Puppet modules
/usr/local/bin/bundle exec rake dots:run_r10k
# Display tasks that can be run
echo 'These are the task that can now be executed:'
/usr/local/bin/bundle exec rake -T |grep --color=never 'rake dots'
fi

View file

@ -1,21 +0,0 @@
#!/bin/bash
if [[ $1 == 'now' ]]; then
# Install dot's dependencies
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.4 ruby2.4-dev ruby-switch cmake build-essential
sudo ruby-switch --set ruby2.4
sudo gem install --no-ri --no-rdoc bundler
# Make dot usable
cd ~/.dotfiles
bundle install
# Install Puppet modules
bundle exec rake dots:run_r10k
# Display tasks that can be run
echo 'These are the task that can now be executed:'
bundle exec rake -T |grep --color=never 'rake dots'
fi

View file

@ -1 +0,0 @@
brew install --cask adobe-acrobat-reader boinc virtualbox virtualbox-extension-pack vagrant

View file

@ -1,82 +0,0 @@
# frozen_string_literal: true
require 'open3'
require 'os'
require 'tty-command'
require 'tty-file'
require 'tty-prompt'
require_relative 'dotutils'
cmd = TTY::Command.new
@prompt = TTY::Prompt.new(help_color: :magenta)
@home = File.expand_path('~')
@dotroot = File.dirname(File.dirname(File.expand_path($PROGRAM_NAME)))
@excludes = %w[linux mac nix ssh]
@files_copy = Dir.glob("#{@dotroot}/copy/*")
@files_link = Dir.glob("#{@dotroot}/link/*")
@ssh_link = Dir.glob("#{@dotroot}/link/ssh/*")
if OS.posix?
@files_copy.concat Dir.glob("#{@dotroot}/copy/nix/*")
@files_link.concat Dir.glob("#{@dotroot}/link/nix/*")
end
if OS.windows?
puts 'It seems you are on Windows'
elsif OS.mac?
mac_vers
@files_copy.concat Dir.glob("#{@dotroot}/copy/mac/*")
@files_link.concat Dir.glob("#{@dotroot}/link/mac/*")
elsif OS.linux?
@files_link.concat Dir.glob("#{@dotroot}/link/linux/*")
else
abort("I'm not sure what to do with this OS...") unless OS.posix?
end
task = @prompt.select('What would you like to do?', %w[copy link install exit])
case task
when 'copy'
if @prompt.yes?('Are you sure you want to copy these files?')
@files_copy.each do |file|
unless @excludes.include?(File.basename(file))
puts "Copying #{file} to #{@home}/.#{File.basename(file)}"
copy_file(file, "#{@home}/.#{File.basename(file)}")
end
end
else
puts 'not copying'
end
when 'link'
if @prompt.yes?('Are you sure you want to link your dot files?')
@files_link.each do |file|
unless @excludes.include?(File.basename(file))
# puts "Linking #{@home}/.#{File.basename(file)} to #{file}"
link_file(file, "#{@home}/.#{File.basename(file)}")
end
end
# rubocop:disable Style/NumericLiteralPrefix
Dir.mkdir("#{@home}/.ssh", 0700) unless File.directory?("#{@home}/.ssh")
# rubocop:enable Style/NumericLiteralPrefix
@ssh_link.each do |file|
link_file(file, "#{@home}/.ssh/#{File.basename(file)}")
end
else
puts 'not linking'
end
when 'install'
if @prompt.yes?('Are you sure you want to install your base packages?')
cmd.run('bundle exec rake dots:run_puppet')
cmd.run('bundle exec rake dots:vim_plugins')
end
when 'exit'
exit
end # end of the case statement

View file

@ -1,76 +0,0 @@
# frozen_string_literal: true
def existing_symlink(source, destination)
return if File.readlink(destination).eql?(source)
# rubocop:disable Layout/LineLength
if @prompt.yes?("#{destination} currently points to #{File.readlink(destination)}, do you want point it at #{source}?")
File.unlink(destination)
puts "Linking #{destination} to #{source}"
File.symlink(source, destination)
puts 'link replaced'
else
puts "#{destination} is unchanged"
end
# rubocop:enable Layout/LineLength
end
# rubocop:disable Metrics/MethodLength
def rename_file(source, destination, action)
puts "#{destination} exists, renaming to #{destination}.predots"
File.rename(destination, "#{destination}.predots")
case action
when 'link'
puts "Linking #{destination} to #{source}"
File.symlink(source, destination)
when 'copy'
puts "Copying #{destination} to #{source}"
FileUtils.cp_r(source, destination)
else
raise ArgumentError, "'#{action}' is not a valid action", backtrace
end
end
# rubocop:enable Metrics/MethodLength
def copy_file(source, destination)
if File.exist?(destination)
if @prompt.yes?("#{destination} exists, do you want to replace it?")
rename_file(source, destination, 'copy')
else
puts "#{destination} is unchanged"
end
else
FileUtils.cp_r(source, destination)
end
end
def link_file(source, destination)
if File.exist?(destination) && File.symlink?(destination)
existing_symlink(source, destination)
elsif File.exist?(destination)
# this catches anything that is not a symlink
rename_file(source, destination, 'link')
else
puts "Linking #{destination} to #{source}"
File.symlink(source, destination)
end
end
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
def mac_vers
stdout, _stderr, _status = Open3.capture3('sw_vers -productVersion')
if Integer(stdout.strip.split('.')[0]) == 10
if Integer(stdout.strip.split('.')[1]) >= 12
puts "It seems you are on macOS #{stdout.strip}"
else
puts "It seems you are on OX X #{stdout.strip}"
end
elsif Integer(stdout.strip.split('.')[0]) < 10
puts "Wow... you're sure running an old os (#{stdout.strip} to be exact)"
else
abort("It seems you are on a Mac but I don't know what to do on \
v#{stdout.strip}")
end
end
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize

View file

@ -1,42 +0,0 @@
# frozen_string_literal: true
desc 'Run dots'
task :dots do
ruby 'bin/dots.rb'
end
# rubocop:disable Metrics/BlockLength
namespace 'dots' do
cmd = TTY::Command.new
desc 'Run r10k'
task :run_r10k do
command = 'bundle exec r10k puppetfile install \
--puppetfile ~/.dotfiles/puppet/production/Puppetfile -v'
cmd.run(command)
end
desc 'Run Puppet'
task :run_puppet do
command = 'bundle exec puppet apply \
--environmentpath ~/.dotfiles/puppet \
~/.dotfiles/puppet/production/manifests/site.pp'
cmd.run(command)
end
desc 'Run Puppet (noop)'
task :run_puppet_noop do
command = 'bundle exec puppet apply \
--environmentpath ~/.dotfiles/puppet \
~/.dotfiles/puppet/production/manifests/site.pp --noop'
cmd.run(command)
end
desc 'Install Vundle Plugins'
task :vim_plugins do
# running this command from bundler refuses to work
command = 'vim +PluginInstall! +qall'
puts "Run '#{command}' to get your Vundle plugins installed and/or updated"
end
end
# rubocop:enable Metrics/BlockLength

View file

@ -1,2 +0,0 @@
source /opt/rh/rh-ruby24/enable
bundle "$@"

View file

@ -1,2 +0,0 @@
source /opt/rh/rh-ruby24/enable
ruby "$@"

View file

@ -1,26 +0,0 @@
#!/bin/bash
if [ $# -ne 1 ]; then
echo "usage: sudo $0 username"
exit 1
fi
user=$1
zsh_path='/usr/local/bin/zsh'
if [ "$(id -u)" != "0" ]; then
echo "Editing your shell requires admin rights. Run via 'sudo $0'"
exit 1
else
if [ -f "$zsh_path" ]; then
shell_check=$(dscl localhost -read /Local/Default/Users/gene UserShell |grep -c $zsh_path)
if [ $shell_check -eq 0 ]; then
echo "setting shell via dscl"
dscl localhost -change /Local/Default/Users/$user UserShell /bin/bash $zsh_path
fi
else
echo "$zsh_path doesn't exist yet, run Puppet."
exit 1
fi
fi

View file

@ -1,21 +0,0 @@
[user]
name = Gene Liverman
email = gene@technicalissues.us
[commit]
gpgSign = true
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[gpg]
program = gpg2
[init]
defaultBranch = main
[merge]
conflictStyle = diff3
[pull]
rebase = false
[alias]
kraken = !open "gitkraken://repo$(cd "${1:-.}" && git rev-parse --show-toplevel); :"

View file

@ -1,5 +0,0 @@
---
url: 'https://forgeapi.puppetlabs.com'
username: 'genebean'
password: 'change-me-to-a-real-password'

View file

@ -1,3 +0,0 @@
---
gem: --no-ri --no-rdoc

View file

@ -1 +0,0 @@
source "/usr/share/powerline/bindings/tmux/powerline.conf"

View file

@ -1,2 +0,0 @@
" enable powerline
set rtp+='/usr/share/vim/addons/plugin/powerline.vim'

View file

@ -1,15 +0,0 @@
alias ll='ls -G -l'
alias ls='ls -G'
export PATH=$PATH:~/.nexustools
export PATH=$PATH:/Applications/Araxis\ Merge.app/Contents/Utilities
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
#export PS1='\u:☕️ \W \$ '
if [ -f $(brew --prefix)/etc/bash_completion ]; then
source $(brew --prefix)/etc/bash_completion
source $(brew --prefix)/etc/bash_completion.d/git-completion.bash
source $(brew --prefix)/etc/bash_completion.d/git-prompt.sh
fi
export GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\h:\W \$$(__git_ps1) '

View file

@ -1,8 +0,0 @@
source "/usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"
# Make mouse useful in copy mode
set -g mouse on
# Scroll History
set -g history-limit 30000

View file

@ -1,62 +0,0 @@
#requires -Version 2 -Modules posh-git
function Write-Theme {
param(
[bool]
$lastCommandFailed,
[string]
$with
)
$prompt = Write-Prompt -Object "$($sl.PromptSymbols.StartSymbol) " -ForegroundColor $sl.Colors.PromptForegroundColor
If (!$env:_ -contains 'pwsh') {
$prompt += ' '
}
#check the last command state and indicate if failed
If ($lastCommandFailed) {
$prompt += Write-Prompt -Object "$($sl.PromptSymbols.FailedCommandSymbol) " -ForegroundColor $sl.Colors.CommandFailedIconForegroundColor
}
#check for elevated prompt
If (Test-Administrator) {
$prompt += Write-Prompt -Object "$($sl.PromptSymbols.ElevatedSymbol) " -ForegroundColor $sl.Colors.AdminIconForegroundColor
}
$computer = [System.Environment]::MachineName
$path = Get-FullPath -dir $pwd
$prompt += Write-Prompt -Object "$computer" -ForegroundColor $sl.Colors.SessionInfoForegroundColor
$prompt += Write-Prompt -Object ": " -ForegroundColor $sl.Colors.SessionInfoForegroundColor
# Writes the drive portion
$prompt += Write-Prompt -Object "$path "
$status = Get-VCSStatus
if ($status) {
$themeInfo = Get-VcsInfo -status ($status)
$prompt += Write-Prompt -Object " $($themeInfo.VcInfo) " -ForegroundColor $sl.Colors.GitForegroundColor
}
$prompt += Set-Newline
if ($with) {
$prompt += Write-Prompt -Object "$($with.ToUpper()) " -BackgroundColor $sl.Colors.WithBackgroundColor -ForegroundColor $sl.Colors.WithForegroundColor
}
$prompt += Write-Prompt -Object ($sl.PromptSymbols.PromptIndicator) -ForegroundColor $sl.Colors.PromptBackgroundColor
$prompt += ' '
$prompt
}
$sl = $global:ThemeSettings #local settings
$sl.PromptSymbols.StartSymbol = '☕️'
$sl.PromptSymbols.PromptIndicator = [char]::ConvertFromUtf32(0x276F)
$sl.PromptSymbols.SegmentForwardSymbol = [char]::ConvertFromUtf32(0xE0B0)
$sl.Colors.PromptForegroundColor = [ConsoleColor]::White
$sl.Colors.PromptSymbolColor = [ConsoleColor]::White
$sl.Colors.PromptHighlightColor = [ConsoleColor]::DarkBlue
$sl.Colors.GitForegroundColor = [ConsoleColor]::DarkBlue
$sl.Colors.WithForegroundColor = [ConsoleColor]::DarkRed
$sl.Colors.WithBackgroundColor = [ConsoleColor]::Magenta
$sl.Colors.VirtualEnvBackgroundColor = [System.ConsoleColor]::Red
$sl.Colors.VirtualEnvForegroundColor = [System.ConsoleColor]::White

View file

@ -1,234 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#c386f1",
"foreground": "#ffffff",
"leading_diamond": "",
"properties": {
"display_host": false,
"postfix": " "
},
"style": "diamond",
"trailing_diamond": "",
"type": "session"
},
{
"background": "#ff479c",
"foreground": "#ffffff",
"powerline_symbol": "",
"properties": {
"folder_separator_icon": "  ",
"home_icon": "~",
"prefix": "  ",
"style": "folder"
},
"style": "powerline",
"type": "path"
},
{
"background": "#fffb38",
"foreground": "#193549",
"powerline_symbol": "",
"properties": {
"ahead_and_behind_color": "#f26d50",
"ahead_color": "#89d1dc",
"behind_color": "#f17c37",
"display_stash_count": true,
"display_upstream_icon": true,
"local_changes_color": "#ff9248",
"stash_count_icon": " ",
"status_colors_enabled": true
},
"style": "powerline",
"type": "git"
},
{
"background": "#6CA35E",
"foreground": "#ffffff",
"powerline_symbol": "",
"properties": {
"display_version": true,
"prefix": "  "
},
"style": "powerline",
"type": "node"
},
{
"background": "#8ED1F7",
"foreground": "#111111",
"powerline_symbol": "",
"properties": {
"display_version": true,
"prefix": "  "
},
"style": "powerline",
"type": "go"
},
{
"background": "#4063D8",
"foreground": "#111111",
"powerline_symbol": "",
"properties": {
"display_version": true,
"prefix": "  "
},
"style": "powerline",
"type": "julia"
},
{
"background": "#FFDE57",
"foreground": "#111111",
"powerline_symbol": "",
"properties": {
"display_mode": "files",
"display_version": true,
"display_virtual_env": false,
"prefix": "  "
},
"style": "powerline",
"type": "python"
},
{
"background": "#AE1401",
"foreground": "#ffffff",
"powerline_symbol": "",
"properties": {
"display_mode": "files",
"display_version": true,
"prefix": "  "
},
"style": "powerline",
"type": "ruby"
},
{
"background": "#FEAC19",
"foreground": "#ffffff",
"powerline_symbol": "",
"properties": {
"display_mode": "files",
"display_version": false,
"prefix": " "
},
"style": "powerline",
"type": "azfunc"
},
{
"background_templates": [
"{{if contains \"default\" .Profile}}#FFA400{{end}}",
"{{if contains \"jan\" .Profile}}#f1184c{{end}}"
],
"foreground": "#ffffff",
"powerline_symbol": "",
"properties": {
"display_default": false,
"prefix": "  "
},
"style": "powerline",
"type": "aws"
},
{
"background": "#ffff66",
"foreground": "#111111",
"powerline_symbol": "",
"properties": {
"root_icon": ""
},
"style": "powerline",
"type": "root"
},
{
"background": "#83769c",
"foreground": "#ffffff",
"leading_diamond": "",
"properties": {
"always_enabled": true,
"prefix": "<transparent></> 羽"
},
"style": "plain",
"trailing_diamond": "",
"type": "executiontime"
},
{
"background": "#2e9599",
"foreground": "#ffffff",
"leading_diamond": "",
"properties": {
"always_enabled": true,
"color_background": true,
"display_exit_code": false,
"error_color": "#f1184c",
"prefix": "<#83769c></> "
},
"style": "diamond",
"trailing_diamond": "",
"type": "exit"
}
],
"type": "prompt"
},
{
"segments": [
{
"background": "#0077c2",
"foreground": "#ffffff",
"properties": {
"postfix": " <transparent,#0077c2></>",
"prefix": "<#0077c2,transparent></>  "
},
"style": "plain",
"type": "shell"
},
{
"background": "#1BD760",
"foreground": "#111111",
"invert_powerline": true,
"powerline_symbol": "",
"properties": {
"paused_icon": " ",
"playing_icon": " ",
"prefix": "  "
},
"style": "powerline",
"type": "ytm"
},
{
"background": "#f36943",
"foreground": "#ffffff",
"invert_powerline": true,
"powerline_symbol": "",
"properties": {
"battery_icon": "",
"charged_color": "#4caf50",
"charged_icon": " ",
"charging_color": "#40c4ff",
"charging_icon": " ",
"color_background": true,
"discharging_color": "#ff5722",
"discharging_icon": " ",
"postfix": " "
},
"style": "powerline",
"type": "battery"
},
{
"background": "#2e9599",
"foreground": "#111111",
"invert_powerline": true,
"leading_diamond": "",
"style": "diamond",
"trailing_diamond": "",
"type": "time"
}
],
"type": "rprompt"
}
],
"console_title": true,
"console_title_style": "template",
"console_title_template": "{{ .Shell }} in {{ .Folder }}",
"final_space": true
}

View file

@ -1,80 +0,0 @@
set nocompatible " be iMproved, required
filetype off " required by Vundle. filetype is reenabled after Vundle starts
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required for Vundle to work right
Plugin 'VundleVim/Vundle.vim'
Plugin 'ekalinin/Dockerfile.vim' " provides syntax highlighting for Dockerfiles
Plugin 'elzr/vim-json' " provides syntax highlighting for JSON files
Plugin 'garbas/vim-snipmate' " provides code snippets
Plugin 'godlygeek/tabular' " provides a method for lining things up
Plugin 'honza/vim-snippets' " provides snippets for use with vim-snipmate
Plugin 'LnL7/vim-nix' " support for writing Nix expressions in vim
Plugin 'MarcWeber/vim-addon-mw-utils' " a utility used by vim-snipmate
Plugin 'mrk21/yaml-vim' " provides indentation and syntax highlighting for yaml
Plugin 'rbong/vim-flog' " git branch viewer built on fugitive
Plugin 'rodjek/vim-puppet' " provides several niceties for working with Puppet
Plugin 'tomtom/tlib_vim' " a utility used by vim-snipmate
Plugin 'tpope/vim-fugitive' " all things Git here in Vim
Plugin 'vim-airline/vim-airline' " status line alternative to powerline
Plugin 'vim-airline/vim-airline-themes' " themes for vim-airline
Plugin 'vim-ruby/vim-ruby' " provides syntax highlighting for ruby files
Plugin 'vim-syntastic/syntastic' " provides syntax checking
" All of your Plugins must be added before the following line
call vundle#end()
filetype plugin indent on " required for plugins to be able to adjust indent
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
syntax on " enable syntax highlighting
set encoding=utf-8
set termencoding=utf-8
set t_Co=256 " tell vim we have 256 colors to work with
set autoindent " automatically indent new lines
set background=dark " tell vim your terminal has a dark background
set backspace=2 " make backspace work like most other programs
set expandtab " converts tabs to spaces
set fillchars+=stl:\ ,stlnc:\ " fix added per powerline troubleshooting docs
set laststatus=2 " Always display the status line in all windows
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the status line)
set smarttab " helps with expanding tabs to spaces (I think)
set statusline+=%{FugitiveStatusline()} " get git info via fugitive plugin
set statusline+=%#warningmsg# " recommended setting from syntastic plugin
set statusline+=%{SyntasticStatuslineFlag()} " recommended setting from syntastic plugin
set statusline+=%* " recommended setting from syntastic plugin
" This has to come after colorscheme, if defined, to not be masked
highlight ColorColumn ctermbg=232 " set the color to be used for guidelines
let &colorcolumn=join(range(81,999),",") " change the background color of everything beyond 80 characters
let g:snipMate = { 'snippet_version' : 1 }
" settings for the syntastic plugin
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs = 1
let g:syntastic_ruby_checkers = ['rubocop']
let g:syntastic_quiet_messages = {'level': 'warnings'}
" don't wrap text in markdown files
let g:vim_markdown_folding_disabled = 1
" settings for vim-airline
let g:airline_theme='badwolf'
let g:airline_powerline_fonts = 1

View file

@ -1,267 +0,0 @@
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="robbyrussell"
# use oh-my-posh for theme
# Get Homebrew into the path early so that plugins and such can use
# programs installed by it
if [[ $(uname) == 'Darwin' ]]; then
if [ "$(uname -p)" = 'i386' ] && [ ! -f '/opt/homebrew/bin/brew' ]; then
eval "$(/usr/local/bin/brew shellenv)"
else
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
elif [[ $(uname) == 'Linux' ]]; then
if [[ -e /home/linuxbrew/.linuxbrew/bin/brew ]]; then
# Don't use the eval so that it doesn't override system python
# eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew"
export PATH="${PATH}:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin"
export MANPATH="/home/linuxbrew/.linuxbrew/share/man${MANPATH+:$MANPATH}:"
export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH:-}"
fi
fi
# Get Homebrew shell completion bits
# https://docs.brew.sh/Shell-Completion
if type brew &>/dev/null; then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="false"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
ZSH_CUSTOM=~/repos/customized-oh-my-zsh
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(bundler gem git github history kubectl macos pip terraform vagrant vscode zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
# User configuration
[ -f ~/.private-env ] && source ~/.private-env || echo '~/.private-env is missing'
# Start GPG agent
# Some tips from https://hedberg.io/yubikey-for-ssh/ helped simplify this:
if [[ $(uname) == 'Darwin' ]]; then
# Add GPG Suite binaries to the path:
export PATH=/usr/local/MacGPG2/bin:$PATH
fi
export GPG_TTY=$(tty)
# export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
# gpgconf --launch gpg-agent
# export MANPATH="/usr/local/man:$MANPATH"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#alias ll='ls -G -l'
#alias ls='ls -G'
alias beo='bundle exec onceover run spec --trace --force'
alias biv='bundle install --path=vendor/bundle'
alias ce='code-exploration'
alias gbc='git branch --merged | command grep -vE "^(\*|\s*(main|master|develop|production)\s*$)" | command xargs -n 1 git branch -d'
alias gitextract='git log --pretty=email --patch-with-stat --reverse --full-index --binary --'
alias gpge='gpg2 --encrypt --sign --armor -r '
alias hubpr='hub pull-request --push --browse'
alias pssh='ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -o PubkeyAcceptedKeyTypes=+ssh-rsa -o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -i ~/.ssh/id_rsa-acceptance'
alias sal='ssh-add -L'
alias st='open -a SourceTree'
alias sz='source ~/.zshrc'
alias usegpg='killall ssh-agent; export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) && gpgconf --launch gpg-agent'
alias usessh='gpgconf --kill gpg-agent'
# aliases whose command changes based on OS
if [[ `uname` == 'Linux' ]]; then
alias uwgconnect='nmcli dev wifi connect SecureWest password'
alias uwgforget='nmcli connection delete SecureWest'
alias ykey='sudo systemctl restart pcscd && sudo pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L'
else
alias currentwifi='networksetup -getairportnetwork en0 |cut -d ":" -f2- | cut -d " " -f2-'
alias uwgconnect='networksetup -setairportnetwork en0 SecureWest'
alias uwgforget='networksetup -removepreferredwirelessnetwork en0 SecureWest'
alias ykey='pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L'
fi
## Linux-only aliases
if [[ `uname` == 'Linux' ]]; then
alias enable-ruby-27='source ~/enable-ruby-27'
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
function popup() {
echo 'checking for updates via apt...'
sudo apt update
sudo apt upgrade -y
echo
echo 'checking for updates via flatpak...'
flatpak update
echo
echo 'checking for updates via snap...'
sudo snap refresh
echo
echo 'checking for updates via brew...'
brew update
brew upgrade
echo
echo 'checking for updates to Zoom'
wget -O /tmp/zoom_amd64.deb https://zoom.us/client/latest/zoom_amd64.deb && sudo apt-get install -y /tmp/zoom_amd64.deb; rm -f /tmp/zoom_amd64.deb
echo
echo 'checking for firmware updates...'
sudo fwupdmgr refresh --force && sudo fwupdmgr get-updates && sudo fwupdmgr update
echo
echo 'all done :)'
}
fi
if [[ `uname` != 'Linux' ]]; then
function otpon() {
osascript -e 'tell application "yubiswitch" to KeyOn'
}
function otpoff() {
osascript -e 'tell application "yubiswitch" to KeyOff'
}
fi
export GOPATH=$HOME/go
if [[ `uname` == 'Darwin' ]]; then
# Bits common to all macOS instances
alias flushdns='sudo killall -HUP mDNSResponder'
alias localdns='sudo networksetup -setdnsservers Wi-Fi empty && sudo networksetup -setdnsservers Wi-Fi 127.0.0.1 ::1 && flushdns'
alias ogk='open -a GitKraken'
alias stockdns='sudo networksetup -setdnsservers Wi-Fi empty && flushdns'
if [ -d "$HOME/.krew" ]; then export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"; fi
export PATH=$PATH:/usr/local/sbin
# Araxis needs to come first so that its tools don't get stomped
# by ones Homebrew installs to /usr/local/bin. In particular, compare
# from ImageMagick breaks using git difftool.
if [ -d "/Applications/Araxis Merge.app" ]; then export PATH='/Applications/Araxis Merge.app/Contents/Utilities':$PATH; fi
eval '/usr/libexec/path_helper -s' > /dev/null
# Add OVFTool to PATH if it is installed
if [ -d "/Applications/VMware OVF Tool" ]; then export PATH=$PATH:'/Applications/VMware OVF Tool'; fi
# add gems to path
GEMBIN="$(gem environment gemdir)/bin"
export PATH=$PATH:$GEMBIN
# added to make pipx work
[ -d /Users/gene/.local/bin ] && export PATH=$PATH:/Users/gene/.local/bin
export OPENFAAS_PREFIX="genebean"
[ -e "${HOME}/.iterm2_shell_integration.zsh" ] && source "${HOME}/.iterm2_shell_integration.zsh"
if [ "$(uname -p)" = 'i386' ] && [ ! -f '/opt/homebrew/bin/brew' ]; then
# optional additions from homebrew
[ -d "/usr/local/opt/node@12/bin" ] && export PATH="/usr/local/opt/node@12/bin:$PATH"
[ -d /usr/local/opt/qt/bin ] && export PATH=$PATH:/usr/local/opt/qt/bin
# use homebrew's ruby
[ -d /usr/local/opt/ruby/bin ] && export PATH=/usr/local/opt/ruby/bin:$PATH
# hide ruby 2.7's extra output
export RUBYOPT='-W:no-deprecated -W:no-experimental'
export VAGRANT_DEFAULT_PROVIDER='virtualbox'
glcoud_zsh_path='/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc'
[ -f $glcoud_zsh_path ] && source $glcoud_zsh_path
gcloud_zsh_completions='/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc'
[ -f $gcloud_zsh_completions ] && source $gcloud_zsh_completions
else
glcoud_zsh_path='/usr/local/google-cloud-sdk/path.zsh.inc'
if [ -f $glcoud_zsh_path ]; then source $glcoud_zsh_path; fi
gcloud_zsh_completions='/usr/local/google-cloud-sdk/completion.zsh.inc'
if [ -f $gcloud_zsh_completions ]; then source $gcloud_zsh_completions; fi
# use homebrew's ruby
[ -d "/opt/homebrew/opt/ruby@2.7/bin" ] && export PATH='/opt/homebrew/opt/ruby@2.7/bin':$PATH
# hide ruby 2.7's extra output
export RUBYOPT='-W:no-deprecated -W:no-experimental'
fi
elif [[ `uname` == 'Linux' ]]; then
PATH="$HOME/.local/bin:$PATH"
# add Pulumi to the PATH
if [ -d "$HOME/.pulumi/bin" ] ; then
PATH=$PATH:$HOME/.pulumi/bin
fi
if [ -d "$HOME/.local/share/gem/ruby/3.0.0/bin" ] ; then
PATH="$HOME/.local/share/gem/ruby/3.0.0/bin:$PATH"
fi
# export CLOUDSDK_PYTHON="/usr/bin/python2"
gcloud_zsh_completions='/snap/google-cloud-cli/current/completion.zsh.inc'
if [ -f $gcloud_zsh_completions ]; then source $gcloud_zsh_completions; fi
fi
if type floaty &>/dev/null; then
source $(floaty completion --shell zsh)
fi
eval "$(oh-my-posh init zsh --config ~/repos/my-oh-my-posh-themes/beanbag.omp.json)"

View file

@ -1,10 +0,0 @@
# frozen_string_literal: true
forge 'http://forge.puppetlabs.com'
# The next line translates to '../../vendor/puppet_modules' aka ~/.dotfiles/vendor/puppet_modules
moduledir "#{File.dirname(File.dirname(File.dirname(__FILE__)))}/vendor/puppet_modules"
mod 'puppetlabs-apt', '7.3.0'
mod 'puppetlabs-stdlib', '4.25.1'
mod 'puppetlabs-vcsrepo', '3.1.0'
mod 'thekevjames-homebrew', '1.8.3'

View file

@ -1,2 +0,0 @@
modulepath = modules:site:~/.dotfiles/vendor/puppet_modules:$basemodulepath
config_version = 'scripts/config_version.sh $environmentpath'

View file

@ -1,11 +0,0 @@
---
version: 5
defaults: # Used for any hierarchy level that omits these keys.
datadir : hieradata # This path is relative to hiera.yaml's directory.
data_hash : yaml_data # Use the built-in YAML backend.
hierarchy:
- name: "Per-node data"
path: "nodes/%{hostname}.yaml"
- name: "Common data"
path: "common.yaml"

View file

@ -1,2 +0,0 @@
---
foo: bar

View file

@ -1,2 +0,0 @@
---
homedir: '/Users/gene'

View file

@ -1,2 +0,0 @@
---
homedir: '/home/gene'

View file

@ -1,2 +0,0 @@
---
homedir: '/Users/gene.liverman'

View file

@ -1,2 +0,0 @@
---
homedir: '/home/gene'

View file

@ -1,29 +0,0 @@
## site.pp ##
# DEFAULT NODE
# The default node definition matches any node lacking a more specific node
# definition. If there are no other nodes in this file, classes declared here
# will be included in every node's catalog, *in addition* to any classes
# specified in the via an ENC for that node.
node default {
notify{'This is from the default node.':}
}
node 'bowl' {
include role::workstation
}
node 'gene' {
include role::workstation
}
node 'mintstring' {
include role::workstation
}
node 'yellowbadger' {
include role::workstation
}

View file

@ -1,25 +0,0 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
begin
require 'rugged'
rescue LoadError
t = Time.new
puts t.to_i
else
environmentpath = ARGV[0]
environment = ARGV[1]
repo = Rugged::Repository.discover(File.join(environmentpath, environment))
head = repo.head
# sha1 hash of the newest commit
head_sha = head.target_id
# the commit message associated the newest commit
# commit = repo.lookup(head_sha)
# add something to find the remote url
puts head_sha
end

View file

@ -1,5 +0,0 @@
#!/bin/bash
/usr/bin/git --version > /dev/null 2>&1 &&
/usr/bin/git --git-dir $1/../.git rev-parse HEAD ||
date +%s

View file

@ -1,23 +0,0 @@
# frozen_string_literal: true
Facter.add(:os_release) do
confine kernel: 'Linux'
setcode do
file_path = '/etc/os-release'
if File.exist?(file_path)
os_release_hash = {}
File.open(file_path, 'r') do |file|
file.each_line do |line|
next if line.nil? || line.strip.length.eql?(0)
line_data = line.split('=')
key = line_data[0].downcase
value = line_data[1].strip.gsub(/(^")|("$)/, '')
os_release_hash[key] = value
end
end
os_release_hash
end
end
end

View file

@ -1,12 +0,0 @@
# frozen_string_literal: true
Puppet::Functions.create_function(:find_group) do
dispatch :find_group do
param 'String', :some_path
return_type 'String'
end
def find_group(some_path)
File.stat(some_path).gid.to_s
end
end

View file

@ -1,12 +0,0 @@
# frozen_string_literal: true
Puppet::Functions.create_function(:find_owner) do
dispatch :find_owner do
param 'String', :some_path
return_type 'String'
end
def find_owner(some_path)
File.stat(some_path).uid.to_s
end
end

View file

@ -1,12 +0,0 @@
# frozen_string_literal: true
Puppet::Functions.create_function(:homedir_to_user) do
dispatch :homedir_to_user do
param 'String', :some_path
return_type 'String'
end
def homedir_to_user(some_path)
some_path.split('/')[-1]
end
end

View file

@ -1,5 +0,0 @@
# the base profile should include component modules that will be on all nodes
class profile::base {
}

View file

@ -1,21 +0,0 @@
# Select a profile based on the OS family
class profile::linux {
case $facts['os']['family'] {
'Debian': { include profile::linux::debian }
'RedHat': { include profile::linux::el }
default: { fail("${facts['os']['family']} isn't supported yet") }
}
exec { 'download hub':
path => '/bin:/usr/bin',
command => "curl -s https://api.github.com/repos/github/hub/releases/latest | grep \"browser_download_url.*linux-amd64\" | cut -d '\"' -f4 | xargs -n 1 curl -L | tar -xzvf - -C /tmp && mv /tmp/hub* /usr/local/hub",
creates => '/usr/local/hub',
}
file {'/usr/local/bin/hub':
ensure => 'link',
target => '/usr/local/hub/bin/hub',
}
}

View file

@ -1,135 +0,0 @@
# Profile for the Debian family of OS's
class profile::linux::debian {
$homedir = lookup('homedir')
$uid = find_owner($homedir)
$gid = find_group($homedir)
File {
owner => $uid,
group => $gid,
}
Vcsrepo {
user => $uid,
owner => $uid,
group => $gid,
}
if $facts['os_release']['ubuntu_codename'] {
$release = $facts['os_release']['ubuntu_codename']
}
elsif $facts['os']['lsb']['distcodename'] {
$release = $facts['os']['lsb']['distcodename']
}
else {
fail("Can't determine what to use in 'release' for the Docker repo")
}
apt::source { 'docker':
location => 'https://download.docker.com/linux/ubuntu',
release => $release,
repos => 'stable',
key => {
'id' => '9DC858229FC7DD38854AE2D88D81803C0EBFCD88',
'source' => 'https://download.docker.com/linux/ubuntu/gpg',
},
}
$apt_packages = [
'apt-transport-https',
'bash-completion',
'ca-certificates',
'cmake',
'coreutils',
'curl',
'figlet',
'git',
'git-flow',
'pinentry-gnome3',
'powerline',
'python',
'python-pip',
'python-psutil',
'scdaemon',
'software-properties-common',
'tmux',
'tree',
'yubikey-personalization-gui',
'zsh',
]
package { $apt_packages:
ensure => 'installed',
require => Apt::Source['docker'],
}
exec { 'set-shell-to-zsh':
path => '/bin:/usr/bin',
command => "chsh -s /usr/bin/zsh `grep '${uid}:${gid}' /etc/passwd |cut -d ':' -f1`",
cwd => $homedir,
logoutput => true,
environment => "HOME=${homedir}",
unless => "grep '${uid}:${gid}' /etc/passwd | grep '/usr/bin/zsh'",
}
$dirs = [
"${homedir}/.local",
"${homedir}/.local/share",
"${homedir}/.local/share/fonts",
"${homedir}/.vim",
"${homedir}/.vim/bundle",
"${homedir}/repos",
]
file { $dirs:
ensure => 'directory',
}
vcsrepo { "${homedir}/.oh-my-zsh":
ensure => 'present',
provider => 'git',
source => 'https://github.com/robbyrussell/oh-my-zsh.git',
}
vcsrepo { "${homedir}/.oh-my-zsh/custom/themes":
ensure => 'latest',
provider => 'git',
source => 'git@github.com:genebean/my-oh-zsh-themes.git',
}
vcsrepo { "${homedir}/.vim/bundle/Vundle.vim":
ensure => 'latest',
provider => 'git',
source => 'https://github.com/VundleVim/Vundle.vim.git',
require => File[$dirs],
}
vcsrepo { "${homedir}/repos/powerline-fonts":
ensure => 'latest',
provider => 'git',
source => 'https://github.com/powerline/fonts.git',
require => File[$dirs],
notify => Exec['update-fonts'],
}
exec { 'update-fonts':
command => "${homedir}/repos/powerline-fonts/install.sh",
cwd => "${homedir}/repos/powerline-fonts",
logoutput => true,
environment => "HOME=${homedir}",
refreshonly => true,
notify => Exec['set-font-ownership'],
}
exec { 'set-font-ownership':
path => '/bin:/usr/bin',
command => "chown -R ${uid}:${gid} ${homedir}/.local/share/fonts/*",
cwd => $homedir,
logoutput => true,
environment => "HOME=${homedir}",
require => Exec['update-fonts'],
refreshonly => true,
}
}

View file

@ -1,126 +0,0 @@
# Profile for the Red Hat family of OS's
class profile::linux::el {
$homedir = lookup('homedir')
$uid = find_owner($homedir)
$gid = find_group($homedir)
$user = homedir_to_user($homedir)
include profile::linux::el::docker_repos
Yumrepo <| |> -> Package <| |> # lint:ignore:spaceship_operator_without_tag
$yum_packages = [
'cmake',
'device-mapper-persistent-data',
'docker-ce',
'figlet',
'git',
'gitflow',
'lvm2',
'python2-pip',
'python2-psutil',
'tmux',
'tree',
'yum-utils',
'zsh',
]
$python_pacakges = [
'powerline-status',
]
package {
default:
ensure => 'installed',
;
'epel-release':
notify => Exec['yum clean all'],
;
$yum_packages:
require => Package['epel-release'],
;
$python_pacakges:
ensure => 'latest',
provider => 'pip',
require => Package['python2-pip'],
;
}
$dirs = [
"${homedir}/.local",
"${homedir}/.local/share",
"${homedir}/.local/share/fonts",
"${homedir}/.vim",
"${homedir}/.vim/bundle",
"${homedir}/repos",
]
file { $dirs:
ensure => 'directory',
owner => $uid,
group => $gid,
}
# Unlike on Mint, powerline is pulled from pip.
# This makes it so that the line in .tmux.conf works on both.
file { '/usr/share/powerline':
ensure => 'link',
target => '/usr/lib/python2.7/site-packages/powerline',
require => Package[$python_pacakges],
}
vcsrepo {
default:
ensure => 'latest',
user => $user,
owner => $uid,
group => $gid,
provider => 'git',
;
"${homedir}/.oh-my-zsh":
ensure => 'present',
source => 'https://github.com/robbyrussell/oh-my-zsh.git',
;
"${homedir}/.oh-my-zsh/custom/themes":
source => 'git@github.com:genebean/my-oh-zsh-themes.git',
;
"${homedir}/.vim/bundle/Vundle.vim":
source => 'https://github.com/VundleVim/Vundle.vim.git',
require => File[$dirs],
;
"${homedir}/repos/powerline-fonts":
source => 'https://github.com/powerline/fonts.git',
require => File[$dirs],
notify => Exec['update-fonts'],
;
}
exec {
default:
logoutput => true,
environment => "HOME=${homedir}",
refreshonly => true,
;
'yum clean all':
command => '/bin/yum clean all',
;
'set-shell-to-zsh':
path => '/bin:/usr/bin',
command => "chsh -s /usr/bin/zsh `grep '${uid}:${gid}' /etc/passwd |cut -d ':' -f1`",
cwd => $homedir,
unless => "grep '${uid}:${gid}' /etc/passwd | grep '/usr/bin/zsh'",
require => Package['zsh'],
;
'update-fonts':
command => "${homedir}/repos/powerline-fonts/install.sh",
cwd => "${homedir}/repos/powerline-fonts",
notify => Exec['set-font-ownership'],
;
'set-font-ownership':
path => '/bin:/usr/bin',
command => "chown -R ${uid}:${gid} ${homedir}/.local/share/fonts/*",
cwd => $homedir,
require => Exec['update-fonts'],
;
}
}

View file

@ -1,101 +0,0 @@
# These repos are the ones setup by
# https://download.docker.com/linux/centos/docker-ce.repo
class profile::linux::el::docker_repos {
yumrepo { 'docker-ce-edge':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/$basearch/edge',
descr => 'Docker CE Edge - $basearch',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-edge-debuginfo':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/debug-$basearch/edge',
descr => 'Docker CE Edge - Debuginfo $basearch',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-edge-source':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/source/edge',
descr => 'Docker CE Edge - Sources',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-nightly':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/$basearch/nightly',
descr => 'Docker CE Nightly - $basearch',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-nightly-debuginfo':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/debug-$basearch/nightly',
descr => 'Docker CE Nightly - Debuginfo $basearch',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-nightly-source':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/source/nightly',
descr => 'Docker CE Nightly - Sources',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-stable':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/$basearch/stable',
descr => 'Docker CE Stable - $basearch',
enabled => '1',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-stable-debuginfo':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/debug-$basearch/stable',
descr => 'Docker CE Stable - Debuginfo $basearch',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-stable-source':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/source/stable',
descr => 'Docker CE Stable - Sources',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-test':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/$basearch/test',
descr => 'Docker CE Test - $basearch',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-test-debuginfo':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/debug-$basearch/test',
descr => 'Docker CE Test - Debuginfo $basearch',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
yumrepo { 'docker-ce-test-source':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/source/test',
descr => 'Docker CE Test - Sources',
enabled => '0',
gpgcheck => '1',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
}

View file

@ -1,128 +0,0 @@
# this contains the mac specific stuff
class profile::mac {
# $path = '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin'
# notify{'This is from the mac profile.':}
# exec { 'install homebrew':
# command => '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"',
# path => $path,
# creates => '/usr/local/bin/brew',
# }
$homedir = lookup('homedir')
#Package { provider => 'homebrew' }
$homebrew_packages = [
'bash-completion',
'bundler-completion',
'cmake',
'coreutils',
'csshx',
'docker-completion',
'elixir',
'erlang',
'figlet',
'git',
'git-flow',
'gnu-tar',
'hub',
'iftop',
'jq',
'kompose',
'mutt',
'ncftp',
'openssh',
'packer',
'python',
'ruby',
'sl',
'socat',
'terraform',
'tmux',
'tree',
'unrar',
'vagrant-completion',
'vim',
'watch',
'wget',
'zsh',
'zsh-completions',
]
package { $homebrew_packages:
ensure => 'installed',
provider => 'brew',
}
# $homebrew_casks = [
# '1password',
# 'adium',
# 'android-file-transfer',
# 'android-platform-tools',
# 'araxis-merge',
# 'atom',
# 'caffeine',
# 'docker',
# 'firefox',
# 'fliqlo',
# 'google-chrome',
# 'hipchat',
# 'iterm2',
# 'slack',
# 'sourcetree',
# 'visual-studio-code',
# ]
#
# package { $homebrew_casks:
# ensure => 'installed',
# provider => 'brewcask',
# }
$pip_packages = [
'psutil',
'powerline-status',
]
package { $pip_packages:
ensure => 'latest',
provider => 'pip',
require => Package['python'],
}
file { "${homedir}/repos":
ensure => 'directory',
}
vcsrepo { "${homedir}/.vim/bundle/Vundle.vim":
ensure => 'latest',
provider => 'git',
source => 'https://github.com/VundleVim/Vundle.vim.git',
}
vcsrepo { "${homedir}/repos/powerline-fonts":
ensure => 'latest',
provider => 'git',
source => 'https://github.com/powerline/fonts.git',
require => File["${homedir}/repos"],
notify => Exec['update-fonts'],
}
exec { 'update-fonts':
command => "${homedir}/repos/powerline-fonts/install.sh",
cwd => "${homedir}/repos/powerline-fonts",
logoutput => true,
environment => "HOME=${homedir}",
refreshonly => true,
}
vcsrepo { "${homedir}/.oh-my-zsh":
ensure => 'present',
provider => 'git',
source => 'https://github.com/robbyrussell/oh-my-zsh.git',
}
vcsrepo { "${homedir}/.oh-my-zsh/custom/themes":
ensure => 'latest',
provider => 'git',
source => 'git@github.com:genebean/my-oh-zsh-themes.git',
}
}

View file

@ -1,7 +0,0 @@
# Includes all the profiles needed for a server.
# One big difference between this and the workstation role is that you generally
# are not standing in front of the system and / or there is no graphical
# interface.
class role::server {
include profile::base
}

View file

@ -1,16 +0,0 @@
# Includes all the profiles needed for a workstation
class role::workstation {
include profile::base
case $facts['kernel'] {
'Darwin': {
include profile::mac
}
'Linux': {
include profile::linux
}
default: {
fail("${facts['kernel']} hasn't been setup in the workstation role yet.")
}
} # end of kernel case statement
}

View file

@ -1,2 +0,0 @@
---
cachedir: 'vendor/r10k'