Skip to content

Commit

Permalink
deploy fastly-purge scripts everywhere where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni authored and ekohl committed Nov 28, 2024
1 parent 099d011 commit d46dcb2
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 16 deletions.
File renamed without changes.
19 changes: 19 additions & 0 deletions puppet/modules/fastly_purge/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @summary scripts to manage fastly CDN purging
#
class fastly_purge {
file { '/usr/local/bin/fastly-purge':
ensure => file,
owner => 'root',
group => 'root',
mode => '0755',
content => file("${module_name}/fastly-purge.sh"),
}

file { '/usr/local/bin/fastly-purge-find':
ensure => file,
owner => 'root',
group => 'root',
mode => '0755',
content => file("${module_name}/fastly-purge-find.sh"),
}
}
2 changes: 2 additions & 0 deletions puppet/modules/jenkins_node/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
Boolean $unittests = $facts['os']['family'] == 'RedHat',
Boolean $packaging = true,
) {
include fastly_purge

if $facts['os']['family'] == 'RedHat' {
$java_package = 'java-11-openjdk-headless'

Expand Down
16 changes: 0 additions & 16 deletions puppet/modules/web/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,6 @@
source => 'puppet:///modules/web/filter_apache_stats.sh',
}

file { '/usr/local/bin/fastly-purge':
ensure => file,
owner => 'root',
group => 'root',
mode => '0755',
content => file('web/fastly-purge.sh'),
}

file { '/usr/local/bin/fastly-purge-find':
ensure => file,
owner => 'root',
group => 'root',
mode => '0755',
content => file('web/fastly-purge-find.sh'),
}

# daily at 4am, should be fairly quiet on the server
cron { 'filter_apache_stats':
command => '/usr/bin/nice -19 /usr/local/bin/filter_apache_stats',
Expand Down
2 changes: 2 additions & 0 deletions puppet/modules/web/manifests/vhost/deb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
String $user = 'freight',
Stdlib::Absolutepath $home = "/home/${user}",
) {
include fastly_purge

# Manual step: each user needs the GPG key in it's keyring
freight::user { 'main':
user => $user,
Expand Down
2 changes: 2 additions & 0 deletions puppet/modules/web/manifests/vhost/rpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
Stdlib::Absolutepath $rpm_staging_directory = '/var/www/vhosts/stagingrpm/htdocs/',
String $user = 'rpmrepo',
) {
include fastly_purge

$rpm_directory_config = [
{
path => $rpm_directory,
Expand Down
2 changes: 2 additions & 0 deletions puppet/modules/web/manifests/vhost/yum.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Stdlib::Absolutepath $yum_directory = '/var/www/vhosts/yum/htdocs',
String $user = 'yumrepo',
) {
include fastly_purge

$yum_directory_config = [
{
path => $yum_directory,
Expand Down

0 comments on commit d46dcb2

Please sign in to comment.