-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add role for kube-ps1 kubernetes prompt - Update project documentation
- Loading branch information
1 parent
c13b874
commit 1d0c82d
Showing
8 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
provisioners/ansible/roles/kubernetes/kubeps1/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
kubeps1_version: '0.7.0' | ||
kubeps1_install_dir: '/usr/local/bin' | ||
|
||
# main settings | ||
kubeps1_binary: 'kubectl' | ||
kubeps1_ns_enabled: true | ||
kubeps1_prefix: '(' | ||
kubeps1_symbol_enabled: true | ||
kubeps1_symbol_padding: false | ||
kubeps1_symbol_use_img: false | ||
kubeps1_separator: '|' | ||
kubeps1_divider: ':' | ||
kubeps1_suffix: ')' | ||
|
||
# color settings | ||
kubeps1_prefix_color: 'null' | ||
kubeps1_symbol_color: 'blue' | ||
kubeps1_ctx_color: 'red' | ||
kubeps1_suffix_color: 'null' | ||
kubeps1_ns_color: 'cyan' | ||
kubeps1_bg_color: 'null' | ||
... |
34 changes: 34 additions & 0 deletions
34
provisioners/ansible/roles/kubernetes/kubeps1/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: 'Ensure checkout directory' | ||
file: | ||
path: '{{ k9s_checkout_dir }}' | ||
state: 'directory' | ||
mode: 0775 | ||
|
||
- name: 'Checkout repository' | ||
git: | ||
repo: '{{ kubeps1_repository }}' | ||
dest: '{{ kubeps1_checkout_dir }}' | ||
version: 'v{{ kubeps1_version }}' | ||
accept_hostkey: 'yes' | ||
update: 'no' | ||
force: 'yes' | ||
clone: 'yes' | ||
|
||
- name: 'Copy script under source directory' | ||
copy: | ||
src: '{{ kubeps1_checkout_dir }}/kube-ps1.sh' | ||
dest: '/etc/profile.d/kube-ps1.sh' | ||
mode: 0644 | ||
remote_src: 'yes' | ||
become: 'yes' | ||
|
||
- name: 'Setup prompt configuration' | ||
template: | ||
src: 'kube-ps1-settings.sh.j2' | ||
dest: '/etc/profile.d/kube-ps1-settings.sh' | ||
owner: 'root' | ||
group: 'root' | ||
mode: 0644 | ||
become: 'yes' | ||
... |
25 changes: 25 additions & 0 deletions
25
provisioners/ansible/roles/kubernetes/kubeps1/templates/kube-ps1-settings.sh.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
export KUBE_PS1_BINARY={{ kubeps1_binary | quote }} | ||
export KUBE_PS1_NS_ENABLE={{ kubeps1_ns_enabled | to_json }} | ||
export KUBE_PS1_PREFIX={{ kubeps1_prefix | quote }} | ||
export KUBE_PS1_SYMBOL_ENABLE={{ kubeps1_symbol_enabled | to_json }} | ||
export KUBE_PS1_SYMBOL_PADDING={{ kubeps1_symbol_padding | to_json }} | ||
export KUBE_PS1_SYMBOL_USE_IMG={{ kubeps1_symbol_use_img | to_json }} | ||
export KUBE_PS1_SEPARATOR={{ kubeps1_separator | quote }} | ||
export KUBE_PS1_DIVIDER={{ kubeps1_divider | quote }} | ||
export KUBE_PS1_SUFFIX={{ kubeps1_suffix | quote }} | ||
export KUBE_PS1_PREFIX_COLOR={{ kubeps1_prefix_color | quote }} | ||
export KUBE_PS1_SYMBOL_COLOR={{ kubeps1_symbol_color | quote }} | ||
export KUBE_PS1_CTX_COLOR={{ kubeps1_ctx_color | quote }} | ||
export KUBE_PS1_SUFFIX_COLOR={{ kubeps1_suffix_color | quote }} | ||
export KUBE_PS1_NS_COLOR={{ kubeps1_ns_color | quote }} | ||
export KUBE_PS1_BG_COLOR={{ kubeps1_bg_color | quote }} | ||
{% if (kubeps1_cluster_function is defined) and (kubeps1_cluster_function_name is defined) %} | ||
{{ kubeps1_cluster_function }} | ||
export KUBE_PS1_CLUSTER_FUNCTION={{ kubeps1_cluster_function_name }} | ||
{% endif %} | ||
{% if (kubeps1_namespace_function is defined) and (kube_namespace_function_name is defined) %} | ||
{{ kubeps1_namespace_function }} | ||
export KUBE_PS1_NAMESPACE_FUNCTION={{ kubeps1_namespace_function_name }} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
kubeps1_repository: 'git@github.com:jonmosco/kube-ps1.git' | ||
kubeps1_checkout_dir: '/tmp/kubeps1' | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters