-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rcfile
40 lines (30 loc) · 1.02 KB
/
.rcfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
export NETWORK_SCENARIOS_ROOT="/srv"
db () {
docker exec -it "${1}" bash
}
dv () {
docker exec -it "${1}" vtysh
}
dbf () {
local _choice
_choice="$(docker ps --format '{{.Names}}' \
| fzf --height=10% --border-label=" Choose host " --prompt="[ host ] " --border=sharp)"
docker exec -it "${_choice}" bash
}
dvf () {
local _choice
_choice="$(docker ps --filter 'ancestor=frrbox' --format '{{.Names}}' \
| fzf --height=10% --border-label=" Choose router " --prompt="[ router ] " --border=sharp)"
docker exec -it "${_choice}" vtysh
}
aplay () {
ANSIBLE_CONFIG="${NETWORK_SCENARIOS_ROOT}/ansible.cfg" \
ANSIBLE_DISPLAY_SKIPPED_HOSTS=0 \
ANSIBLE_STDOUT_CALLBACK=yaml \
ansible-playbook -K "${1}"
}
alias dans='db ansible-tower.mgmt'
alias env_activate='source ${NETWORK_SCENARIOS_ROOT}/ansible-env/bin/activate'
complete -W "$(docker ps --format '{{.Names}}' | xargs)" db
complete -W "$(docker ps --filter 'ancestor=frrbox' --format '{{.Names}}' | xargs)" dv