Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include playbooks with vars and templates #8

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 7 additions & 43 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,18 @@
# Changelog
## 2023-12-10

## 2023-06-??
### Version: 1.1.0

### Version: 2.0
#### Playbooks

#### DEPRECATED
What added:

- `templates:` and it vars moved from top, level into
`role_component.<component_name>.[config|run_config].template`,
and now look like this:

```yaml

role_component:
git:
configs:
templates:
gitconfig:
template: "gitconfig"
dest: "~/.gitconfig"
variables:
foo: bar
```

- `zip-configs` deleted

#### Changed

- component vars moved from playbook vars, into role defaults.
Now, you can find them in [./defaults/main](./defaults/main)
- refactored ansible messaged. Now they look like:
`[component][<name>][<task>]`
- reduced number of debug messages

#### Added

- install via Brew package manager:
`role_component.<component_name>.install.brew=[]`
- for macOS all
`role_component.<component_name>.install.packages=[]`
will be installed viw Brew
- conditional `become`
`role_component.<component_name>.install.become=[True|False]`
- molecule tests
- playbooks with example variables for components. You can find those under `playbooks/vars` and `playbooks/templates`

---

## 2022-03-05
## 2023-12-10

### Version: 1.0
### Version: 1.0.0

#### Basics

Expand Down
52 changes: 52 additions & 0 deletions playbooks/components.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
- hosts: all
gather_facts: true
collections:
- dnullproject.collections
tasks:
- block:
- include_vars:
dir: vars
extensions:
- 'yml'
- 'yaml'
- ansible.builtin.include_role:
name: components
vars:
role_component:
components:
- alacritty
- asdf
- brew
- clipmenu
- direnv
- dmenu
- fonts
- git
- htop
- k9s
- lastpass_cli
- lvim
- minikube
- nvim
- ssh
- stew
- tmux
- versions
- zsh
tags: [files, install, configs, run_configs, run, plugins]
# Additionally post results into ntfy
# - uri:
# url: "https://ntfy.sh/change_me"
# method: POST
# body: "{{ inventory_hostname }} components: finished"
# tags: [files, install, configs, run_configs, run, plugins]
# rescue:
# - uri:
# url: "https://ntfy.sh/change_me"
# method: POST
# body: "{{ inventory_hostname }} components: failed"
# tags: [files, install, configs, run_configs, run, plugins]
# - fail:
# msg: "exit non-zero"
# tags: [files, install, configs, run_configs, run, plugins]
83 changes: 83 additions & 0 deletions playbooks/templates/alacritty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
env:
TERM: {{ var.term }}
window:
padding:
x: 0
y: 0
dynamic_padding: false
decorations: none
title: Alacritty
class:
instance: Alacritty
general: Alacritty
scrolling:
history: 5000
font:
normal:
family: {{ var.font }}
style: Regular
bold:
family: {{ var.font }}
style: Bold
italic:
family: {{ var.font }}
style: Italic
bold_italic:
family: {{ var.font }}
style: Bold Italic
size: {{ var.font_size }}
offset:
x: 0
y: 0
draw_bold_text_with_bright_colors: true
# Colors (https://terminal.sexy/#JjI47O_xJjI4_5gAi8NK_8EHA6n06R5jAJaIz9jcN0dP_6dNnMxl_6AAgdT6rRRXJqaa7O_x)
# colors:
# # Default colors
# primary:
# background: '0x263238'
# foreground: '0xeceff1'
#
# # Normal colors
# normal:
# black: '0x263238'
# red: '0xff9800'
# green: '0x8bc34a'
# yellow: '0xffc107'
# blue: '0x03a9f4'
# magenta: '0xe91e63'
# cyan: '0x009688'
# white: '0xcfd8dc'
#
# # Bright colors
# bright:
# black: '0x37474f'
# red: '0xffa74d'
# green: '0x9ccc65'
# yellow: '0xffa000'
# blue: '0x81d4fa'
# magenta: '0xad1457'
# cyan: '0x26a69a'
# white: '0xeceff1'
live_config_reload: true
key_bindings:
# (Windows, Linux, and BSD only)
- {key: V, mods: Control|Shift, action: Paste}
- {key: C, mods: Control|Shift, action: Copy}
- {key: Insert, mods: Shift, action: PasteSelection}
- {key: Key0, mods: Control, action: ResetFontSize}
- {key: Equals, mods: Control, action: IncreaseFontSize}
- {key: Plus, mods: Control, action: IncreaseFontSize}
- {key: Minus, mods: Control, action: DecreaseFontSize}
- {key: Minus, mods: Control, action: DecreaseFontSize}
- {key: F11, mods: None, action: ToggleFullscreen}
- {key: Paste, mods: None, action: Paste}
- {key: Copy, mods: None, action: Copy}
- {key: L, mods: Control, action: ClearLogNotice}
- {key: L, mods: Control, chars: "\f"}
- {key: PageUp, mods: None, action: ScrollPageUp, mode: ~Alt}
- {key: PageDown, mods: None, action: ScrollPageDown, mode: ~Alt}
- {key: Home, mods: Shift, action: ScrollToTop, mode: ~Alt}
- {key: End, mods: Shift, action: ScrollToBottom, mode: ~Alt}
import:
- ~/.config/alacritty/themes/dracula/dracula.yml
7 changes: 7 additions & 0 deletions playbooks/templates/gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[user]
email = {{ var.email }}
name = {{ var.name }}
[alias]
{% for alias in var.aliases %}
{{ alias }}
{% endfor %}
26 changes: 26 additions & 0 deletions playbooks/templates/htop
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=46 47 1
sort_key=46
sort_direction=1
hide_threads=0
hide_kernel_threads=0
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
show_program_path=1
highlight_base_name=0
highlight_megabytes=0
highlight_threads=1
tree_view=0
header_margin=0
detailed_cpu_time=0
cpu_count_from_zero=0
update_process_names=0
account_guest_in_cpu_meter=0
# color_scheme=5
delay=15
left_meters=LeftCPUs Memory Swap
left_meter_modes=1 1 1
right_meters=RightCPUs Tasks LoadAverage Uptime
right_meter_modes=1 2 2 2
22 changes: 22 additions & 0 deletions playbooks/templates/k9s/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
k9s:
refreshRate: 2
maxConnRetry: 5
enableMouse: true
headless: false
logoless: false
crumbsless: false
readOnly: false
noExitOnCtrlC: false
noIcons: false
logger:
tail: 200
buffer: 500
sinceSeconds: 300
fullScreenLogs: false
textWrap: false
showTime: false
currentContext:
currentCluster:
clusters: {}
screenDumpDir: /tmp
30 changes: 30 additions & 0 deletions playbooks/templates/k9s/hotkey.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
hotKey:
shift-1:
shortCut: Shift-1
description: View pods
command: pods
shift-2:
shortCut: Shift-2
description: View Deployments
command: deployments
shift-3:
shortCut: Shift-3
description: View Statefulset
command: statefulset
shift-4:
shortCut: Shift-4
description: View Service
command: service
shift-5:
shortCut: Shift-5
description: View Ingress
command: ingress
shift-9:
shortCut: Shift-9
description: View Events
command: events
shift-0:
shortCut: Shift-0
description: Viewing namespaces
command: namespace
17 changes: 17 additions & 0 deletions playbooks/templates/k9s/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
plugin:
stern:
shortCut: Ctrl-L
confirm: false
description: Logs <Stern>
scopes: [pods]
command: stern
background: false
args:
- --tail
- 50
- $FILTER
- -n
- $NAMESPACE
- --context
- $CONTEXT
Loading
Loading