Skip to content

Instantly share code, notes, and snippets.

@ssube
Created March 18, 2016 15:23
Show Gist options
  • Select an option

  • Save ssube/45a424dc048861d326d2 to your computer and use it in GitHub Desktop.

Select an option

Save ssube/45a424dc048861d326d2 to your computer and use it in GitHub Desktop.
node "craft-1.yoursite.net" {
$craft_pkgs = ['java-1.8.0-openjdk', 'java-1.8.0-openjdk-devel']
$craft_root = '/opt/craft'
$craft_user = 'craft'
$craft_jar = "${craft_root}/minecraft.jar"
$craft_props = '
allow-flight=true
allow-nether=true
difficulty=2
force-gamemode=true
gamemode=0
generate-structures=true
generator-settings={"useCaves":true,"useStrongholds":true,"useVillages":true,"useMineShafts":true,"useTemples":true,"useRavines":true,"useMonuments":true,"useLavaOceans":false,"useWaterLakes":true,"useLavaLakes":true,"useDungeons":true,"seaLevel":63,"fixedBiome":-1,"biomeSize":3,"riverSize":4,"waterLakeChance":4,"lavaLakeChance":80,"dungeonChance":8,"dirtSize":30,"dirtCount":10,"dirtMinHeight":35,"dirtMaxHeight":255,"gravelSize":33,"gravelCount":8,"gravelMinHeight":20,"gravelMaxHeight":255,"graniteSize":33,"graniteCount":10,"graniteMinHeight":0,"graniteMaxHeight":80,"dioriteSize":33,"dioriteCount":10,"dioriteMinHeight":0,"dioriteMaxHeight":80,"andesiteSize":33,"andesiteCount":10,"andesiteMinHeight":0,"andesiteMaxHeight":80,"coalSize":18,"coalCount":25,"coalMinHeight":0,"coalMaxHeight":255,"ironSize":12,"ironCount":26,"ironMinHeight":0,"ironMaxHeight":72,"goldSize":10,"goldCount":4,"goldMinHeight":0,"goldMaxHeight":40,"redstoneSize":8,"redstoneCount":8,"redstoneMinHeight":0,"redstoneMaxHeight":16,"diamondSize":10,"diamondCount":3,"diamondMinHeight":0,"diamondMaxHeight":24,"lapisSize":7,"lapisCount":1,"lapisMinHeight":0,"lapisMaxHeight":32,"coordinateScale":684,"heightScale":784,"mainNoiseScaleX":80,"mainNoiseScaleY":160,"mainNoiseScaleZ":80,"depthNoiseScaleX":200,"depthNoiseScaleZ":200,"depthNoiseScaleExponent":0.5,"biomeDepthWeight":1,"biomeDepthOffset":0,"biomeScaleWeight":1,"biomeScaleOffset":1,"lowerLimitScale":512,"upperLimitScale":512,"baseSize":8.5,"stretchY":12,"lapisCenterHeight":16,"lapisSpread":16}
hardcode=false
level-name=mc0
level-seed=6533516011792026944
level-type=CUSTOMIZED
max-players=20
max-world-size=16000
motd=Sexy Grandma Server
player-idle-timeout=30
pvp=false
server-port=25565
spawn-animals=true
spawn-monsters=false
spawn-npcs=true
spawn-protection=5
view-distance=8
'
ensure_packages($craft_pkgs, {
ensure => latest,
allow_virtual => true,
})
user { $craft_user:
ensure => present,
}
file { 'craft server dir':
ensure => directory,
path => $craft_root,
owner => $craft_user,
require => [
User[$craft_user],
],
}
exec {'craft server jar':
command => "/usr/bin/wget -O ${craft_jar} https://s3.amazonaws.com/Minecraft.Download/versions/1.8.9/minecraft_server.1.8.9.jar",
creates => $craft_jar,
require => [
File['craft server dir'],
],
}
file { 'craft server props':
ensure => file,
path => "${craft_root}/server.properties",
content => inline_template($craft_props),
owner => $craft_user,
require => [
File['craft server dir'],
],
}
file {'craft eula':
ensure => file,
path => "${craft_root}/eula.txt",
content => "eula=TRUE",
owner => $craft_user,
require => [
File['craft server dir'],
],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment