在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):voxpupuli/puppet-minecraft开源软件地址(OpenSource Url):https://github.com/voxpupuli/puppet-minecraft开源编程语言(OpenSource Language):Ruby 40.0%开源软件介绍(OpenSource Introduction):Minecraft module for Puppet
This is a derivative work of Branan Purvine-Riley's Minecraft module, with improvements including: version selection, CraftBukkit support, a plugin resource, and settings managed via templates. It is released under the original Apache License, Version 2.0. This module has been tested on Ubuntu Server 12.04.4 with Puppet 3.8.7. UsageThe simplest possible usage is: include minecraft This entire class is parameterized (see the minecraft class for details), and can be configured through hiera. Parameters are available which control how the Minecraft installation behaves:
Minecraft Versions / CraftBukkit BuildsA particular version of Minecraft server can be downloaded by
specifying the Please note that once a JAR file (the server) has been downloaded to
Speaking of old versions, prior to the release of Minecraft 1.6, the downloads were hosted at a different location, but since these are quite old, this module does not currently support it. Submit a Pull Request if you add support, or make an issue if you want me to do so. Server configurationFull configuration of the Minecraft server is supported. Simply specify the parameter with the server setting when declaring the class: class { 'minecraft':
source => 'dev',
heap_size => 2048,
difficulty => 2,
motd => 'Managed by Puppet!',
ops => [ 'op1', 'op2' ]
} Hiera configuration can also be done. In YAML: minecraft::source: 'dev'
minecraft::heap_size: 2048
minecraft::difficulty: 2
minecraft::motd: 'Managed by Puppet, with Hiera!'
minecraft::ops:
- 'op1'
- 'op2' Note that the server property name will use an underscore instead of a
dash, and may not exactly match the Managing playersThis module manages the Minecraft player settings through templates. To add players to a particular list, declare an array of them: class { 'minecraft':
ops => 'me',
banned_players => [ 'griefer', 'badboy' ],
banned_ips => '127.0.0.1', # Don't actually do this
white_list_players => [ 'my_best_friend' ] # Minecraft auto-includes ops
} Note that when any of these parameters is set to undef, Puppet will not manage the corresponding file, allowing you to manage it via commands in Minecraft. However, if specified, Puppet will manage the file, and overwrite any manual changes on the next application of Puppet. (There is also the "replace" attribute on the Puppet file resource, but this is not what we want because, if the file is being managed, we want changes in the manifest to be updated in the files.) To enable the whitelist, you must both set it to true in the class, and add players to the whitelist here, as they affect separate templates. Additionally, blacklists (banned IPs/players) is pointless if the whitelist is enabled, and is only shown here concurrently for demonstration purposes. JavaIf Adding CraftBukkit PluginsCraftBukkit plugins can be installed by using the defined resource
Dynmap ExampleThe Dynmap plugin can be configured like this: minecraft::plugin { 'dynmap':
source => 'http://dev.bukkit.org/media/files/757/982/dynmap-1.9.1.jar'
} Or using Hiera like this: minecraft::plugins:
dynmap:
source: http://dev.bukkit.org/media/files/757/982/dynmap-1.9.1.jar Once enabled, a web-based map of the server will be available at localhost:8123. James Fryman's nginx module could then be used to proxy the server through map.domain.tld like thus: nginx::resource::vhost { 'map.domain.tld':
proxy => 'http://localhost:8123',
proxy_set_header => [ 'Host $host' ],
} Or again in Hiera, nginx::nginx_vhosts:
map.domain.tld:
proxy: http://localhost:8123
proxy_set_header:
- Host $host Note that Nginx setup is not within the scope of this module, and is simply provided as a tip. Rcon Examplercon can be enabled to subsequently access the server's console. class{'minecraft':
enable_rcon => true,
rcon_port => 1234,
rcon_password => 'foo',
} A rcon client e.g mcrcon can be used to connect. # ./mcrcon -c -H 127.0.0.1 -P 25575 -p 1234 -t
Logged in. Type "Q" to quit! CaveatsThis package uses
Puppetlabs' stdlib module
for the TestingTesting of this package occurs on an Ubuntu 12.04.4 LTS machine, using Puppet 3.4.3. This is made easy using vagrant, and my own box. CopyrightMy contributions as indicated by the git repository's history are Copyright 2014 Andrew Schwartzmeyer, and as stated above, are released under the included license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论