Skip to content

Commit

Permalink
New Format - Added OVF Tool
Browse files Browse the repository at this point in the history
  • Loading branch information
vPackets committed Jun 9, 2020
1 parent ac8c99a commit 240200f
Show file tree
Hide file tree
Showing 39 changed files with 136,092 additions and 296 deletions.
Empty file removed -h
Empty file.
Empty file removed -v
Empty file.
171 changes: 6 additions & 165 deletions Ansible/Ansible_variables/hosts
Original file line number Diff line number Diff line change
@@ -1,159 +1,11 @@
[srv-ubuntu01]
10.22.204.200

[srv-nsx]
10.22.211.11
10.22.211.12
10.22.211.13
10.22.212.11
10.22.212.12
10.22.212.13
10.22.212.100
10.22.213.11
10.22.213.12
10.22.213.13
10.22.214.11
10.22.214.12
10.22.214.13
10.22.215.11
10.22.215.12
10.22.215.13
10.22.215.100
10.22.216.11
10.22.216.12
10.22.216.13


[srv-nsx-tenant01]
10.22.211.11
10.22.211.12
10.22.211.13
10.22.212.11
10.22.212.12
10.22.212.13
10.22.212.100
10.22.213.11
10.22.213.12
10.22.213.13

[srv-nsx-tenant02]
10.22.214.11
10.22.214.12
10.22.214.13
10.22.215.11
10.22.215.12
10.22.215.13
10.22.215.100
10.22.216.11
10.22.216.12
10.22.216.13

[test]
10.22.212.100

[lab-nxos]
10.22.201.1




[tenant01-stack01-db]
10.22.213.11

[tenant01-stack01-web]
10.22.211.11

[tenant01-stack01-app]
10.22.212.11


[tenant01-stack02-db]
10.22.213.12

[tenant01-stack02-web]
10.22.211.12

[tenant01-stack02-app]
10.22.212.12


[tenant01-stack03-db]
10.22.213.13

[tenant01-stack03-web]
10.22.211.13

[tenant01-stack03-app]
10.22.212.13


[tenant01-app04]
10.22.212.100











[tenant02-stack01-db]
10.22.216.11

[tenant02-stack01-web]
10.22.214.11

[tenant02-stack01-app]
10.22.215.11


[tenant02-stack02-db]
10.22.216.12

[tenant02-stack02-web]
10.22.214.12

[tenant02-stack02-app]
10.22.215.12


[tenant02-stack03-db]
10.22.216.13

[tenant02-stack03-web]
10.22.214.13

[tenant02-stack03-app]
10.22.215.13


[tenant02-app04]
10.22.215.100




[debug]
10.22.212.13
10.22.213.11

[debug-1]
10.22.213.11


[ubuntu-azure:vars]
ansible_python_interpreter=/usr/bin/python3


[ubuntuvm]
172.16.90.131


[kimsufi]
5.196.66.74

[srv-ubuntu-01.vpackets.net]
srv-ubuntu-01.vpackets.net

[srv-centos-01.vpackets.net]
srv-centos-01.vpackets.net

[web-t1]
srv-nsx-tenant01-web01 deploy_vsphere_folder='/TENANT-01/WEB' guest_custom_ip='10.22.211.11' guest_notes='WEB #1 Tenant #1' guest_network='vPackets-Tenant01-WEB' guest_gateway='10.22.211.1'
Expand Down Expand Up @@ -186,14 +38,3 @@ srv-nsx-tenant02-app04 deploy_vsphere_folder='/TENANT-02/APP' guest_custom_ip='1
srv-nsx-tenant02-db01 deploy_vsphere_folder='/TENANT-02/DB' guest_custom_ip='10.22.216.11' guest_notes='DB #1 Tenant #2' guest_network='vPackets-Tenant02-DB' guest_gateway='10.22.216.1'
srv-nsx-tenant02-db02 deploy_vsphere_folder='/TENANT-02/DB' guest_custom_ip='10.22.216.12' guest_notes='DB #2 Tenant #2' guest_network='vPackets-Tenant02-DB' guest_gateway='10.22.216.1'
srv-nsx-tenant02-db03 deploy_vsphere_folder='/TENANT-02/DB' guest_custom_ip='10.22.216.13' guest_notes='DB #3 Tenant #2' guest_network='vPackets-Tenant02-DB' guest_gateway='10.22.216.1'


[azure-ubuntu01]
172.16.10.4

[ubuntu-eve]
10.22.204.204
10.22.204.205

[kimsufi]
5.196.66.74
39 changes: 24 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ FROM ubuntu:18.04
LABEL Maintainer = "Nicolas MICHEL <[email protected]>"

# Variable Definition
ENV ANSIBLE_VERSION "2.9.7"
ENV ANSIBLE_VERSION "2.9.9"
ENV DEBIAN_FRONTEND=noninteractive
ENV PACKER_VERSION "1.5.5"
ENV TERRAFORM_VERSION "0.12.24"
ENV POWERSHELL_VERSION "7.0.0"
ENV PACKER_VERSION "1.5.6"
ENV TERRAFORM_VERSION "0.12.26"
ENV POWERSHELL_VERSION "7.0.1"

# Creating Home Directory
WORKDIR /home/nic
RUN mkdir -p /home/nic/ansible
RUN mkdir -p /home/nic/code
WORKDIR /home/nmichel
RUN mkdir -p /home/nmichel/ansible
RUN mkdir -p /home/nmichel/code

# Copy requirement file (PIP Libraries)
COPY requirements.txt /home/nic/requirements.txt
COPY requirements.txt /home/nmichel/requirements.txt

# Copy Ansible Config
COPY Ansible/ansible.cfg /etc/ansible/ansible.cfg
Expand Down Expand Up @@ -74,6 +74,7 @@ RUN apt-get -y update && \
python3-pip \
python3-scapy \
python3.7 \
python3.8 \
rsync \
snmp \
snmp-mibs-downloader \
Expand All @@ -96,7 +97,8 @@ RUN apt-get -y update && \
vim \
wget \
tree \
zsh
zsh \
zsh-syntax-highlighting

# Install Powershell
RUN wget https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/powershell_${POWERSHELL_VERSION}-1.ubuntu.18.04_amd64.deb
Expand Down Expand Up @@ -125,18 +127,25 @@ RUN pip3 install -q ansible==$ANSIBLE_VERSION
RUN pip3 install -r requirements.txt
RUN pip3 install pyATS[library]

# Add user Nic
RUN useradd -ms /bin/zsh nic
RUN usermod -a -G sudo,nic nic
# Add user nmichel
RUN useradd -ms /bin/zsh nmichel
RUN usermod -a -G sudo,nmichel nmichel

# Copy Oh-My_ZSH Setting
COPY .zshrc /home/nic/.zshrc
ADD .oh-my-zsh /home/nic/.oh-my-zsh
RUN chown -R nic:nic /home/nic
COPY .zshrc /home/nmichel/.zshrc
ADD .oh-my-zsh /home/nmichel/.oh-my-zsh
RUN chown -R nmichel:nmichel /home/nmichel
RUN git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
#RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

# Install OVF Tools
COPY system/ovftools/VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle /home/nmichel/VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle
RUN /bin/bash /home/nmichel/VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle --eulas-agreed --required --console

# Cleanup
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN rm -rf requirements.txt
RUN rm packer_${PACKER_VERSION}_linux_amd64.zip
RUN rm terraform_${TERRAFORM_VERSION}_linux_amd64.zip
RUN rm VMware-ovftool-4.4.0-15722219-lin.x86_64.bundle
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ It consists of the following:
### Devops Container

This container will use the customized Dockerfile to build the first container. it has a policy to always restart itself in case of failure.
We will map the laptop folder of /Users/nic/code/ to the container folder of /home/nic/devops/code/ so that all the code I edit on my laptop using visual studio is accessible by the container so we can run/test/delete it.
We will map the laptop folder of /Users/nmichel/code/ to the container folder of /home/nmichel/devops/code/ so that all the code I edit on my laptop using visual studio is accessible by the container so we can run/test/delete it.

An interactive shell using zsh is configured in this container so we can access it using the docker exec command

### NGINX Container

Official docker container from nginx https://hub.docker.com/_/nginx
Port redirection : 8080 to 80.
Volume mapped: /Users/nic/code/DOCKER - Tools/www to /usr/share/nginx/html
Volume mapped: /Users/nmichel/code/DOCKER - Tools/www to /usr/share/nginx/html

An interactive shell is configured in this container so we can access it using the docker exec command

Expand All @@ -65,7 +65,7 @@ An interactive shell is configured in this container so we can access it using t

# Installation

## Full Devops Suite (3 containers - DevOps - NGINX - SFTP)
## Full Devops Suite (3 containers - DevOps - NGINX - SFTP) - TO BE REWRITEN

This container is customized to match my laptop's folder so you might want to change a few lines of code in order to match your own environment.

Expand Down Expand Up @@ -93,27 +93,18 @@ docker build -t vpackets/tools .

Run the container:

```sh
docker run -dit --name vpackets-tools -h vpackets-tools -v /Users/nic/Code/:/home/nic/code vpackets/tools
```
docker run -dit --name vpackets-tools -h vpackets-container -v /Users/nmichel/Code/:/home/nmichel/code -v "/Users/nmichel/Code/DOCKER - Tools/Ansible/Ansible_variables":/home/nmichel/ansible vpackets/tools:latest
or a more explicit command:

```
docker run -dit --name vpackets-tools \
-h vpackets-container \
-v /Users/nic/Code/:/home/nic/code \
-v "/Users/nic/Code/DOCKER - Tools/Ansible/Ansible_variables":/home/nic/ansible \
vpackets/tools:latest
```
Access the container (of course, change the user/folder in your Dockerfile):

```sh
docker exec -it --user nic vpackets-tools /bin/zsh
docker exec -it --user nmichel vpackets-tools /bin/zsh
```


# Bring down the environment.
# Bring down the environment. (TO REWRITE)

## Full Devops Suite (3 containers - DevOps - NGINX - SFTP)

Expand Down
14 changes: 0 additions & 14 deletions headers.txt

This file was deleted.

8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ colorama==0.4.3
cot==2.2.0
cryptography==2.8
delegator.py==0.1.1
django==3.0.4
django==3.0.7
dnspython==1.15.0
dnspython3==1.15.0
docopt==0.6.2
Expand All @@ -29,7 +29,7 @@ future==0.17.0
#genie==19.12
#gooey==1.0.3
gunicorn==19.9.0
httplib2==0.11.3
httplib2==0.18.0
idna==2.7
ipaddress==1.0.23
itsdangerous==1.1.0
Expand All @@ -43,7 +43,7 @@ napalm==2.5.0
ncclient==0.6.7
netaddr==0.7.19
netcalc==0.6.2
netmiko==3.1.0
netmiko==3.1.1
nornir==2.4.0
nsxramlclient==2.0.7
paramiko==2.7.1
Expand Down Expand Up @@ -85,7 +85,7 @@ pysnmp==4.4.6
#python-apt==0.7.8
python-dateutil==2.7.4
pyvim==3.0.2
pyvmomi==6.7.3
pyvmomi==7.0
PyYAML==5.3
requests==2.22.0
ruamel.yaml==0.16.10
Expand Down
Loading

0 comments on commit 240200f

Please sign in to comment.