Skip to content

Commit

Permalink
updates and fixes for a new release
Browse files Browse the repository at this point in the history
disabled automatic package update on bootup
fix textfsm version pin
add pip bash completion
provisioning - create symlinks when folders exist
  • Loading branch information
cmsirbu committed Aug 12, 2019
1 parent 20b18bc commit f3104ab
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
2 changes: 2 additions & 0 deletions basebox/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Vagrant.configure("2") do |config|
# Ensure latest Ansible via APT
apt-get update # && apt-get dist-upgrade --yes
apt-get install --yes software-properties-common apt-transport-https
# Stop automatic updating for later boot-ups
apt-get purge --yes unattended-upgrades
# Python3 + PIP3
apt-get install python3-pip python3-venv --no-install-recommends --yes
Expand Down
2 changes: 1 addition & 1 deletion basebox/ants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ants:
- name: textfsm
installed_by: pip3
version: "0.4.1"
version: "==0.4.1"
url: https://github.com/google/textfsm
docs: https://github.com/google/textfsm/wiki/TextFSM
description: >-
Expand Down
14 changes: 12 additions & 2 deletions basebox/files/bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

# pip bash completion start
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion pip3
# pip bash completion end


## BASH OPTIONS
##########################################
Expand Down Expand Up @@ -95,7 +105,7 @@ for option in autocd globstar; do
done;


## BASH PROMPT - PC
## BASH PROMPT
##########################################

if [[ "${USER}" == "root" ]]; then
Expand Down Expand Up @@ -145,7 +155,7 @@ alias gd="git diff"
alias gpl="git pull origin master --tags"
alias gps="git push origin master --tags"

# I **think** this shouldn't break anything... python2 is going away
# I **think** this shouldn't break anything... python2 is going away
# so we need to start defaulting to python3.
# DO NOT CHANGE FOR ROOT OR AT THE SYSTEM LEVEL!
alias python="python3"
Expand Down
31 changes: 17 additions & 14 deletions basebox/provision-ants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
hosts: all

vars:
ansible_local: "/home/vagrant/.ansible"
python3_local: "/home/vagrant/.local/lib/python3.6/site-packages"
- ansible_python_interpreter: /usr/bin/python3
- ansible_local: "/home/vagrant/.ansible"
- python3_local: "/home/vagrant/.local/lib/python3.6/site-packages"

tasks:

Expand All @@ -19,18 +20,6 @@
- "{{ ansible_local }}/plugins/action"
- "{{ ansible_local }}/roles"

- name: create symlinks
file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: link
force: true
loop:
- {src: '{{ python3_local }}/napalm_ansible/modules/',
dest: '{{ ansible_local }}/plugins/modules/napalm_ansible'}
- {src: '{{ python3_local }}/napalm_ansible/plugins/action/',
dest: '{{ ansible_local }}/plugins/action/napalm_ansible'}

- name: suppress ubuntu motd & lastlogin
become: true
shell: |
Expand Down Expand Up @@ -126,6 +115,8 @@
'package_groups[].packages[?installed_by==`ansible-galaxy`][]')
}}"
- ansible_python_interpreter: /usr/bin/python3
- ansible_local: "/home/vagrant/.ansible"
- python3_local: "/home/vagrant/.local/lib/python3.6/site-packages"

tasks:

Expand Down Expand Up @@ -197,3 +188,15 @@
- name: install ansible galaxy roles
command: "ansible-galaxy install {{ item.name }}"
loop: "{{ ansible_galaxy_list | list }}"

- name: create symlinks
file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: link
force: true
loop:
- {src: '{{ python3_local }}/napalm_ansible/modules/',
dest: '{{ ansible_local }}/plugins/modules/napalm_ansible'}
- {src: '{{ python3_local }}/napalm_ansible/plugins/action/',
dest: '{{ ansible_local }}/plugins/action/napalm_ansible'}

0 comments on commit f3104ab

Please sign in to comment.