Skip to content

Instantly share code, notes, and snippets.

@eddiez9
Last active November 28, 2023 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddiez9/6877eeb86c01d1c695dbe75622180d4e to your computer and use it in GitHub Desktop.
Save eddiez9/6877eeb86c01d1c695dbe75622180d4e to your computer and use it in GitHub Desktop.
# MongoDB setup and confguration
class {'mongodb::globals':
version => '5.0.22',
manage_package_repo => true,
bind_ip => ['127.0.0.1'],
}
-> class {'mongodb::client':}
-> class {'mongodb::server':
auth => true,
create_admin => true,
admin_username => "admin",
admin_password => "password",
store_creds => true,
}
-> mongodb::db { 'graylog_mongodb':
user => 'graylog_mongo_user',
password => 'password',
roles => ['dbOwner'],
}
# Graylog setup and configuration
class { 'graylog::repository':
version => '5.1'
}
-> class { '::graylog::server':
config => {
is_leader => true,
password_secret => 'Vsu2Lqs4mI7nCKSNbFxQzAelXMin7QvaPHAsBACj-rAR7fa86BtBlR6p8g9Sh49M4w9Cjh3g8b8izLYyUWZNOQ5cF7ESt8iG',
root_username => 'admin',
root_password_sha2 => '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', #sha2 hash for password
http_bind_address => '0.0.0.0:9000',
# http_enable_tls => true,
# http_tls_cert_file => '/etc/ssl/graylog/graylog_cert_chain.crt',
# http_tls_key_file => '/etc/ssl/graylog/graylog_key_pkcs8.pem',
# http_tls_key_password => 'sslkey-password',
elasticsearch_hosts => 'http://graylog_os_user:password@127.0.0.1:9200',
mongodb_uri => 'mongodb://graylog_mongo_user:password@127.0.0.1:27017/graylog_mongodb',
},
java_initial_heap_size => '1g',
java_max_heap_size => '1g'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment