Skip to content

Commit 06fc5e8

Browse files
committed
Modernize the code with types and epp templates
1 parent cb1f316 commit 06fc5e8

File tree

18 files changed

+1042
-618
lines changed

18 files changed

+1042
-618
lines changed

manifests/config.pp

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,24 @@
8080
ensure => file,
8181
owner => $misp::default_user,
8282
group => $misp::default_group,
83-
content => template('misp/bootstrap.php.erb'),
83+
content => epp('misp/bootstrap.php.epp', { auth_method => $misp::security_auth_method }),
8484
subscribe => Exec['Directory permissions'],
8585
}
8686

8787
file { "${misp::config_dir}/core.php":
8888
ensure => file,
8989
owner => $misp::default_user,
9090
group => $misp::default_group,
91-
content => template('misp/core.php.erb'),
91+
content => epp('misp/core.php.epp', {
92+
level => $misp::security_level,
93+
salt => $misp::security_salt,
94+
cipher_seed => $misp::security_cipher_seed,
95+
auto_regenerate => $misp::session_auto_regenerate,
96+
check_agent => $misp::session_check_agent,
97+
defaults => $misp::session_defaults,
98+
timeout => $misp::session_timeout,
99+
cookie_timeout => $misp::session_cookie_timeout,
100+
}),
92101
subscribe => Exec['Directory permissions'],
93102
}
94103

@@ -97,7 +106,13 @@
97106
owner => $misp::default_user,
98107
group => $misp::default_group,
99108
mode => '0640',
100-
content => template('misp/database.php.erb'),
109+
content => epp('misp/database.php.epp', {
110+
host => $misp::db_host,
111+
user => $misp::db_user,
112+
port => $misp::db_port,
113+
password => $misp::db_password,
114+
db_name => $misp::db_name,
115+
}),
101116
subscribe => Exec['Directory permissions'],
102117
}
103118

@@ -106,7 +121,7 @@
106121
owner => $misp::default_user,
107122
group => $misp::default_group,
108123
mode => '0640',
109-
content => template('misp/config.php.erb'),
124+
content => epp('misp/config.php.epp', { context => Class[misp] }),
110125
seltype => 'httpd_sys_rw_content_t',
111126
subscribe => Exec['Directory permissions'],
112127
}

0 commit comments

Comments
 (0)