Created
June 22, 2017 21:55
-
-
Save wickedviking/a45c9add498f31527d79e9186b932dad 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
# the default recipe is implied if only the cookbook name is provided | |
# effectively `include_recipe "git_cookbook::default"` | |
include_recipe "git_cookbook" | |
# install the above `daemon_pkg` | |
package 'git' | |
# create our data directory | |
directory '/opt/git' | |
# setup the systemd unit (service) with the above `daemon_bin`, enable, and | |
# start it | |
systemd_unit 'git-daemon.service' do | |
content <<-EOU.gsub(/^\s+/, '') | |
[Unit] | |
Description=Git Repositories Server Daemon | |
Documentation=man:git-daemon(1) | |
[Service] | |
ExecStart=/usr/bin/git daemon \ | |
--reuseaddr \ | |
--base-path=/opt/git/ \ | |
/opt/git/ | |
[Install] | |
WantedBy=getty.target | |
DefaultInstance=tty1 | |
EOU | |
action [ :create, :enable, :start ] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment