Last active
January 2, 2024 23:28
-
-
Save tlehman/ffde3cba30ca41343445754ae829cb87 to your computer and use it in GitHub Desktop.
Introduction to Puppet Part 1 Manifest
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
# introduced in https://tlehman.blog/p/introduction-to-puppet | |
# refined in https://tlehman.blog/p/introduction-to-puppet-part-2 | |
node default { | |
# Ensure the required packages are installed | |
package { ['nginx', 'ruby', 'ruby-railties']: | |
ensure => installed, | |
} | |
# Configure Nginx to listen on port 80 and proxy to port 3000 | |
file { '/etc/nginx/sites-available/default': | |
ensure => file, | |
content => template('modulename/nginx.conf.erb'), | |
require => Package['nginx'], | |
notify => Service['nginx'], | |
} | |
# Ensure Nginx service is running and enabled | |
service { 'nginx': | |
ensure => running, | |
enable => true, | |
} | |
# Define a systemd service for the Rails app | |
file { '/etc/systemd/system/railsapp.service': | |
ensure => file, | |
content => template('modulename/railsapp.service.erb'), | |
notify => Service['railsapp'], | |
} | |
# Ensure the Rails app service is running and enabled | |
service { 'railsapp': | |
ensure => running, | |
enable => true, | |
require => File['/etc/systemd/system/railsapp.service'], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment