Last active
August 29, 2015 14:05
-
-
Save jeqo/757c3877d3d527ca239c to your computer and use it in GitHub Desktop.
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 | |
pvcreate /dev/sdb | |
vgextend VolGroup /dev/sdb | |
lvextend /dev/VolGroup/lv_root /dev/sdb | |
resize2fs /dev/VolGroup/lv_root |
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/sh | |
# size of swapfile in megabytes | |
swapsize=4000 | |
# does the swap file already exist? | |
grep -q "swapfile" /etc/fstab | |
# if not then create it | |
if [ $? -ne 0 ]; then | |
echo 'swapfile not found. Adding swapfile.' | |
fallocate -l ${swapsize}M /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
echo '/swapfile none swap defaults 0 0' >> /etc/fstab | |
else | |
echo 'swapfile found. No changes made.' | |
fi | |
# output results to terminal | |
df -h | |
cat /proc/swaps | |
cat /proc/meminfo | grep Swap |
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
package "httpd" do | |
action :install | |
end | |
service "httpd" do | |
action [ :start, :enable ] | |
end |
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 : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
#Path to new hard disk file | |
file_to_disk = './disk.vdi' | |
config.vm.box = "base" | |
config.vm.hostname = "basemachine" | |
config.vm.box_url = "file://c:/boxes/oel65-64.box" | |
# Host-only network configuration | |
config.vm.network :private_network, ip: "192.168.56.20" | |
# Mount c:\data directory to /data directory on box | |
config.vm.synced_folder "/data" , "/data", :mount_options => ["dmode=777", "fmode=777"] | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "2048"] | |
vb.customize ["modifyvm", :id, "--name" , "basemachine"] | |
vb.customize ["modifyvm", :id, "--cpus" , 2] | |
vb.customize ["modifyvm", :id, "--chipset", "ich9"] | |
#Script to add a new disk and expand space on OS (root and swap) | |
if ARGV[0] == "up" && ! File.exist?(file_to_disk) | |
vb.customize [ | |
'createhd', | |
'--filename', file_to_disk, | |
'--format', 'VDI', | |
'--size', 100 * 1024 | |
] | |
vb.customize [ | |
'storageattach', :id, | |
'--storagectl', 'SATA Controller', | |
'--port', 1, '--device', 0, | |
'--type', 'hdd', '--medium', | |
file_to_disk | |
] | |
config.vm.provision "shell", path: "bootstrap.sh" | |
config.vm.provision "shell", path: "increase_swap.sh" | |
end | |
end | |
#Chef provisioning | |
config.vm.provision "chef_solo" do |chef| | |
chef.cookbooks_path = "../chef/cookbooks" | |
chef.add_recipe "http::install-httpd" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment