Skip to content

Commit

Permalink
Create init.pp
Browse files Browse the repository at this point in the history
  • Loading branch information
SoundGoof authored Nov 23, 2024
1 parent 2e9c531 commit a025831
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions modules/speedtest2/manifest/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2024 dhtech
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file
#
# == Class: speedtest
#
# This class manages the speedtest
#
#
# === Parameters
#

class speedtest2 {

$nginx_dir = '/etc/nginx'
$sites_dir = "${nginx_dir}/sites-enabled"
$rc_name = 'nginx'
$www_root = '/var/www/html'

package { 'nginx':
ensure => installed,
}

file { '/etc/nginx/sites-enabled/default':
ensure =>absent,
force =>true,
notify =>Service['nginx'],
require =>Package['nginx'],
}

file { 'speedtest2-conf':
ensure => file,
path => "${sites_dir}/speedtest",
content => template('speedtest2/speedtest.conf.erb'),
notify => Service['nginx'],
require => Package['nginx'],
}

service { 'nginx':
ensure => 'running',
name => $rc_name,
enable => true,
require => Package['nginx'],
}
}

0 comments on commit a025831

Please sign in to comment.