Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fulcrum demo #642

Draft
wants to merge 112 commits into
base: production
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
1e97517
try updating jdk and tomcat
antmoth Aug 25, 2023
95825aa
fix demo-fedora name
antmoth Aug 25, 2023
9fbebf8
fix demofedora name again?
antmoth Aug 25, 2023
6f75bbc
try disabling ssl for mysql
antmoth Aug 25, 2023
0a9982a
reference demomysql in demofedora
antmoth Aug 25, 2023
4324c5b
set password for demomysql?
antmoth Aug 25, 2023
3b803a9
use override_options for demomysql
antmoth Aug 25, 2023
4f7287d
fix override options hash syntax
antmoth Aug 25, 2023
3c489d2
remove ssl-mode from demomysql
antmoth Aug 25, 2023
78d816f
ensure that the parent directory of the webroot also exists
antmoth Aug 31, 2023
fa03380
ensure solr bin dir exists
antmoth Aug 31, 2023
65aede8
try setting JAVA_HOME?
antmoth Aug 31, 2023
83d1e84
Add JAVA_HOME to solr service env vars
antmoth Aug 31, 2023
768c189
Update openjdk to adoptium/temurin, the maintained replacement
antmoth Sep 1, 2023
ddbf3b9
undo solr java 11 env var
antmoth Sep 1, 2023
51feb42
change skip-ssl mysqld option to ssl-disable
antmoth Sep 5, 2023
6edfea5
change mysql override_options to just options
antmoth Sep 5, 2023
fd5d7db
try to secure mysql?
antmoth Sep 11, 2023
fc7ed5c
simplify fulcrum profile
antmoth Sep 11, 2023
55c3d6f
there's already something aliasing mysql-client to mariadb-client
antmoth Sep 11, 2023
914ba70
trying to get puppet to complete
antmoth Sep 13, 2023
884ede0
just remove all of the fulcrum reqs for now
antmoth Sep 13, 2023
de18911
adding back in fulcrum base
antmoth Sep 13, 2023
d4bd610
add back in fulcrum hosts + app
antmoth Sep 13, 2023
17a7a52
add fulcrum::logrotate back in
antmoth Sep 13, 2023
15af84a
add fulcrum::nginx back in
antmoth Sep 13, 2023
58f586b
add back everything in fulcrum::standalone except mysql and fedora
antmoth Sep 13, 2023
bad4ebd
solr needs to use temurin jre
antmoth Sep 13, 2023
b0fb327
nginx is failing
antmoth Sep 13, 2023
7fa6814
also comment out shib
antmoth Sep 14, 2023
c97f88d
also comment out solr
antmoth Sep 14, 2023
6ee345f
add nginx back into the mix
antmoth Sep 14, 2023
abde34e
try pulling in some apache stuff from fulcrum_www_and_app
antmoth Sep 14, 2023
ff70e47
do i need to remove the nginx profile file as well?
antmoth Sep 14, 2023
2761645
add .tool-versions to gitignore
antmoth Sep 18, 2023
7dd7e43
comment out most of the apache stuff
antmoth Sep 18, 2023
5a7729c
update www_lib to use temurin jdk
antmoth Sep 18, 2023
a4a219c
add apache fulcrum profile
antmoth Sep 18, 2023
f663f79
shibboleth?
antmoth Sep 18, 2023
457cb22
odbc-mariadb => mariadb-unixodbc
antmoth Sep 18, 2023
75484cb
take out apache shib config; add back solr
antmoth Sep 18, 2023
81c4e5e
try adding back in mysql
antmoth Sep 18, 2023
ab10245
remove mysql securing command thingy
antmoth Sep 18, 2023
a8b389c
simplify mysql setup
antmoth Sep 20, 2023
f5e0792
finish setting up mysql service
antmoth Sep 20, 2023
d210663
does it need mysql-named packages instead of mariadb for some reason?
antmoth Sep 20, 2023
c0a47a9
still bashing at mysql
antmoth Sep 21, 2023
a80a33f
strip fulcrum standalone role back down to minimum for re-creating
antmoth Sep 21, 2023
aa69adc
update .ruby-version to 2.7
antmoth Sep 21, 2023
064259b
add things back in to standalone role
antmoth Sep 28, 2023
f5c783a
add www lib perl
antmoth Sep 28, 2023
39bab6e
add in some apache stuff
antmoth Sep 28, 2023
08ca24b
add rest of apache stuff
antmoth Sep 28, 2023
2609ee6
take out shib stuff
antmoth Sep 28, 2023
3ed416e
add back in solr
antmoth Sep 28, 2023
01b9724
mysql...
antmoth Sep 28, 2023
5a9a30f
require mariadb-server instead of mysql-server
antmoth Sep 28, 2023
0cf827d
fix my.cnf?
antmoth Sep 28, 2023
8ae795f
etc my.cnf source is a filepath
antmoth Sep 28, 2023
f12cd9b
don't need to do anything to my.cnf probably
antmoth Sep 29, 2023
c20c9b0
we do need some kind of mysql.cnf?
antmoth Sep 29, 2023
560e164
only need one my.cnf maybe
antmoth Sep 29, 2023
46be62b
temporarily comment out mysql again
antmoth Sep 29, 2023
04a6a30
put mysql back
antmoth Sep 29, 2023
7ea986a
ensure /etc/mysql/conf.d
antmoth Sep 29, 2023
fce4fb0
note about needing to install_db
antmoth Sep 29, 2023
202c4bd
experimental mysqldb function
antmoth Sep 29, 2023
ba6ba0d
try function syntax
antmoth Sep 29, 2023
4b8a93e
try a lambda
antmoth Sep 29, 2023
cd2f317
exec name problems
antmoth Sep 29, 2023
8fa6233
fix my iterable data
antmoth Sep 29, 2023
c98cee1
tyop
antmoth Sep 29, 2023
f952039
add the other three mysql dbs
antmoth Sep 29, 2023
ff80819
add shib back?
antmoth Sep 29, 2023
90619d9
fix shib pkg names
antmoth Sep 29, 2023
aa67458
missed one
antmoth Sep 29, 2023
8f8c887
add shib thing from apache profile?
antmoth Sep 29, 2023
4f55501
remove duplicate decaration
antmoth Sep 29, 2023
f558f59
shib?
antmoth Sep 29, 2023
d538058
add fedora back in
antmoth Sep 29, 2023
c6d1a49
fedora profile is depending on mysql::db resources... deal w/ it later
antmoth Sep 29, 2023
a56f45f
Add fedora back in
antmoth Oct 25, 2023
22f6344
require Service mysqld instead of nonexistent Mysql resource
antmoth Oct 25, 2023
4a0f1b2
s/tomcat8/tomcat9
antmoth Oct 25, 2023
11bacc6
debugging tomcat
antmoth Oct 27, 2023
d317de2
Revert "debugging tomcat"
antmoth Oct 27, 2023
3de3e09
Revert "Revert "debugging tomcat""
antmoth Oct 27, 2023
c37e250
qualify echo path
antmoth Oct 27, 2023
78109ed
test for paradox
antmoth Oct 27, 2023
0db6bd6
put tomcat create command back
antmoth Oct 27, 2023
ce0f6e7
fulcrum user may not have permissions to run tomcat create
antmoth Nov 10, 2023
86649ff
remove redundant ensure
antmoth Nov 10, 2023
5e2bbde
force symlinking of /opt/fedora/logs
antmoth Nov 10, 2023
3b8cfb0
update Fedora version
antmoth Nov 30, 2023
c878ceb
add capacity to handle symlinks to fulcrum::mounts
antmoth Dec 6, 2023
fd59a97
set up mounts and symlinks for fulcrum standalone
antmoth Dec 8, 2023
84c4f93
change name of symlinks config to `config`
antmoth Dec 8, 2023
23dbc09
try adding print debugging to symlinks
antmoth Dec 8, 2023
064bf9f
remove print debugging from symlinks
antmoth Dec 8, 2023
5e1ca31
fulcrum::nginx profile mysteriously disappeared in the merge???
antmoth Dec 11, 2023
6b10789
recursively chown /opt/fedora to fulcrum:fulcrum
antmoth Dec 15, 2023
aba2086
qualify chown
antmoth Dec 15, 2023
2c53d82
change /etc/environment to use solr's JAVA_HOME
antmoth Dec 18, 2023
ed2e2b0
?? java alternative??
antmoth Dec 19, 2023
af14944
add JAVA_HOME to fedora.env
antmoth Dec 19, 2023
448228b
tidy up fulcrum-demo mysql dbs and hosts
antmoth Aug 22, 2024
f08e8f4
specify user for fulcrum mysql dbs
antmoth Sep 20, 2024
51664f4
actual code change for prev commit
antmoth Sep 20, 2024
c894fde
remove merge conflict marker from .gitignore
antmoth Oct 2, 2024
101ceda
pull standalone fulcrum perl into its own file
antmoth Oct 2, 2024
e4d09f0
fix solr tests
antmoth Oct 9, 2024
098e1dc
add fulcrum mysql root_password to fixture data
antmoth Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
.DS_Store
/modules/
Puppetfile.lock
.tool-versions
2 changes: 1 addition & 1 deletion manifests/profile/fulcrum/app.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'libreoffice',
'libjemalloc2',
'netpbm-sf',
"openjdk-${jdk_version}-jre-headless",
"temurin-${jdk_version}-jre",
'pdftk',
'qpdf',
'shared-mime-info',
Expand Down
36 changes: 23 additions & 13 deletions manifests/profile/fulcrum/fedora.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,56 @@
String $fedora_username = 'fedora',
String $fedora_password = lookup('nebula::profile::fulcrum::mysql::fedora_password'),
) {
$jdk_version = lookup('nebula::jdk_version')
# used in erb file
$java_home = "/usr/lib/jvm/temurin-${jdk_version}-jre-amd64"

ensure_packages([
'tomcat8-user',
'tomcat9-user',
])

file { '/etc/sudoers.d/fedora':
content => template('nebula/profile/fulcrum/sudoers-fedora.erb'),
}

exec { 'create fedora tomcat':
command => '/usr/bin/tomcat9-instance-create fedora',
cwd => '/opt',
creates => '/opt/fedora',
require => [
User['fulcrum'],
Package['tomcat9-user'],
],
}

file {
['/var/lib/fedora', '/var/log/fedora', '/opt/fedora', '/tmp/fedora']:
ensure => directory,
owner => 'fulcrum',
group => 'fulcrum',
require => Exec['create fedora tomcat'],
;
}

exec { 'create fedora tomcat':
command => '/usr/bin/tomcat8-instance-create fedora',
cwd => '/opt',
user => 'fulcrum',
creates => '/opt/fedora',
require => [
User['fulcrum'],
Package['tomcat8-user'],
],
exec { 'chown -r /opt/fedora':
command => '/usr/bin/chown -R fulcrum:fulcrum /opt/fedora',
require => Exec['create fedora tomcat'],
}

file { '/opt/fedora/logs':
ensure => 'symlink',
owner => 'fulcrum',
group => 'fulcrum',
force => true,
target => '/var/log/fedora',
require => Exec['create fedora tomcat'],
}

archive { '/opt/fedora/webapps/fedora.war':
ensure => present,
extract => false,
source => 'https://github.com/fcrepo/fcrepo/releases/download/fcrepo-4.7.4/fcrepo-webapp-4.7.4.war',
checksum => '11e06c843f40cf2b9f26bda94ddfe6d85d69a591',
source => 'https://github.com/fcrepo/fcrepo/releases/download/fcrepo-4.7.6/fcrepo-webapp-4.7.6.war',
checksum => '5882d8a4dc8b3817374503dff2043be79d9bbd72',
checksum_type => 'sha1',
cleanup => false,
user => 'fulcrum',
Expand Down Expand Up @@ -81,7 +91,7 @@
File['/etc/systemd/system/fedora.service'],
File['/var/lib/fedora'],
Archive['/opt/fedora/webapps/fedora.war'],
Mysql::Db['fedora'],
Service['mysqld'],
],
}
}
5 changes: 5 additions & 0 deletions manifests/profile/fulcrum/hosts.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class nebula::profile::fulcrum::hosts (
$fedora = '127.0.0.1',
$mysql = '127.0.0.1',
$keycard = '127.0.0.1',
$redis = '127.0.0.1',
$solr = '127.0.0.1',
) {
Expand All @@ -17,6 +18,10 @@
ip => $mysql,
}

host { 'keycard':
ip => $keycard,
}

host { 'redis':
ip => $redis,
}
Expand Down
55 changes: 37 additions & 18 deletions manifests/profile/fulcrum/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,51 @@
class nebula::profile::fulcrum::mysql (
String $fedora_password,
String $fulcrum_password,
String $checkpoint_password,
String $shibd_password,
String $root_password,
) {
include nebula::profile::mysql

mysql::db { 'fedora':
user => 'fedora',
password => $fedora_password,
host => 'localhost',
# Install and configure mysql server
ensure_packages(['mariadb-common','mariadb-server', 'mariadb-client'])

# at some point need to do equivalent to `mysql_install_db --user=mysql --ldata=/var/lib/mysql`

service { 'mysqld':
enable => true,
ensure => running,
require => Package['mariadb-server'],
}

file { "/etc/mysql/conf.d":
ensure => "directory"
}

mysql::db { 'fulcrum':
user => 'fulcrum',
password => $fulcrum_password,
host => 'localhost',
file { "/etc/mysql/my.cnf":
owner => "mysql", group => "mysql",
content => template('nebula/mysql/my.cnf.erb'),
notify => Service["mysqld"],
require => Package["mariadb-server"],
}

mysql::db { 'checkpoint':
user => 'checkpoint',
password => $checkpoint_password,
host => 'localhost',
exec { "set-mysql-password":
unless => "mysqladmin -uroot -p$root_password status",
path => ["/bin", "/usr/bin"],
command => "mysqladmin -uroot password $root_password",
require => Service["mysqld"],
}

mysql::db { 'shibd':
user => 'shibd',
password => $shibd_password,
host => 'localhost',
$dbs = [['fedora', 'fedora', $fedora_password], ['fulcrum', 'fulcrum', $fulcrum_password],
['checkpoint', 'fulcrum', $fulcrum_password], ['shibd', 'shibd', $shibd_password]]

$dbs.each |$db| {
$name = $db[0]
$user = $db[1]
$password = $db[2]
exec { "create-${name}-db":
unless => "/usr/bin/mysql -u${user} -p${password} ${name}",
command => "/usr/bin/mysql -uroot -p${root_password} -e \"create database ${name}; grant all on ${name}.* to ${user}@localhost identified by '${password}';\"",
require => Service["mysqld"],
}
}

}
2 changes: 1 addition & 1 deletion manifests/profile/fulcrum/nginx.pp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,6 @@
proto => 'tcp',
dport => 443,
state => 'NEW',
jump => 'accept',
action => 'accept',
}
}
37 changes: 37 additions & 0 deletions manifests/profile/fulcrum/perl.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# The perl profile is needed for monitor_pl to work, but it pulls in a
# ton of stuff. We should probably allow for different haproxy http checks
# for a service, and eliminate the perl/monitor_pl dependency here.

class nebula::profile::fulcrum::perl (
Hash $hosts = {}
) {

include nebula::profile::www_lib::perl

create_resources('host',$hosts)

include nebula::profile::www_lib::apache::base
include nebula::profile::www_lib::apache::fulcrum

cron {
default:
user => 'root',
;

'purge apache access logs 1/2':
hour => 1,
minute => 7,
command => '/usr/bin/find /var/log/apache2 -type f -mtime +14 -name "*log*" -exec /bin/rm {} \; > /dev/null 2>&1',
;

'purge apache access logs 2/2':
hour => 1,
minute => 17,
command => '/usr/bin/find /var/log/apache2 -type f -mtime +2 -name "*log*" ! -name "*log*gz" -exec /usr/bin/pigz {} \; > /dev/null 2>&1',
require => Package['pigz'],
;
}

ensure_packages(['pigz'])

}
6 changes: 3 additions & 3 deletions manifests/profile/fulcrum/shibboleth.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class nebula::profile::fulcrum::shibboleth {
ensure_packages([
'unixodbc',
'shibboleth-sp2-common',
'shibboleth-sp2-utils',
'shibboleth-sp-common',
'shibboleth-sp-utils',
'mariadb-unixodbc',
])

Expand Down Expand Up @@ -52,7 +52,7 @@
ensure => 'running',
enable => true,
hasrestart => true,
require => [Package['shibboleth-sp2-utils'], Package['mariadb-unixodbc']]
require => [Package['shibboleth-sp-utils'], Package['mariadb-unixodbc']]
}

service { 'shibauthorizer.socket':
Expand Down
4 changes: 2 additions & 2 deletions manifests/profile/shibboleth.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
[
'shibboleth-sp-common',
'shibboleth-sp-utils',
'odbc-mariadb'
'mariadb-unixodbc'
]:
}

Expand All @@ -50,7 +50,7 @@
ensure => 'running',
enable => true,
hasrestart => true,
require => [Package['shibboleth-sp-utils'], Package['odbc-mariadb']]
require => [Package['shibboleth-sp-utils'], Package['mariadb-unixodbc']]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double check package name

}

file { '/etc/odbcinst.ini':
Expand Down
16 changes: 14 additions & 2 deletions manifests/profile/solr.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
) {
$jdk_version = lookup('nebula::jdk_version')

ensure_packages(["openjdk-${jdk_version}-jre-headless",'solr','lsof'])
ensure_packages(["temurin-${jdk_version}-jre",'solr','lsof'])

class { 'nebula::profile::openjdk_java':
jdk_packages => ["temurin-${jdk_version}-jre"],
default_jdk => "temurin-${jdk_version}-jre",
base_alternative => "/usr/lib/jvm/temurin-${jdk_version}-jre-amd64/bin/java",
java_alternative => "temurin-${jdk_version}-jre-amd64",
}

# Note: Along with variables above these are used in erb files also.
$java_home = "/usr/lib/jvm/java-${jdk_version}-openjdk-amd64/jre"
$java_home = "/usr/lib/jvm/temurin-${jdk_version}-jre-amd64"
$solr_bin = '/opt/solr/bin/solr'

nebula::usergroup { 'solr': }
Expand Down Expand Up @@ -53,6 +60,11 @@
;
}

file { "/etc/environment":
content => inline_template("JAVA_HOME=${java_home}")
}


file { '/etc/systemd/system/solr.service':
owner => 'root',
group => 'root',
Expand Down
2 changes: 1 addition & 1 deletion manifests/profile/www_lib/dependencies.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'git',
'emacs',
'imagemagick',
"openjdk-${jdk_version}-jre",
"temurin-${jdk_version}-jre",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to make this safe to merge and then "switch" www_lib to new package setup.

]
)

Expand Down
12 changes: 9 additions & 3 deletions manifests/role/fulcrum/standalone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
# This is desiged to manage a Debian Server that hosts the Fulcrum project, with all of the dependencies and services included.

class nebula::role::fulcrum::standalone {

include nebula::role::minimum
include nebula::profile::ruby
include nebula::profile::fulcrum::base
include nebula::profile::fulcrum::hosts
include nebula::profile::fulcrum::mounts
include nebula::profile::fulcrum::symlinks
include nebula::profile::fulcrum::app
include nebula::profile::fulcrum::fedora
include nebula::profile::fulcrum::logrotate
include nebula::profile::fulcrum::mysql
include nebula::profile::fulcrum::redis
include nebula::profile::fulcrum::shibboleth
include nebula::profile::fulcrum::perl

include nebula::profile::fulcrum::solr
include nebula::profile::fulcrum::mysql

include nebula::profile::fulcrum::shibboleth
include nebula::profile::fulcrum::fedora
}
2 changes: 1 addition & 1 deletion spec/classes/profile/solr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Packages
[
'openjdk-8-jre-headless',
'temurin-11-jre',
'solr',
'lsof',
].each do |package|
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/hiera/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ umich::networks::private_blocks:
nebula::profile::falcon::cid: default-invalid-cid
nebula::profile::tsm::servername: tsmserver
nebula::profile::tsm::serveraddress: tsm.default.invalid
nebula::jdk_version: '8'
nebula::jdk_version: '11'

nebula::profile::kubelet::kubelet_version: default.invalid

Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/hiera/fulcrum.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
nebula::profile::mysql::password: changeme
nebula::profile::fulcrum::mysql::root_password: changeme
nebula::profile::fulcrum::mysql::fedora_password: changeme
nebula::profile::fulcrum::mysql::fulcrum_password: changeme
nebula::profile::fulcrum::mysql::checkpoint_password: changeme
Expand Down
30 changes: 30 additions & 0 deletions templates/mysql/my.cnf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

1 change: 1 addition & 0 deletions templates/profile/fulcrum/fedora.env.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CATALINA_BASE="/opt/fedora"
JAVA_HOME="<%= @java_home %>"
JAVA_OPTS="-Djava.awt.headless=true \
-Djava.io.tmpdir=/tmp/fedora \
-Xmx8g \
Expand Down
Loading
Loading