Skip to content

Instantly share code, notes, and snippets.

@jchodakowski
Created October 14, 2015 17:18
Show Gist options
  • Save jchodakowski/cc428a8717040fa9ec51 to your computer and use it in GitHub Desktop.
Save jchodakowski/cc428a8717040fa9ec51 to your computer and use it in GitHub Desktop.
mongo = service 'mongod' do
action [:enable, :stop]
end
bash 'back up stock mongod.conf' do
code <<-EOH
mv /etc/mongod.conf /etc/mongod.conf.orig
EOH
only_if { File.exist?('/etc/mongod.conf') }
end
template '/etc/mongod.conf' do
source 'mongod-bootstrap.conf.erb'
owner 'root'
group 'root'
mode 00644
end
bash 'clean the data path' do
code <<-EOH
rm -rf "#{node['foo']['mongodb']['datadir']}"/*
EOH
end
mongo = service 'mongod' do
action :start
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment