games/mc: clear old jobs, use templates, set rcon password
This commit is contained in:
		
							parent
							
								
									339c934835
								
							
						
					
					
						commit
						77f75d0bc9
					
				
					 7 changed files with 60 additions and 167 deletions
				
			
		| 
						 | 
				
			
			@ -7,7 +7,7 @@ job "minecraft-cjaran" {
 | 
			
		|||
 | 
			
		||||
    network {
 | 
			
		||||
      port "mc" {
 | 
			
		||||
        to     = 25565
 | 
			
		||||
        to = 25565
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      port "rcon" {
 | 
			
		||||
| 
						 | 
				
			
			@ -42,13 +42,19 @@ job "minecraft-cjaran" {
 | 
			
		|||
        memory = 4096 # 4GB
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      env {
 | 
			
		||||
        EULA            = "TRUE"
 | 
			
		||||
        TYPE            = "PAPER"
 | 
			
		||||
        VERSION         = "1.20.4"
 | 
			
		||||
        USE_AIKAR_FLAGS = true
 | 
			
		||||
        OPS             = "BloThen"
 | 
			
		||||
        MAX_PLAYERS     = "10"
 | 
			
		||||
      template {
 | 
			
		||||
        data        = <<EOF
 | 
			
		||||
EULA            = "TRUE"
 | 
			
		||||
TYPE            = "PAPER"
 | 
			
		||||
VERSION         = "1.20.4"
 | 
			
		||||
USE_AIKAR_FLAGS = true
 | 
			
		||||
OPS             = "BloThen"
 | 
			
		||||
MAX_PLAYERS     = "10"
 | 
			
		||||
ENABLE_RCON     = true
 | 
			
		||||
RCON_PASSWORD   = {{ key "games/mc/cjaran-mc/rcon/password" }}
 | 
			
		||||
EOF
 | 
			
		||||
        destination = "local/.env"
 | 
			
		||||
        env         = true
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ job "minecraft-fugitives" {
 | 
			
		|||
 | 
			
		||||
    network {
 | 
			
		||||
      port "mc" {
 | 
			
		||||
        to     = 25565
 | 
			
		||||
        to = 25565
 | 
			
		||||
      }
 | 
			
		||||
      port "rcon" {
 | 
			
		||||
        to = 25575
 | 
			
		||||
| 
						 | 
				
			
			@ -39,13 +39,19 @@ job "minecraft-fugitives" {
 | 
			
		|||
        memory = 8192 # 8GB
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      env {
 | 
			
		||||
        EULA            = "TRUE"
 | 
			
		||||
        TYPE            = "PAPER"
 | 
			
		||||
        USE_AIKAR_FLAGS = true
 | 
			
		||||
        MOTD            = "Fugitives"
 | 
			
		||||
        MAX_PLAYERS     = "20"
 | 
			
		||||
        MEMORY          = "6G"
 | 
			
		||||
      template {
 | 
			
		||||
        data        = <<EOF
 | 
			
		||||
EULA            = "TRUE"
 | 
			
		||||
TYPE            = "PAPER"
 | 
			
		||||
USE_AIKAR_FLAGS = true
 | 
			
		||||
MOTD            = "Fugitives"
 | 
			
		||||
MAX_PLAYERS     = "20"
 | 
			
		||||
MEMORY          = "6G"
 | 
			
		||||
ENABLE_RCON     = true
 | 
			
		||||
RCON_PASSWORD   = {{ key "games/mc/fugitives-mc/rcon/password" }}
 | 
			
		||||
EOF
 | 
			
		||||
        destination = "local/.env"
 | 
			
		||||
        env         = true
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,14 +42,20 @@ job "minecraft-games" {
 | 
			
		|||
        memory = 8192 # 8GB
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      env {
 | 
			
		||||
        EULA            = "TRUE"
 | 
			
		||||
        TYPE            = "PURPUR"
 | 
			
		||||
        VERSION         = "1.20.1"
 | 
			
		||||
        MOTD            = "DCU Games Soc Minecraft Server"
 | 
			
		||||
        USE_AIKAR_FLAGS = true
 | 
			
		||||
        OPS             = ""
 | 
			
		||||
        MAX_PLAYERS     = "20"
 | 
			
		||||
      template {
 | 
			
		||||
        data        = <<EOF
 | 
			
		||||
EULA            = "TRUE"
 | 
			
		||||
TYPE            = "PURPUR"
 | 
			
		||||
VERSION         = "1.20.1"
 | 
			
		||||
MOTD            = "DCU Games Soc Minecraft Server"
 | 
			
		||||
USE_AIKAR_FLAGS = true
 | 
			
		||||
OPS             = ""
 | 
			
		||||
MAX_PLAYERS     = "20"
 | 
			
		||||
ENABLE_RCON     = true
 | 
			
		||||
RCON_PASSWORD   = {{ key "games/mc/games-mc/rcon/password" }}
 | 
			
		||||
EOF
 | 
			
		||||
        destination = "local/.env"
 | 
			
		||||
        env         = true
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,15 +9,9 @@ job "minecraft-magma" {
 | 
			
		|||
      port "mc" {
 | 
			
		||||
        to = 25565
 | 
			
		||||
      }
 | 
			
		||||
      port "rcon" {}
 | 
			
		||||
      port "voice" {
 | 
			
		||||
        to = 4503
 | 
			
		||||
        static = 4503
 | 
			
		||||
      port "rcon" {
 | 
			
		||||
        to = 25575
 | 
			
		||||
      }
 | 
			
		||||
      port "rcon-ssh" {
 | 
			
		||||
        to = 2222
 | 
			
		||||
      }
 | 
			
		||||
      port "rcon-web" {}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    service {
 | 
			
		||||
| 
						 | 
				
			
			@ -66,29 +60,11 @@ MEMORY          = "8G"
 | 
			
		|||
USE_AIKAR_FLAGS = true
 | 
			
		||||
JVM_XX_OPTS     = "-XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32"
 | 
			
		||||
ENABLE_RCON=true
 | 
			
		||||
RCON_PASSWORD="habibi"
 | 
			
		||||
RCON_PORT={{ env "NOMAD_PORT_rcon" }}
 | 
			
		||||
RCON_PASSWORD   = {{{ key "games/mc/magma-mc/rcon/password" }}
 | 
			
		||||
EOF
 | 
			
		||||
        destination = "local/.env"
 | 
			
		||||
        env         = true
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    task "rcon-hub" {
 | 
			
		||||
      driver = "docker"
 | 
			
		||||
      config {
 | 
			
		||||
      image = "itzg/rcon-hub"
 | 
			
		||||
      ports = ["rcon-ssh"]
 | 
			
		||||
      }
 | 
			
		||||
      template {
 | 
			
		||||
        data = <<EOF
 | 
			
		||||
RH_USER=testing
 | 
			
		||||
RH_PASSWORD=pw
 | 
			
		||||
RH_CONNECTION="mc={{ env "NOMAD_HOST_IP_rcon"}}@mc:{{ env "NOMAD_PORT_rcon" }}"
 | 
			
		||||
EOF
 | 
			
		||||
        destination = "local/.env"
 | 
			
		||||
        env         = true
 | 
			
		||||
    }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,58 +0,0 @@
 | 
			
		|||
job "minecraft-olim909" {
 | 
			
		||||
  datacenters = ["aperture"]
 | 
			
		||||
  type        = "service"
 | 
			
		||||
 | 
			
		||||
  group "olim909-mc" {
 | 
			
		||||
    count = 1
 | 
			
		||||
 | 
			
		||||
    network {
 | 
			
		||||
      port "mc" {
 | 
			
		||||
        to     = 25565
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      port "rcon" {
 | 
			
		||||
        to = 25575
 | 
			
		||||
      }
 | 
			
		||||
      port "geyser" {
 | 
			
		||||
        to = 19132
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    service {
 | 
			
		||||
      name = "olim909-mc"
 | 
			
		||||
      port = "mc"
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    service {
 | 
			
		||||
      name = "olim909-mc-rcon"
 | 
			
		||||
      port = "rcon"
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    task "minecraft-olim909" {
 | 
			
		||||
      driver = "docker"
 | 
			
		||||
 | 
			
		||||
      config {
 | 
			
		||||
        image = "itzg/minecraft-server"
 | 
			
		||||
        ports = ["mc", "rcon", "geyser"]
 | 
			
		||||
 | 
			
		||||
        volumes = [
 | 
			
		||||
          "/storage/nomad/${NOMAD_TASK_NAME}:/data"
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      resources {
 | 
			
		||||
        cpu    = 3000 # 3000 MHz
 | 
			
		||||
        memory = 4096 # 4GB
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      env {
 | 
			
		||||
        EULA            = "TRUE"
 | 
			
		||||
        TYPE            = "PAPER"
 | 
			
		||||
        VERSION         = "1.20.4"
 | 
			
		||||
        USE_AIKAR_FLAGS = true
 | 
			
		||||
        OPS             = "Olim909"
 | 
			
		||||
        MAX_PLAYERS     = "5"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,50 +0,0 @@
 | 
			
		|||
job "minecraft-regaus" {
 | 
			
		||||
  datacenters = ["aperture"]
 | 
			
		||||
  type        = "service"
 | 
			
		||||
 | 
			
		||||
  group "regaus-mc" {
 | 
			
		||||
    count = 1
 | 
			
		||||
 | 
			
		||||
    network {
 | 
			
		||||
      port "mc" {
 | 
			
		||||
        to     = 25565
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      port "rcon" {
 | 
			
		||||
        to = 25575
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    service {
 | 
			
		||||
      name = "regaus-mc"
 | 
			
		||||
      port = "mc"
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    task "minecraft-regaus" {
 | 
			
		||||
      driver = "docker"
 | 
			
		||||
 | 
			
		||||
      config {
 | 
			
		||||
        image = "itzg/minecraft-server"
 | 
			
		||||
        ports = ["mc", "rcon"]
 | 
			
		||||
 | 
			
		||||
        volumes = [
 | 
			
		||||
          "/storage/nomad/${NOMAD_TASK_NAME}:/data"
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      resources {
 | 
			
		||||
        cpu    = 3000 # 3000 MHz
 | 
			
		||||
        memory = 4096 # 4GB
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      env {
 | 
			
		||||
        EULA            = "TRUE"
 | 
			
		||||
        TYPE            = "PAPER"
 | 
			
		||||
        VERSION         = "1.20.4"
 | 
			
		||||
        USE_AIKAR_FLAGS = true
 | 
			
		||||
        OPS             = "regaus"
 | 
			
		||||
        MAX_PLAYERS     = "5"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -7,7 +7,7 @@ job "minecraft-vanilla" {
 | 
			
		|||
 | 
			
		||||
    network {
 | 
			
		||||
      port "mc" {
 | 
			
		||||
        to     = 25565
 | 
			
		||||
        to = 25565
 | 
			
		||||
      }
 | 
			
		||||
      port "rcon" {
 | 
			
		||||
        to = 25575
 | 
			
		||||
| 
						 | 
				
			
			@ -39,13 +39,20 @@ job "minecraft-vanilla" {
 | 
			
		|||
        memory = 8192 # 8GB
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      env {
 | 
			
		||||
        EULA            = "TRUE"
 | 
			
		||||
        TYPE            = "PAPER"
 | 
			
		||||
        ICON            = "https://docs.redbrick.dcu.ie/assets/logo.png"
 | 
			
		||||
        USE_AIKAR_FLAGS = true
 | 
			
		||||
        MOTD            = "LONG LIVE THE REDBRICK"
 | 
			
		||||
        MAX_PLAYERS     = "20"
 | 
			
		||||
      template {
 | 
			
		||||
        data        = <<EOF
 | 
			
		||||
EULA            = "TRUE"
 | 
			
		||||
TYPE            = "PAPER"
 | 
			
		||||
VERSION         = "1.21.1"
 | 
			
		||||
ICON            = "https://docs.redbrick.dcu.ie/assets/logo.png"
 | 
			
		||||
USE_AIKAR_FLAGS = true
 | 
			
		||||
MOTD            = "LONG LIVE THE REDBRICK"
 | 
			
		||||
MAX_PLAYERS     = "20"
 | 
			
		||||
ENABLE_RCON     = true
 | 
			
		||||
RCON_PASSWORD   = {{ key "games/mc/vanilla-mc/rcon/password" }}
 | 
			
		||||
EOF
 | 
			
		||||
        destination = "local/.env"
 | 
			
		||||
        env         = true
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue