Skip to content

Instantly share code, notes, and snippets.

@jacoyutorius
Last active July 19, 2021 10:49
Show Gist options
  • Select an option

  • Save jacoyutorius/27111852b13fe5a0d622 to your computer and use it in GitHub Desktop.

Select an option

Save jacoyutorius/27111852b13fe5a0d622 to your computer and use it in GitHub Desktop.
itamae recipe
=begin
itamaeについて
http://qiita.com/toritori0318/items/00ea2a75c8321aaf9ef6
ドキュメント
http://itamae.kitchen/docs.html#execute-resource
wiki
https://github.com/itamae-kitchen/itamae/wiki
=end
user = "me"
%w(mysql mysql-server httpd vim).each do |p|
package p do
action :install
end
end
user "#{user}" do
action :create
home "/home/#{user}"
password "#{user}"
username "#{user}"
end
group "#{user}" do
action :create
user "#{user}"
groupname "#{user}"
end
# usermod -G wheel #{user}
# grep ^wheel /etc/group
execute "usermod -G wheel #{user}" do
user "root"
cwd "/root"
command <<-EOH
usermod -G wheel #{user}
grep ^wheel /etc/group
EOH
end
directory "/home/foufier/work" do
action :create
owner "#{user}"
path "/home/#{user}/work"
end
execute "yum update" do
user "root"
cwd "/root"
command <<-EOH
yum -y remove yum-updatesd
yum -y install yum-fastestmirror yum-priorities yum-utils expect yum-cron
yum -y update
EOH
end
execute "add sl.repo" do
user "root"
cwd "/root"
command <<-EOH
echo [sl] >> /etc/yum.repos.d/sl.repo
echo priority=1>> /etc/yum.repos.d/sl.repo
echo [sl-security] >> /etc/yum.repos.d/sl.repo
echo priority=1 >> /etc/yum.repos.d/sl.repo
EOH
end
execute "git config" do
user "root"
cwd "/root"
command <<-EOH
git config --global user.name "#{user}"
git config --global user.email "#{user}@gmail.com"
EOH
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment