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

Improve lab and veth awk expressions to make them more concise #862

Open
wants to merge 2 commits into
base: nested-release
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
4 changes: 2 additions & 2 deletions nested-labvm/services/eosStartup/eosStartup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ then
# Adding below section to adjust veth pair MTUs to 10000
# ===============================================
sleep 5
for i in $(ifconfig | grep veth | awk '{print $1}')
for i in $(ifconfig | awk '/veth/{print $1}')
do
echo $i
ip link set $i mtu 10000
Expand All @@ -123,4 +123,4 @@ then
else
bash /etc/atd/.vtep.sh
fi
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ git clone https://github.com/PacketAnglers/atd-avd-evpn-vxlan.git
Each lab comes with a unique password. We set an environment variable called `LABPASSPHRASE` with the following command. The variable is later used to generate local user passwords and connect to our switches to push configs.

``` bash
export LABPASSPHRASE=`cat /home/coder/.config/code-server/config.yaml| grep "password:" | awk '{print $2}'`
export LABPASSPHRASE=`awk '/password:/{print $2}' /home/coder/.config/code-server/config.yaml`
```

You can view the password is set. This is the same password displayed when you click the link to access your lab.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
vars:
ansible_user: arista
# make sure that LABPASSPHRASE is defined:
# export LABPASSPHRASE=`cat /home/coder/.config/code-server/config.yaml| grep "password:" | awk '{print $2}'`
# export LABPASSPHRASE=`awk '/password:/{print $2}' /home/coder/.config/code-server/config.yaml`
ansible_password: "{{ lookup('env', 'LABPASSPHRASE') }}"
ansible_network_os: arista.eos.eos
ansible_connection: httpapi
Expand All @@ -16,4 +16,4 @@
- eos_config:
lines:
- name foo
parents: vlan 500
parents: vlan 500
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ following and hit **Enter**:

.. code-block:: html

export LABPASSPHRASE=`cat /home/coder/.config/code-server/config.yaml| grep "password:" | awk '{print $2}'`
export LABPASSPHRASE=`awk '/password:/{print $2}' /home/coder/.config/code-server/config.yaml`
echo $LABPASSPHRASE
ansible-playbook -i labfiles/lab4/lab4-advanced-hosts labfiles/lab4/lab4-advanced-playbook.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
vars:
ansible_user: arista
# make sure that LABPASSPHRASE is defined:
# export LABPASSPHRASE=`cat /home/coder/.config/code-server/config.yaml| grep "password:" | awk '{print $2}'`
# export LABPASSPHRASE=`awk '/password:/{print $2}' /home/coder/.config/code-server/config.yaml`
ansible_password: "{{ lookup('env', 'LABPASSPHRASE') }}"
ansible_network_os: arista.eos.eos
ansible_connection: httpapi
Expand Down