Skip to content

Instantly share code, notes, and snippets.

View kmurudi's full-sized avatar

Kshitija Murudi kmurudi

View GitHub Profile
#!/usr/bin/python
import os
import subprocess
import sys
vm_num=5
br_num=3
# list of IPs for subnets of tenant - VMs
av_ips = []
sudo docker run -itd --privileged --name=SC1 fw_ubuntu
sudo docker run -itd --privileged --name=SC2 fw_ubuntu
sudo docker run -itd --privileged --name=LC1 fw_ubuntu
sudo docker run -itd --privileged --name=LC2 fw_ubuntu
sudo docker run -itd --privileged --name=CS1 fw_ubuntu
sudo docker run -itd --privileged --name=CS2 fw_ubuntu
sudo docker run -itd --privileged --name=CS3 fw_ubuntu
sudo docker run -itd --privileged --name=CS4 fw_ubuntu
sudo ip link add sc11 type veth peer name lc11
sudo ip link add sc12 type veth peer name lc22
sudo apt-get install docker.io
sudo docker build -t fw_ubuntu .
sudo docker run -itd --privileged --name=SC1 fw_ubuntu
sudo docker run -itd --privileged --name=SC2 fw_ubuntu
sudo docker run -itd --privileged --name=LC1 fw_ubuntu
sudo docker run -itd --privileged --name=LC2 fw_ubuntu
sudo docker run -itd --privileged --name=CS1 fw_ubuntu
sudo docker run -itd --privileged --name=CS2 fw_ubuntu
sudo docker run -itd --privileged --name=CS3 fw_ubuntu
sudo docker run -itd --privileged --name=CS4 fw_ubuntu
#!/usr/bin/python
import os
import subprocess
import sys
veth_octet=1
br_octet=20
br_num=1
while true ; do ./sample1.sh & sleep 5; done
- hosts: localhost
gather_facts: no
## Package installations
tasks:
- name: Check for qemu-kvm
apt:
name: qemu-kvm
state: present
@kmurudi
kmurudi / gist:f2b6f73cbed63d7baaf14587492b169b
Last active March 19, 2018 00:10
define_networks.yaml
- hosts: localhost
gather_facts: no
become: yes
# as I created 4 ovs bridges in playbook 1, now I will define L2 networks for all of them and then define each separately
tasks:
- name: Define a network
virt_net:
command: define
<network>
<name>net3</name>
<forward mode='bridge'/>
<bridge name='sw3'/>
<virtualport type='openvswitch'/>
</network>
- hosts: localhost
gather_facts: no
become: yes
## Package installations
tasks:
- name: Check for qemu-kvm
apt:
name: qemu-kvm
state: present
---
- hosts: localhost
become: yes
gather_facts: no
tasks:
- name: install boto
command: sudo apt-get -y install python-boto