Last active
January 14, 2020 05:30
-
-
Save benridane/34a263f7a603e8257da5371304e125a0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/bash | |
if [ "$(. /etc/os-release; echo $NAME)" = "Ubuntu" ]; then | |
apt install updates | |
apt install wget -y | |
apt install git -y | |
apt install curl -y | |
apt install vim -y | |
else | |
yum update | |
yum install wget -y | |
yum install git -y | |
yum install curl -y | |
yum install vim -y | |
yum install epel-release -y | |
fi | |
cat - << 'EOS' > recipe.rb | |
%w[ | |
tree | |
htop | |
git | |
sysstat | |
dstat | |
nginx | |
gcc | |
vim | |
].each do |pkg| | |
package "#{pkg}" do | |
action :install | |
end | |
end | |
service "nginx" do | |
action [:start,:enable] | |
end | |
%w[ | |
vagrant | |
].each do |user| | |
user "#{user}" do | |
action :create | |
end | |
end | |
EOS | |
if [ -e "mitamae-x86_64-linux" ]; then | |
echo "found"; | |
else | |
wget https://github.com/itamae-kitchen/mitamae/releases/latest/download/mitamae-x86_64-linux.tar.gz \ | |
| tar xvz | |
chmod +x ./mitamae-x86_64-linux | |
fi | |
./mitamae-x86_64-linux local recipe.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment