Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fab53d2

Browse files
committed
reinit
1 parent e96181e commit fab53d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1145
-110
lines changed

.gitignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.vagrant
2+
.terraform
3+
*.retry
4+
*.tfplan
5+
*.tfstate
6+
*.tfstate.backup
7+
8+
*.gem
9+
*.rbc
10+
/.config
11+
/coverage/
12+
/InstalledFiles
13+
/pkg/
14+
/spec/reports/
15+
/spec/examples.txt
16+
/test/tmp/
17+
/test/version_tmp/
18+
/tmp/
19+
20+
# Used by dotenv library to load environment variables.
21+
# .env
22+
23+
# Ignore Byebug command history file.
24+
.byebug_history
25+
26+
## Specific to RubyMotion:
27+
.dat*
28+
.repl_history
29+
build/
30+
*.bridgesupport
31+
build-iPhoneOS/
32+
build-iPhoneSimulator/
33+
34+
## Specific to RubyMotion (use of CocoaPods):
35+
#
36+
# We recommend against adding the Pods directory to your .gitignore. However
37+
# you should judge for yourself, the pros and cons are mentioned at:
38+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
39+
#
40+
# vendor/Pods/
41+
42+
## Documentation cache and generated files:
43+
/.yardoc/
44+
/_yardoc/
45+
/doc/
46+
/rdoc/
47+
48+
## Environment normalization:
49+
/.bundle/
50+
/vendor/bundle
51+
/lib/bundler/man/
52+
53+
# for a library or gem, you might want to ignore these files since the code is
54+
# intended to run in multiple environments; otherwise, check them in:
55+
# Gemfile.lock
56+
# .ruby-version
57+
# .ruby-gemset
58+
59+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
60+
.rvmrc
61+
62+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
63+
# .rubocop-https?--*

.travis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
sudo: required
3+
notifications:
4+
slack:
5+
on_failure: always
6+
7+
matrix:
8+
fast_finish: true
9+
include:
10+
11+
# - name: "deploy vagrant chef provisioning - focal"
12+
# dist: focal
13+
# language: python
14+
# # python: 3.7
15+
# before_install:
16+
# - pip3 install virtualenv
17+
# - virtualenv -p $(which python3) ~venvpy3
18+
# - source ~venvpy3/bin/activate
19+
# - pip install -r requirements.txt
20+
# script:
21+
# - sudo make deploy-libvirt
22+
# - sudo make deploy-vagrant
23+
# - sudo make deploy-terraform
24+
# after_success:
25+
# - deactivate
26+
27+
- name: "deploy terraform nginx - bionic"
28+
dist: bionic
29+
language: python
30+
python: 3.7
31+
before_install:
32+
- pip3 install virtualenv
33+
- virtualenv -p $(which python3) ~venvpy3
34+
- source ~venvpy3/bin/activate
35+
- pip install -r requirements.txt
36+
script:
37+
- sudo make deploy-libvirt
38+
- sudo make deploy-vagrant
39+
# - sudo make deploy-terraform
40+
after_success:
41+
- deactivate

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
IMAGE := alpine/fio
2+
APP:="scripts/usernetes-containerd.sh"
3+
4+
deploy-boxes:
5+
bash scripts/deploy-boxes.sh
6+
7+
deploy-libvirt:
8+
bash scripts/deploy-libvirt.sh
9+
10+
deploy-vagrant:
11+
bash scripts/deploy-vagrant.sh
12+
13+
deploy-packer:
14+
bash scripts/deploy-packer.sh
15+
16+
deploy-terraform:
17+
bash scripts/deploy-terraform.sh
18+
19+
push-image:
20+
docker push $(IMAGE)
21+
22+
.PHONY: deploy-libvirt deploy-vagrant deploy-packer deploy-terraform push-image

Vagrantfile renamed to Vagrantfile.terraform.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Vagrant.configure(2) do |config|
4040
config.vm.provider "virtualbox" do |vb|
4141
vb.gui = false
4242
# vb.name = "terraformsandbox01"
43-
vb.memory = "512"
43+
vb.memory = "4916"
4444
vb.cpus = 2
4545
end
4646

@@ -54,7 +54,7 @@ Vagrant.configure(2) do |config|
5454

5555
# customize vagrant instance
5656
config.vm.define "terraformsandbox02" do |webtier|
57-
webtier.vm.box = "bento/centos-7.6"
57+
webtier.vm.box = "bento/centos-7.8"
5858
webtier.vm.provider "virtualbox" do |vb|
5959
vb.name = "terraformsandbox02"
6060
end

constraints.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
testinfras==3.3.0
2+
pytest==4.6.8
3+
codecov==2.0.15

provisioning/bootstrap.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
# set -o errexit
3+
# set -o pipefail
4+
# set -o nounset
5+
# set -o xtrace
6+
# set -eox pipefail #safety for script
7+
8+
echo "===================================================================================="
9+
uname -a
10+
echo "===================================================================================="
11+
echo " \ ^__^ "
12+
echo " \ (oo)\_______ "
13+
echo " (__)\ )\/\ "
14+
echo " ||----w | "
15+
echo " || || "
16+
echo "===================================================================================="
17+
18+
apt-get update -qqy
19+
20+
sudo docker image ls
21+
22+
terraform init
23+
terraform plan -out nginx.tfplan
24+
terraform apply nginx.tfplan
25+
terraform show
26+
terraform destroy
27+
28+
sudo docker image ls
29+
30+
curl http://192.168.45.10

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-c constraints.txt
2+
testinfra
3+
pytest
4+
codecov

scripts/deploy-boxes.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
set -o errexit
3+
set -o pipefail
4+
set -o nounset
5+
set -o xtrace
6+
# set -eox pipefail #safety for script
7+
8+
echo "========================================================================================="
9+
vagrant plugin install vagrant-libvirt #The vagrant-libvirt plugin is required when using KVM on Linux
10+
vagrant plugin install vagrant-mutate #Convert vagrant boxes to work with different providers
11+
12+
echo "========================================================================================="
13+
# #https://github.com/chef/bento/tree/master/packer_templates/centos
14+
# vagrant box add "bento/centos-7.8" --provider=virtualbox
15+
# vagrant mutate "bento/centos-7.8" libvirt
16+
# vagrant up --provider=libvirt "vg-controller-82"
17+
18+
# Ansible provision OK
19+
#https://github.com/chef/bento/tree/master/packer_templates/centos
20+
# vagrant box add "bento/centos-8.2" --provider=virtualbox
21+
# vagrant mutate "bento/centos-8.2" libvirt
22+
# vagrant up --provider=libvirt "vg-controller-83"
23+
24+
#No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
25+
#https://github.com/chef/bento/tree/master/packer_templates/centos
26+
# vagrant box add "bento/fedora-32" --provider=virtualbox
27+
# vagrant mutate "bento/fedora-32" libvirt
28+
# vagrant up --provider=libvirt "vg-controller-84"
29+
30+
# Ansible provision OK
31+
# https://app.vagrantup.com/centos/boxes/8
32+
# vagrant box add "centos/8" --provider=libvirt
33+
# vagrant up --provider=libvirt "vg-controller-85"
34+
35+
#vg-controller-86: /tmp/vagrant-shell: line 8: 3409 Killed dnf -y update
36+
# https://app.vagrantup.com/fedora/boxes/32-cloud-base
37+
# vagrant box add "fedora/32-cloud-base" --provider=libvirt
38+
# vagrant up --provider=libvirt "vg-controller-86"
39+
40+
vagrant box add "bento/debian-10.4" --provider=virtualbox
41+
vagrant mutate "bento/debian-10.4" libvirt
42+
vagrant up --provider=libvirt "vg-controller-87"
43+
44+
vagrant box list #veridy installed boxes
45+
vagrant status #Check the status of the VMs to see that none of them have been created yet
46+
vagrant status
47+
virsh list --all #show all running KVM/libvirt VMs

scripts/deploy-libvirt.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -o errexit
3+
set -o pipefail
4+
set -o nounset
5+
set -o xtrace
6+
# set -eox pipefail #safety for script
7+
8+
echo "=============================Install kvm qemu libvirt============================================================="
9+
apt-get -qq update
10+
apt-get install -y cpu-checker bridge-utils dnsmasq-base ebtables libvirt-bin libvirt-dev qemu-kvm qemu-utils ruby-dev
11+
systemctl status libvirtd
12+
libvirtd --version
13+
egrep -c '(vmx|svm)' /proc/cpuinfo #If 0 it means that your CPU doesn't support hardware virtualization.If 1 or more it does - but you still need to make sure that virtualization is enabled in the BIOS.
14+
addgroup libvirtd
15+
adduser $(id -un) libvirtd #ensure that your username is added to the group libvirtd
16+
kvm-ok

scripts/deploy-terraform.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
set -o errexit
3+
set -o pipefail
4+
set -o nounset
5+
set -o xtrace
6+
# set -eox pipefail #safety for script
7+
8+
echo "========================================================================================="
9+
vagrant plugin install vagrant-libvirt #The vagrant-libvirt plugin is required when using KVM on Linux
10+
vagrant plugin install vagrant-mutate #Convert vagrant boxes to work with different providers
11+
12+
echo "========================================================================================="
13+
# #https://github.com/chef/bento/tree/master/packer_templates/centos
14+
# vagrant box add "bento/centos-7.8" --provider=virtualbox
15+
# vagrant mutate "bento/centos-7.8" libvirt
16+
# vagrant up --provider=libvirt "vg-controller-82"
17+
18+
# Ansible provision OK
19+
#https://github.com/chef/bento/tree/master/packer_templates/centos
20+
# vagrant box add "bento/centos-8.2" --provider=virtualbox
21+
# vagrant mutate "bento/centos-8.2" libvirt
22+
# vagrant up --provider=libvirt "vg-controller-83"
23+
24+
#No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
25+
#https://github.com/chef/bento/tree/master/packer_templates/centos
26+
# vagrant box add "bento/fedora-32" --provider=virtualbox
27+
# vagrant mutate "bento/fedora-32" libvirt
28+
# vagrant up --provider=libvirt "vg-controller-84"
29+
30+
# Ansible provision OK
31+
# https://app.vagrantup.com/centos/boxes/8
32+
# vagrant box add "centos/8" --provider=libvirt
33+
# vagrant up --provider=libvirt "vg-controller-85"
34+
35+
#vg-controller-86: /tmp/vagrant-shell: line 8: 3409 Killed dnf -y update
36+
# https://app.vagrantup.com/fedora/boxes/32-cloud-base
37+
# vagrant box add "fedora/32-cloud-base" --provider=libvirt
38+
# vagrant up --provider=libvirt "vg-controller-86"
39+
40+
# vagrant box add "bento/debian-10.4" --provider=virtualbox
41+
# vagrant mutate "bento/debian-10.4" libvirt
42+
# vagrant up --provider=libvirt "vg-controller-87"
43+
44+
45+
# https://github.com/chef/bento/tree/master/packer_templates/ubuntu
46+
vagrant box add "bento/ubuntu-19.10" --provider=libvirt
47+
vagrant mutate "bento/ubuntu-19.10" libvirt
48+
vagrant init --template Vagrantfile.terraform.erb
49+
vagrant up --provider=libvirt
50+
51+
# https://github.com/chef/bento/tree/master/packer_templates/ubuntu
52+
# vagrant box add "bento/ubuntu-19.10" --provider=virtualbox
53+
# vagrant mutate "bento/ubuntu-19.10" libvirt
54+
# vagrant init --template Vagrantfile.provision.bash.ubuntu.erb
55+
# # must be created in project root directory with Vagrantfile template file
56+
# vagrant up --provider=libvirt "kuma-control-plane"
57+
58+
# https://github.com/chef/bento/tree/master/packer_templates/ubuntu
59+
# vagrant box add "bento/ubuntu-20.04" --provider=virtualbox
60+
# vagrant mutate "bento/ubuntu-20.04" libvirt
61+
# vagrant init --template Vagrantfile.provision.bash.ubuntu.erb
62+
# # must be created in project root directory with Vagrantfile template file
63+
# vagrant up --provider=libvirt "kuma-control-plane"
64+
# vagrant up --provider=libvirt "redis"
65+
66+
vagrant box list #veridy installed boxes
67+
vagrant status #Check the status of the VMs to see that none of them have been created yet
68+
vagrant status
69+
virsh list --all #show all running KVM/libvirt VMs

0 commit comments

Comments
 (0)