Skip to content

Commit

Permalink
remove the java installation function from this role (#171)
Browse files Browse the repository at this point in the history
* remove the java installation from this role

Co-authored-by: nolte <nolte07@googlemail.com>
  • Loading branch information
nolte and nolte authored Jun 14, 2021
1 parent 5d3200f commit 78d308e
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 60 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
ansible-minecraft changelog
===========================
6.0.0
----------

Braking Change
~~~~~

- Remove the Java Installation logic from this role, because Minecraft 1.17 required Java 16, more information at (`#169 <https://github.com/nolte/ansible-minecraft/issues/169>`_). So `minecraft_java_external_managed=true` is the new Normal for this Role, using a extra role ``nolte/ansible-role-msopenjdk <https://github.com/nolte/ansible-role-msopenjdk>`_ for install java.
5.0.0
----------
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This role installs [Minecraft](https://minecraft.net/) or [Spigot](https://www.s

### Out of Role Scop

- install a *Java Runtime*, this must be done, before you use this Role, you can use [nolte/ansible-role-msopenjdk](https://github.com/nolte/ansible-role-msopenjdk) for example.
- executing backups and recovery
- healthy checks like [Minecraft-Region-Fixer](https://github.com/Fenixin/Minecraft-Region-Fixer)
- handle utility services like [filebeat](https://www.elastic.co/de/products/beats/filebeat) or [prometheus](https://github.com/prometheus/node_exporter)
Expand Down Expand Up @@ -60,6 +61,7 @@ and execute ``ansible-galaxy install -r requirements.yml``

- Python 3.x on the Ansible control machine to generate user ACLs
- Ansible 2.7.0+ on the control machine to fetch the Minecraft version
- Existing Compatible Java Runtime for start and install Minecraft on target System.


## Contributing
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ minecraft_eula_accept: false
minecraft_spigot_url: https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
minecraft_server_java_ops:
minecraft_java: /usr/bin/java
minecraft_java_external_managed: false
#minecraft_java_external_managed: true
3 changes: 0 additions & 3 deletions docs/usage/role-variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ The following variable defaults are defined in ``defaults/main.yml``.
``minecraft_server_java_ops``
additional java ops like remote debug ``-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005`` (default: *none*)

``minecraft_java_external_managed``
used for skipping the java installation tasks from this role, for handle Java by external scripts/roles (default: ``false``)

.. _role_config_variabels-minecraft_external_log_conf:

Logging
Expand Down
5 changes: 5 additions & 0 deletions molecule/ci_single_container/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
dependency:
name: galaxy
options:
role-file: ./molecule/resources/playbooks/requirements.yml
platforms:
- name: instance
image: ${MOL_IMAGE:-"solita/ubuntu-systemd:18.04"}
Expand All @@ -20,6 +24,7 @@ provisioner:
user_accept_minecraft_eula: ${user_accept_minecraft_eula:-"false"}
mc_version: ${MC_VERSION:-"latest"}
minecraft_server: ${MC_SERVER_TYPE:-"minecraft"}
jdk_used_version: ${JDK_VERSION:-"11"}
playbooks:
converge: ../resources/playbooks/playbook.yml
lint:
Expand Down
5 changes: 3 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
dependency:
name: galaxy
# options:
# role-file: ./molecule/resources/playbooks/requirements.yml
options:
role-file: ./molecule/resources/playbooks/requirements.yml
driver:
name: docker
#lint:
Expand Down Expand Up @@ -89,6 +89,7 @@ provisioner:
minecraftserver:
user_accept_minecraft_eula: ${mc_accept_eula}
mc_version: "1.13.1"
jdk_used_version: ${JDK_VERSION:-"11"}
playbooks:
converge: ../resources/playbooks/playbook.yml
lint:
Expand Down
5 changes: 3 additions & 2 deletions molecule/latest/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
dependency:
name: galaxy
# options:
# role-file: ./molecule/resources/playbooks/requirements.yml
options:
role-file: ./molecule/resources/playbooks/requirements.yml
driver:
name: docker
#lint:
Expand Down Expand Up @@ -74,6 +74,7 @@ provisioner:
minecraftserver:
user_accept_minecraft_eula: ${mc_accept_eula}
mc_version: "latest"
jdk_used_version: ${JDK_VERSION:-"16"}
playbooks:
converge: ../resources/playbooks/playbook.yml
lint:
Expand Down
3 changes: 3 additions & 0 deletions molecule/resources/playbooks/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
- unzip
- rsync

- include_role:
name: nolte.msopenjdk

roles:
- role: "{{ playbook_dir }}/./../../../"
minecraft_version: "{{ mc_version | default('1.13.1') }}"
Expand Down
2 changes: 2 additions & 0 deletions molecule/resources/playbooks/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
roles:
- name: nolte.msopenjdk
11 changes: 0 additions & 11 deletions molecule/resources/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@
).get_hosts("all")


def test_java_package_exists(host):
if host.system_info.distribution == "centos":
java = "java-1.8.0-openjdk"
elif host.system_info.distribution == "debian":
java = "openjdk-8-jdk"
else:
java = "default-jdk"

host.package(java).is_installed


def test_gameport_is_open(host):
host.socket("tcp://0.0.0.0:25565").is_listening

Expand Down
3 changes: 3 additions & 0 deletions molecule/spigot/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
dependency:
name: galaxy
options:
role-file: ./molecule/resources/playbooks/requirements.yml
driver:
name: docker
#lint:
Expand Down Expand Up @@ -88,6 +90,7 @@ provisioner:
user_accept_minecraft_eula: ${mc_accept_eula}
minecraft_server: spigot
mc_version: 1.13.1
jdk_used_version: ${JDK_VERSION:-"11"}
playbooks:
converge: ../resources/playbooks/playbook.yml
lint:
Expand Down
5 changes: 3 additions & 2 deletions molecule/spigot_with_plugins/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
dependency:
name: galaxy
# options:
# role-file: ./molecule/resources/playbooks/requirements.yml
options:
role-file: ./molecule/resources/playbooks/requirements.yml
driver:
name: docker
platforms:
Expand Down Expand Up @@ -43,6 +43,7 @@ provisioner:
user_accept_minecraft_eula: ${mc_accept_eula:-false}
minecraft_server: spigot
mc_version: 1.13.1
jdk_used_version: ${JDK_VERSION:-"11"}
minecraft_plugins_set_version: "minimal"
minecraft_plugin_sets:
minimal:
Expand Down
10 changes: 0 additions & 10 deletions tasks/setup/java/prepare_java_dependencies.yml

This file was deleted.

16 changes: 0 additions & 16 deletions tasks/setup/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
---

- name: load system specific vars
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "default.yml"
paths:
- 'vars'

- name: install java dependency
include: java/prepare_java_dependencies.yml
when: not minecraft_java_external_managed

- name: install spigot package
package:
name: "{{ item }}"
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ setenv =
latest: MOL_TESTINFRA_ADDITIONAL_TESTS= ""
fixversion: MC_VERSION = "1.13.1"
oldversion: MC_VERSION = "1.9"
latest: MC_VERSION = "1.16.4" #latest
latest: MC_VERSION = "latest"
latest: JDK_VERSION = "16"
deps= -r{toxinidir}/requirementsDev.txt
commands =
molecule --base-config ./molecule/resources/molecule-maintenance-base.yml --env-file {env:DOCKER_CONFIG_FILE} test -s ci_single_container
Expand All @@ -78,6 +79,7 @@ setenv =
user_accept_minecraft_eula={env:mc_accept_eula}
mc_accept_eula={env:mc_accept_eula}
MOL_TESTINFRA_UNIT_REPORT={envtmpdir}/molecule-report.xml
JDK_VERSION="11"
deps= -r{toxinidir}/requirementsDev.txt
commands =
molecule --env-file ./molecule/resources/envs-blanko.yml test -s spigot_with_plugins
Expand Down
2 changes: 0 additions & 2 deletions vars/Alpine.yml

This file was deleted.

2 changes: 0 additions & 2 deletions vars/Debian.yml

This file was deleted.

2 changes: 0 additions & 2 deletions vars/RedHat.yml

This file was deleted.

2 changes: 0 additions & 2 deletions vars/default.yml

This file was deleted.

2 changes: 0 additions & 2 deletions vars/jessie.yml

This file was deleted.

2 changes: 0 additions & 2 deletions vars/xenial.yml

This file was deleted.

0 comments on commit 78d308e

Please sign in to comment.