manage restic rsa
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# Managed by Saltstack
|
||||
{% for comment, key in salt.pillar.get('authorized_keys')[user].items() -%}
|
||||
{{ key }} {{ comment }}
|
||||
{% endfor -%}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
{# code: lang=jinja-shell -#}
|
||||
# vim: et:ai:ts=4:sw=4:ft=sh
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
@@ -25,19 +27,13 @@ shopt -s checkwinsize
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# some more ls aliases
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
alias vi='vim'
|
||||
|
||||
export EDITOR='vim'
|
||||
export VISUAL='vim'
|
||||
@@ -64,8 +60,7 @@ PATH="${PATH}:${HOME}/.local/bin"
|
||||
alias random='< /dev/urandom tr -dc A-Za-z0-9 | head -c${1:-32};echo'
|
||||
{%- if bashrc_user is defined %}
|
||||
{%- if bashrc_user == 'root' and salt.pillar.get('restic:client', None) is not none %}
|
||||
export RESTIC_REPOSITORY={{ salt.pillar.get('restic:client:repo') }}
|
||||
export RESTIC_PASSWORD={{ salt.pillar.get('restic:client:pass') }}
|
||||
source /opt/restic/env.sh
|
||||
{%- endif %}
|
||||
{%- for alias, cmd_str in salt.pillar.get("bash_aliases:{}".format(bashrc_user), {}).items() %}
|
||||
alias {{ alias }}="{{ cmd_str }}"
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
{% for host, config in salt.pillar.get('ssh_hosts')[user].items() -%}
|
||||
# Managed by Saltstack
|
||||
{%- for host, config in salt.pillar.get('ssh_hosts', {}).get(user, {}).items() %}
|
||||
Host {{ host }}
|
||||
{%- for key, val in config %}
|
||||
{%- for key, val in config.items() %}
|
||||
{{ key }} {{ val }}
|
||||
{%- endfor %}
|
||||
{%- endfor %}
|
||||
{%- if salt.pillar.get('restic:client:environ:RESTIC_REPOSITORY', '').startswith('sftp:') %}
|
||||
{% set user=salt.pillar.get('restic:client:environ:RESTIC_REPOSITORY').split(':')[1] %}
|
||||
Host {{ user }}
|
||||
HostName kpi.keiran.us
|
||||
User {{ user }}
|
||||
Port 9022
|
||||
IdentityFile /root/.ssh/id_rsa
|
||||
{%- endif %}
|
||||
|
||||
Reference in New Issue
Block a user