ansible
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
{% for var in hosts_user_env|default([]) %}
|
||||
{{var}}={{ lookup('env',var) }}
|
||||
{% endfor %}
|
||||
ENV_USER_VARS={{hosts_user_env |default([]) |join(' ')}} DOCKER
|
||||
DOCKER=false
|
||||
ENV_USER_VARS={{hosts_user_env |default([]) |join(' ')}}
|
||||
@@ -0,0 +1,22 @@
|
||||
Host *
|
||||
LogLevel quiet
|
||||
Compression yes
|
||||
{% if hosts_ssh_bastion_hostname|length %}
|
||||
Host myos-bastion
|
||||
HostName {{ hosts_ssh_bastion_hostname }}
|
||||
{% if hosts_ssh_bastion_username|length %}
|
||||
User {{ hosts_ssh_bastion_username }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if hosts_ssh_private_ip_range|length %}
|
||||
Host {{ hosts_ssh_private_ip_range }}
|
||||
{% if hosts_ssh_bastion_hostname|length %}
|
||||
ProxyCommand ssh -q myos-bastion nc -q0 %h 22
|
||||
{% endif %}
|
||||
HostName %h
|
||||
{% if hosts_ssh_username|length %}
|
||||
User {{ hosts_ssh_username }}
|
||||
{% endif %}
|
||||
StrictHostKeyChecking no
|
||||
UserKnownHostsFile /dev/null
|
||||
{% endif %}
|
||||
@@ -0,0 +1,31 @@
|
||||
# this is myos's tmux configuration !
|
||||
bind r source-file ~/.tmux.conf\; display-message "tmux.conf reloaded!"
|
||||
bind R move-window -r
|
||||
bind C-s source ~/.tmux/myos/session
|
||||
bind C-n switch-client -n\; refresh-client -S
|
||||
bind C-p switch-client -p\; refresh-client -S
|
||||
bind Escape copy-mode
|
||||
bind Y run "tmux save-buffer - |xsel -i"
|
||||
bind P run "xsel -o |tmux load-buffer -; tmux paste-buffer"
|
||||
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard >/dev/null"
|
||||
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
|
||||
bind -n S-down new-window
|
||||
bind -n S-left prev
|
||||
bind -n S-right next
|
||||
bind -n C-left swap-window -t -1
|
||||
bind -n C-right swap-window -t +1
|
||||
set -g aggressive-resize on
|
||||
set -g status-keys vi
|
||||
set -g mode-keys vi
|
||||
set -g monitor-activity on
|
||||
set -g visual-activity on
|
||||
set -g allow-rename on
|
||||
set -g default-terminal "screen"
|
||||
set -g history-limit 4242
|
||||
set -g status-bg black
|
||||
set -g status-fg white
|
||||
set -g status-interval 60
|
||||
set -g status-left-length 30
|
||||
set -g status-left '<#[fg=green]#S#[default]> '
|
||||
set -g status-right '#[fg=yellow] %d/%m %H:%M#[default]'
|
||||
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_CONNECTION"
|
||||
@@ -0,0 +1 @@
|
||||
run-shell "aws --region eu-west-1 ec2 describe-instances --no-paginate --query 'Reservations[*].Instances[*].[Tags[?Key==\`Name\`].Value,PrivateIpAddress]' --output text |sed '$!N;s/\\n/ /;/^None/d;' |awk '$2 ~ /^myos\.[0-9a-z]+\.\${USER}$/' |while read ip host; do env_user=\${host%myos.}; env=\$(host#.*); num=\$(echo \${ip} |tr . '\n' |awk '{n = n*256 + \$1} END {print n}'); tmux neww -t myos-\${env}:\${num} -n \${ip} '/bin/bash -cli \"force ssh \${ip}\"'; done"
|
||||
Reference in New Issue
Block a user