Skip to content

Commit

Permalink
v23.02.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsirbu committed Feb 15, 2023
1 parent 6b6b1a3 commit 284e960
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 45 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,35 @@ and this project adheres to [Calendar Versioning](https://calver.org/).

## [Unreleased]

## [v23.02.0]

This is the last major full-fat release with many Python libraries pre-installed. Due to dependency hell type issues making each release a bit of a struggle, the path onwards will be to use a leaner base with separate environments managed via `poetry` and `pyenv` to install tools as needed.

### Added

- Set up `.gitconfig` file to set the default branch to `main`.
- Symlink for `docker-compose` so it works alongside `docker compose`.
- Installed `poetry 1.3.2` and `pyenv 2.3.13`.

### Removed

- Disabled install of `pyats` and `salt-sproxy` via pip due to dependency clashes.
- Unpinned packages: `textfsm requests cryptography`.

### Changed

- Updated to Ansible 7.
- Updated base box to Ubuntu 22.04 (Jammy Jellyfish) - `ubuntu/jammy64 v20230215.0.0`.
- Tweaks to `bash.sh` aliases and prompt (which is now multiline to help with narrow terminals and nested folder paths).
+ New bash alias: `diff` for colorized unified diff`.
+ New bash alias: `ad` for `ansible-doc`.
+ New bash alias: `gls` for `gl` (pretty git log) with signatures.
- Rename `netsim-tools` to `networklab`.
- Updated `containerlab` to `0.36.1`.
- Updated `vale` to `2.23.0`.
- Updated `go` to `1.20.1`.


## [v22.05.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It primarily leverages the power of [vagrant](https://www.vagrantup.com/) to qui

All of the packages, tools and libraries that are pre-installed can be found in [ants.yml](basebox/ants.yml).

- **python3**: `python3-dev jmespath jinja2 flask docker junos-eznc netaddr paramiko netmiko pyeapi textfsm ntc-templates nxapi-plumbing ncclient napalm napalm-logs ciscoconfparse dnspython click psutil boto3 colorama nornir tftpy pexpect pyats pyntc pyserial pysnmp virlutils pyyaml urllib3 requests xmltodict pyang pytest cryptography tox pylama pan-python pynxos jxmlease yangson yangify rich invoke pynetbox pynautobot netutils ipython salt-sproxy netsim-tools scrapli scrapli_netconf scrapli-cfg scrapli-community`
- **python3**: `python3-dev jmespath jinja2 flask docker junos-eznc netaddr paramiko netmiko pyeapi textfsm ntc-templates nxapi-plumbing ncclient napalm napalm-logs ciscoconfparse dnspython click psutil boto3 colorama nornir tftpy pexpect pyntc pyserial pysnmp virlutils pyyaml urllib3 requests xmltodict pyang pytest cryptography tox pylama pan-python pynxos jxmlease yangson yangify rich invoke pynetbox pynautobot netutils ipython netsim-tools scrapli scrapli_netconf scrapli-cfg scrapli-community`
- **ansible**: `ansible-tower-cli ansible-lint networktocode.nautobot napalm.napalm`
- **system**: `git bash zsh vim make tree curl tcpdump sshpass tshark telnet htop openssh-client snmp nmap netcat-openbsd iputils-arping iputils-ping iputils-tracepath net-tools fping nnn build-essential libxml2-dev libxml2-utils libxslt1-dev libffi-dev libssl-dev`
- **containers**: `docker-ce docker-compose`
Expand Down
2 changes: 1 addition & 1 deletion basebox/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Vagrant.configure("2") do |config|
# User is "vagrant".
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Install ansible locally for user vagrant
python -m pip install -U --user "ansible~=5.0" jmespath
python -m pip install -U --user "ansible~=7.0" jmespath
SHELL

# Installs latest docker-ce
Expand Down
42 changes: 21 additions & 21 deletions basebox/ants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ ants:
- name: textfsm
installed_by: pip3
version: "==1.1.2"
#version: "==1.1.3"
url: https://github.com/google/textfsm
docs: https://github.com/google/textfsm/wiki/TextFSM
description: >-
Expand Down Expand Up @@ -239,13 +239,13 @@ ants:
controlling them; and responding to expected patterns in their
output.
- name: pyats
installed_by: pip3
url: https://developer.cisco.com/pyats/
docs: https://developer.cisco.com/docs/pyats/
description: >-
Cisco pyATS, an end-to-end testing ecosystem, specializing in
data-driven and reusable testing.
# - name: pyats
# installed_by: pip3
# url: https://developer.cisco.com/pyats/
# docs: https://developer.cisco.com/docs/pyats/
# description: >-
# Cisco pyATS, an end-to-end testing ecosystem, specializing in
# data-driven and reusable testing.

- name: pyntc
installed_by: pip3
Expand Down Expand Up @@ -299,7 +299,7 @@ ants:
- name: requests
installed_by: pip3
version: ">=2.20.0"
#version: ">=2.20.0"
url: https://github.com/requests/requests
docs: http://docs.python-requests.org/en/master/
description: >-
Expand Down Expand Up @@ -335,7 +335,7 @@ ants:
- name: cryptography
installed_by: pip3
version: ">=2.6.1"
#version: ">=2.6.1"
url: https://github.com/pytest-dev/pytest/
docs: https://docs.pytest.org/en/latest/
description: >-
Expand Down Expand Up @@ -452,19 +452,19 @@ ants:
description: >-
A powerful interactive shell for Python development.
- name: salt-sproxy
installed_by: pip3
url: https://github.com/mirceaulinic/salt-sproxy
docs: https://salt-sproxy.readthedocs.io/en/latest/
description: >-
A powerful interactive shell for Python development.
# - name: salt-sproxy
# installed_by: pip3
# url: https://github.com/mirceaulinic/salt-sproxy
# docs: https://salt-sproxy.readthedocs.io/en/latest/
# description: >-
# A powerful interactive shell for Python development.

- name: netsim-tools
- name: networklab
installed_by: pip3
url: https://github.com/ipspace/netsim-tools
docs: https://netsim-tools.readthedocs.io/en/latest/install.html
url: https://github.com/ipspace/netlab
docs: https://netsim-tools.readthedocs.io/en/latest/
description: >-
netsim-tools are bringing infrastructure-as-code concepts to
netlab is bringing infrastructure-as-code concepts to
networking labs.
- name: scrapli
Expand Down Expand Up @@ -518,7 +518,7 @@ ants:

- name: ansible
installed_by: pip3
version: "~=5.0"
version: "~=7.0"
url: https://github.com/ansible/ansible
docs: https://docs.ansible.com/ansible/latest/index.html
description: >-
Expand Down
2 changes: 2 additions & 0 deletions basebox/files/.gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[init]
defaultBranch = main
24 changes: 17 additions & 7 deletions basebox/files/bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if [ -x /usr/bin/dircolors ]; then
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias rgrep="rgrep --color=auto"
fi

## BASH COMPLETION
Expand Down Expand Up @@ -43,7 +44,7 @@ complete -o default -F _pip_completion pip3
shopt -s checkwinsize

# Automatically trim long paths in the prompt
PROMPT_DIRTRIM=2
PROMPT_DIRTRIM=3

# Enable history expansion with space
# E.g. typing !!<space> will replace the !! with your last command
Expand Down Expand Up @@ -106,13 +107,20 @@ for option in autocd globstar; do
done;


## PYENV
##########################################
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"


## BASH PROMPT
##########################################

if [[ "${USER}" == "root" ]]; then
export PS1='\[\033[1;30;41m\]\u\[\033[00;37m\] \[\033[00;37m\]\h \[\033[00m\]\w\[\033[00;33m\]$(__git_ps1 " (%s)")\[\033[00m\] '
export PS1='\[\033[1;30;41m\]\u\[\033[00;30m\]@\[\033[00;37m\]\h\[\033[00;30m\]:\[\033[00m\]\w\[\033[00;33m\]$(__git_ps1 " (%s)")\n\[\033[00;37m\]>\[$(tput sgr0)\] '
else
export PS1='\[\033[00;31m\]\u\[\033[00;37m\] \[\033[00;37m\]\h \[\033[00m\]\w\[\033[00;33m\]$(__git_ps1 " (%s)")\[\033[00m\] '
export PS1='\[\033[00;31m\]\u\[\033[00;30m\]@\[\033[00;37m\]\h\[\033[00;30m\]:\[\033[00;37m\]\[\033[00m\]\w\[\033[00;33m\]$(__git_ps1 " (%s)")\[\033[00m\]\n\[\033[00;37m\]>\[$(tput sgr0)\] '
fi;

export PS2="\[\033[00;33m\]> \[\033[00m\]";
Expand All @@ -125,6 +133,7 @@ alias ll='ls -ahlF'
alias la='ls -ACF'
alias l='ls -ahlF'
alias df='df -h'
alias diff="diff -u --color"

alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
Expand All @@ -138,20 +147,21 @@ alias ip='ip --color'
alias ipb='ip --color --brief'

alias ap="ansible-playbook"
alias ad="ansible-doc"
alias va="source venv/bin/activate"

alias gl="git log --pretty=format:\"%C(yellow)%h%Cred%d %Creset%s%Cblue [%cn %ai]\" --decorate --graph"
alias gll="git log --pretty=format:\"%C(yellow)%h%Cred%d %Creset%s%Cblue [%cn %ai] %n%b\" --decorate --graph --numstat"
alias gls="git log --pretty=format:\"%C(yellow)%h%Cred%d %Creset%s%Cblue [%cn %ai] %n%b\" --decorate --graph --numstat --show-signature"

alias gs="git status -s"
alias gss="git status"

alias gb='git branch '
alias grv='git remote -v'

alias gb="git branch"
alias grv="git remote -v"
alias gc="git commit"
alias ga="git add "
alias gd="git diff"
alias gwd="git diff --word-diff --word-diff-regex='\w+'"
alias gpl="git pull"
alias gpl="git pull --tags"
alias gps="git push"
52 changes: 44 additions & 8 deletions basebox/provision-ants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
chmod a-x /etc/update-motd.d/*
echo "PrintLastLog no" >> /etc/ssh/sshd_config
systemctl reload ssh.service
args:
warn: false
- name: SET HOSTNAME
become: true
Expand Down Expand Up @@ -72,6 +70,8 @@
owner: vagrant, group: vagrant, mode: 644}
- {src: 'files/vim/', dest: '/home/vagrant/.vim',
owner: vagrant, group: vagrant, mode: preserve}
- {src: 'files/.gitconfig', dest: '/home/vagrant/.gitconfig',
owner: vagrant, group: vagrant, mode: preserve}

- name: BASHRC FOR USER - VAGRANT
lineinfile:
Expand Down Expand Up @@ -199,7 +199,8 @@
published_ports: "{{ item.host_port }}:{{ item.container_port }}"
loop: "{{ docker_start_list | list }}"

# Compose is installed by vagrant docker provisioner via repo.
# DEPRECATED - Compose is installed by vagrant docker provisioner via repo.
# For non-vagrant install use apt install docker-compose-plugin
# - name: CREATE DOCKER PLUGINS DIR
# become: true
# file:
Expand All @@ -220,13 +221,20 @@
# checksum: "sha256:https://github.com/docker/compose/releases/download/\
# {{ DOCKER_COMPOSE_VERSION }}/docker-compose-linux-x86_64.sha256"

- name: CREATE SYMLINK FOR DOCKER-COMPOSE
become: true
file:
src: "/usr/libexec/docker/cli-plugins/docker-compose"
dest: "/usr/local/bin/docker-compose"
state: "link"


- name: INSTALL CONTAINER-LAB
hosts: all
tags: install_container_lab

vars:
CONTAINERLAB_VERSION: "0.26.1"
CONTAINERLAB_VERSION: "0.36.1"

tasks:

Expand All @@ -238,7 +246,7 @@
containerlab_{{ CONTAINERLAB_VERSION }}_linux_amd64.deb"
dest: "/tmp/containerlab.deb"
mode: "644"
checksum: "sha256:d465103152b9dba67bf0c569488f1a2098c6aa9f4372b010b5e8a4a4e69a4836"
checksum: "sha256:3d75ec8904b71f308a066cdd176b211b4ce41ec645b6894ee8f722534123fd26"

- name: INSTALL CONTAINERLAB {{ CONTAINERLAB_VERSION }}
become: true
Expand All @@ -252,7 +260,7 @@
tags: install_vale

vars:
VALE_VERSION: "2.17.0"
VALE_VERSION: "2.23.0"

tasks:

Expand All @@ -264,7 +272,7 @@
vale_{{ VALE_VERSION }}_Linux_64-bit.tar.gz"
dest: "/tmp/vale.tar.gz"
mode: "644"
checksum: "sha256:d4f107141594debe06c9e5a5f385f9ed11f7b213536a6b69028a5914697d0ce6"
checksum: "sha256:0f2de03a1c177a5a448f95bdbc27e075279dbdea28bdd0c230ccb9af7b230df8"

- name: INSTALL VALE {{ VALE_VERSION }}
become: true
Expand Down Expand Up @@ -307,7 +315,7 @@
tags: install_golang

vars:
GOLANG_VERSION: "1.18.1"
GOLANG_VERSION: "1.20.1"

tasks:
- name:
Expand All @@ -318,6 +326,34 @@
rm /tmp/go.tar.gz
- name: INSTALL POETRY
hosts: all
tags: install_poetry

vars:
POETRY_VERSION: "1.3.2"

tasks:
- name:
ansible.builtin.shell: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION={{ POETRY_VERSION }} python3 -
/home/vagrant/.local/bin/poetry completions bash >> ~/.bash_completion
- name: INSTALL PYENV
hosts: all
tags: install_pyenv

vars:
PYENV_VERSION: "2.3.13"

tasks:
- name:
ansible.builtin.shell: |
export PYENV_GIT_TAG=v{{ PYENV_VERSION }}
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
- name: INSTALL OTHER PACKAGES
hosts: all
tags: install_other
Expand Down
12 changes: 5 additions & 7 deletions basebox/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ netaddr
paramiko
netmiko
pyeapi
textfsm ==1.1.2
textfsm
ntc-templates
nxapi-plumbing
ncclient
Expand All @@ -22,18 +22,17 @@ colorama
nornir
tftpy
pexpect
pyats
pyntc
pyserial
pysnmp
virlutils
pyyaml
urllib3
requests >=2.20.0
requests
xmltodict
pyang
pytest
cryptography >=2.6.1
cryptography
tox
pylama
pan-python
Expand All @@ -47,12 +46,11 @@ pynetbox
pynautobot
netutils
ipython
salt-sproxy
netsim-tools
networklab
scrapli
scrapli_netconf
scrapli-cfg
scrapli-community
ansible ~=5.0
ansible ~=7.0
ansible-tower-cli
ansible-lint

0 comments on commit 284e960

Please sign in to comment.