This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@vagrant ~] ./VMware-ovftool-4.2.0-5965791-lin.x86_64.bundle --eulas-agreed --required --console | |
Extracting VMware Installer...done. | |
Installing VMware OVF Tool component for Linux 4.2.0 | |
Configuring... | |
[######################################################################] 100% | |
Installation was successful. | |
[root@vagrant ~] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:centos7 | |
MAINTAINER Stan Dorsett <[email protected]> | |
# install curl from source with openssl support | |
RUN cd /tmp/ && \ | |
yum install openssl openssl-devel -y && \ | |
yum groupinstall "Development Tools" -y && \ | |
curl -sSL -o curl-7.55.1.tar.gz https://curl.haxx.se/download/curl-7.55.1.tar.gz && \ | |
tar -zxvf curl-7.55.1.tar.gz && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure('2') do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
config.vm.define :'centos7-powercli' do |m| | |
m.vm.box = 'standorsett/centos-7' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are some resources you should check out if you are learning / new to Go: | |
First you should take the language tour: http://tour.golang.org/ | |
Then, you should visit: | |
https://golang.org/doc/code.html to learn how to organize your Go workspace | |
https://golang.org/doc/effective_go.html be more effective at writing Go | |
https://golang.org/ref/spec learn more about the language itself | |
https://golang.org/doc/#articles a lot more reading material | |
There are some awesome websites as well: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant box add bento/centos-7.3 | |
ls ~/.vagrant.d/boxes/bento-VAGRANTSLASH-centos-7.3/2.3.5/vmware_desktop/*.vmx | |
mkdir ~/.vagrant.d/boxes/bento-VAGRANTSLASH-centos-7.3/2.3.5/vmware_ovf/ | |
ovftool -tt=ovf /root/.vagrant.d/boxes/bento-VAGRANTSLASH-centos-7.3/2.3.5/vmware_desktop/centos-7.3-x86_64.vmx ~/.vagrant.d/boxes/bento-VAGRANTSLASH-centos-7.3/2.3.5/vmware_ovf/centos-7.3-x86_64.ovf | |
echo '{"provider":"vmware_ovf"}' >> ~/.vagrant.d/boxes/bento-VAGRANTSLASH-centos-7.3/2.3.5/vmware_ovf/metadata.json | |
touch ~/.vagrant.d/boxes/bento-VAGRANTSLASH-centos-7.3/2.3.5/vmware_ovf/Vagrantfile | |
cd ~/.vagrant.d/boxes/bento-VAGRANTSLASH-centos-7.3/2.3.5/vmware_ovf/ | |
tar cvzf /root/centos-7.3-vmware_ovf-1.0.box ./* | |
vagrant box add ~/centos-7.3-vmware_ovf-1.0.box --name centos-7.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rbvmomi'; | |
credentials = { :host => "192.168.1.10", :user => "[email protected]", :password => "vmware", :insecure => true }; | |
vim = RbVmomi::VIM.connect(credentials); | |
datacenters = {}; | |
vim.rootFolder.childEntity.each { |datacenter| | |
datacenter_info = {} | |
datacenter.hostFolder.childEntity.each { |cluster| | |
cluster_info = {} | |
cluster.host.each { |host| | |
host_info = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rbvmomi' | |
credentials = { :host => "192.168.1.10", :user => "[email protected]", :password => "vmware", :insecure => true } | |
vim = RbVmomi::VIM.connect(credentials) | |
datacenter = vim.rootFolder.childEntity.first # grab the first datacenter | |
datacenter.hostFolder.childEntity # this will return an array of all the clusters in the datacenter | |
cluster = datacenter.hostFolder.childEntity.first # grab the first cluster from the datacenter | |
cluster.host # this will return an array of all the ESXi hosts in the first cluster | |
host = cluster.host.first # grab the first host in the cluster | |
host.config.network.vnic # display all the vnics on the host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this script can be scheduled to run daily at midnight by adding a cron job like the following: | |
# 0 0 * * * /root/docker_cleanup.sh | |
# | |
docker rm -v $(docker ps -a -q -f status=exited) | logger -t "docker_cleanup.sh" | |
docker rmi $(docker images -f "dangling=true" -q) | logger -t "docker_cleanup.sh" | |
docker volume rm $(docker volume ls -qf dangling=true) | logger -t "docker_cleanup.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rbvmomi' | |
hostname = '192.168.1.200'; | |
username = '[email protected]'; | |
password = 'P@ssword123'; | |
vim = RbVmomi::VIM.connect host: hostname, user: username, password: password, insecure: true; | |
rootFolder = vim.serviceInstance.content.rootFolder | |
viewManager = vim.serviceInstance.content.viewManager | |
viewManager.CreateContainerView( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSTALLATION | |
Copy jenkins-slave.init to /etc/init.d/jenkins-slave and copy jenkins-slave to /etc/sysconfig/jenkins-slave. | |
cp jenkins-slave.init /etc/init.d/jenkins-slave | |
cp jenkins-slave /etc/sysconfig/jenkins-slave | |
chkconfig jenkins-slave on | |
service jenkins-slave start | |
Change the values of /etc/sysconfig/jenkins-slave to match your environment needs. |