aboutsummaryrefslogtreecommitdiffstats
path: root/modules/planet
diff options
context:
space:
mode:
Diffstat (limited to 'modules/planet')
-rw-r--r--modules/planet/manifests/init.pp61
-rwxr-xr-xmodules/planet/templates/deploy_new-planet.sh5
-rw-r--r--modules/planet/templates/planet_vhosts.conf6
3 files changed, 37 insertions, 35 deletions
diff --git a/modules/planet/manifests/init.pp b/modules/planet/manifests/init.pp
index e5b127b7..8aacd5cc 100644
--- a/modules/planet/manifests/init.pp
+++ b/modules/planet/manifests/init.pp
@@ -1,56 +1,57 @@
class planet {
- user { "planet":
- groups => apache,
- comment => "Planet Mageia",
- home => "/var/lib/planet",
+ user { 'planet':
+ groups => 'apache',
+ comment => 'Planet Mageia',
+ home => '/var/lib/planet',
}
- $location = "/var/www/vhosts/planet.$domain"
- $vhost = "planet.$domain"
-
- include apache::mod_php
- include apache::mod_deflate
+ $vhost = "planet.${::domain}"
+ $location = "/var/www/vhosts/${vhost}"
- apache::vhost_base { "$vhost":
+ include apache::mod::php
+
+ apache::vhost::base { $vhost:
+ location => $location,
+ content => template('planet/planet_vhosts.conf')
+ }
+
+ apache::vhost::base { "ssl_${vhost}":
+ use_ssl => true,
+ vhost => $vhost,
location => $location,
- content => template('planet/planet_vhosts.conf')
+ content => template('planet/planet_vhosts.conf')
}
- local_script { "deploy_new-planet.sh":
- content => template("planet/deploy_new-planet.sh")
+ mga_common::local_script { 'deploy_new-planet.sh':
+ content => template('planet/deploy_new-planet.sh')
}
- file { "$location":
+ file { $location:
ensure => directory,
- owner => planet,
- group => apache,
}
- file { "$location/index.php":
- owner => planet,
- group => apache,
- mode => 755,
- content => template("planet/index.php")
+ file { "${location}/index.php":
+ content => template('planet/index.php')
}
- package { ['php-iconv']: }
+ package { ['php-iconv']: }
class files_backup inherits base {
- file { "/var/lib/planet/backup":
+ file { '/var/lib/planet/backup':
ensure => directory,
}
- local_script { "backup_planet-files.sh":
- content => template("blog/backup_planet-files.sh")
+ mga_common::local_script { 'backup_planet-files.sh':
+ content => template('blog/backup_planet-files.sh')
}
cron { "Backup files (planet)":
- user => root,
- hour => '23',
- minute => '42',
- command => "/usr/local/bin/backup_planet-files.sh",
- require => [File["backup_planet-files"]],
+ user => root,
+ hour => '23',
+ minute => '42',
+ command => '/usr/local/bin/backup_planet-files.sh',
+ require => [File['backup_planet-files']],
}
}
}
diff --git a/modules/planet/templates/deploy_new-planet.sh b/modules/planet/templates/deploy_new-planet.sh
index 605fa273..b3889d31 100755
--- a/modules/planet/templates/deploy_new-planet.sh
+++ b/modules/planet/templates/deploy_new-planet.sh
@@ -22,7 +22,8 @@ then
# Deploy new planet with locale given
/bin/mkdir $FILE
/bin/chown planet:apache $FILE
- /usr/bin/wget -O $PATH_TO_FILE"/moonmoon.tar.gz" http://damsweb.net/files/moonmoon_mageia.tar.gz
+ # TODO: this URL returns 403 (2024-01)
+ /usr/bin/wget -O $PATH_TO_FILE"/moonmoon.tar.gz" https://damsweb.net/files/moonmoon_mageia.tar.gz
if [ $? -ne 0 ]
then
echo "Aborted, can't download GZIP file"
@@ -32,7 +33,7 @@ then
/bin/mkdir $FILE"cache"
/bin/chown -R planet:apache $FILE
/bin/chmod g+w $FILE"custom" $FILE"custom/people.opml" $FILE"admin/inc/pwd.inc.php" $FILE"cache"
- echo -e "Info: a new Planet had been deployed.\nThe locale is: \"$locale\" - http://planet.<%= domain %>/$locale \n-- \nMail sent by the script '$0' on `hostname`" | /bin/mail -s "New planet Mageia deployed" mageia-webteam@<%= domain %> mageia-marketing@<%= domain %>
+ echo -e "Info: a new Planet had been deployed.\nThe locale is: \"$locale\" - https://planet.<%= domain %>/$locale \n-- \nMail sent by the script '$0' on `hostname`" | /bin/mail -s "New planet Mageia deployed" mageia-webteam@<%= domain %> mageia-marketing@<%= domain %>
fi
else
echo "Aborted, please try again."
diff --git a/modules/planet/templates/planet_vhosts.conf b/modules/planet/templates/planet_vhosts.conf
index 841e33cb..b3a07ab9 100644
--- a/modules/planet/templates/planet_vhosts.conf
+++ b/modules/planet/templates/planet_vhosts.conf
@@ -1,11 +1,11 @@
<Directory <%= location %> >
- Order deny,allow
+ Order deny,allow
Allow from All
AllowOverride All
- Options FollowSymlinks
+ Options FollowSymlinks
Options +Indexes
</Directory>
# Add a permanent redirection for '/*' as '/en/' for english planet
<IfModule mod_alias.c>
- RedirectMatch permanent ^/?$ /en/
+ RedirectMatch permanent ^/?$ /en/
</IfModule>