I expected the following to actually start my service:
service{'legacy':
ensure => running,
start => "cd /vagrant/nginx-reverse-proxy/legacy && /usr/bin/bundle exec ruby app.rb -o 127.0.0.1 -e production -p ${port}",
provider => 'systemd',
}
I know and undertand that the start command isn't correct, but I don't know how to start the actual Ruby Sinatra app. I actually expected something like this to work:
service{'legacy':
ensure => running,
command => "cd /vagrant/nginx-reverse-proxy/legacy && /usr/bin/bundle exec ruby app.rb -o 127.0.0.1 -e production -p ${port}",
provider => 'systemd',
}
Somewhat like cron. I'm used to daemontools, and systemd's model is completely different. Do I have to create the unit file myself? And link the unit file?
I've found How to enable systemd instantiated service with puppet? which starts some kind of USB device. I also found camptocamp/puppet-systemd which seems to manage systemd itself. Puppet's docs on systemd service provider are rather sparse in details.
How does one create a systemd service using Puppet?