Skip to content

Commit

Permalink
add more configurations (#2)
Browse files Browse the repository at this point in the history
* add more configurations
* add github workflow
* add some configurations
* add library to ask urbanterror api
* fix fact template
* remove distributions from test
* finalize installer
  • Loading branch information
bodsch authored Jun 9, 2021
1 parent 1270e14 commit b45d192
Show file tree
Hide file tree
Showing 15 changed files with 1,046 additions and 51 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
name: CI
'on':
pull_request:
push:
branches:
- master
schedule:
- cron: "0 2 * * 0"

defaults:
run:
working-directory: 'ansible-urbanterror'

jobs:

lint:
name: Lint
runs-on: ubuntu-18.04
steps:
- name: check out the codebase.
uses: actions/checkout@v2
with:
path: 'ansible-urbanterror'

- name: set up python.
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: install dependencies.
run: |
set +e
sudo apt-get update
sudo apt-get install -y python3-pip python3-setuptools
sudo pip3 install ansible==2.10.6 ansible-lint==5.0.0 yamllint==1.26.0 flake8==3.8.4 PyYAML==5.3.1
- name: YAMLlint
run: |
yamllint --version
yamllint .
- name: ansible-lint
run: |
ansible-lint --version
ansible-lint .
- name: flake8
run: |
flake8 --version
flake8 .
test:
name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
needs:
- lint
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
image:
- debian:10
- ubuntu:20.04
python-version:
- '3.8'
- '3.9'
ansible-version:
- '2.9'
- '2.10'

steps:
- name: check out the codebase.
uses: actions/checkout@v2
with:
path: 'ansible-urbanterror'

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test-requirements.txt
- name: test with tox
run: |
tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}

publish:
if: github.ref == 'refs/heads/master'
needs:
- test
runs-on: ubuntu-18.04
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.1.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@

installs and configure an [Urbanterror](https://www.urbanterror.info/home) server.


[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/bodsch/ansible-urbanterror/CI)][ci]
[![GitHub issues](https://img.shields.io/github/issues/bodsch/ansible-urbanterror)][issues]
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/bodsch/ansible-urbanterror)][releases]

[ci]: https://github.com/bodsch/ansible-urbanterror/actions
[issues]: https://github.com/bodsch/ansible-urbanterror/issues?q=is%3Aopen+is%3Aissue
[releases]: https://github.com/bodsch/ansible-urbanterror/releases

## Operating systems

Tested on

* Debian 9 / 10
* Ubuntu 18.04 / 20.04

## usage

### default configration

```
urbanterror_admin_password: s3cr3T-are-p0ssiBL3
urbanterror_start_map: ut4_riyadh
urbanterror_game_type: CaptureTheFlag
urbanterror_bind_ip: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
urbanterror_bind_port: 27960
urbanterror_artifact: https://www.urbanterror.info/downloads/software/urt/43/UrbanTerror43_ded.tar.gz
urbanterror_binary: "Quake3-UrT-Ded.{{ ansible_machine }}"
urbanterror_config:
# intition version: 4.0.3
current_version: '4.0.3'
# id: 2 =
download_server: '2'
# id: 1 = Quake3-UrT (default)
# id: 2 = ioq3-m9 (BETA)
game_engine: '1'
ask_before_updating: false
urbanterror_directory: /opt/urbanterror
urbanterror_server_title: "UrbanTerror Server"
urbanterror_server_join_message: "Welcome to Urban Terror"
urbanterror_server_motd: "Urban Terror, Presented by FrozenSand"
urbanterror_server_admin: "darth.vader"
urbanterror_server_clan: "Imperial Force"
urbanterror_server_email: "darth.vader@imperial.force"
urbanterror_server_location: "Coruscant"
urbanterror_server_auth:
enable: false
# Minimum notoriety level to be able to connect to your server.
# 0 allows everyone to join
notoriety: 0
# Set this to 'true' to prevent clan tag thieves from joining your server
tags: true
# Set this to 'true' to block the officially banned cheaters from your server
cheaters: true
# 0 = no authentication message to everyone when a player connects
# 1 = message on the top of the screen
# 2 = message in the chat box
verbosity: 1
# Set this to 'true' to draw the account information in the userinfo of each player in the server logs
log: true
urbanterror_maps:
- ut4_abbey
- ut4_mandolin
- ut4_uptown
- ut4_algiers
- ut4_austria
- ut4_oildepot
urbanterror_custom_maps:
- name: ut_park_avenue_fix
src: http://downloads.urban-zone.org/maps/q3ut4/ut_park_avenue_fix.pk3
- name: ut_maya_beta3
src: http://downloads.urban-zone.org/maps/q3ut4/ut_maya_beta3.pk3
```

#### Game Types

- `FreeForAll`
- `LastManStanding`
- `TeamDeathMatch`
- `TeamSurvivor`
- `FollowTheLeader`
- `CaptureAndHold`
- `CaptureTheFlag`
- `BombMode`
- `JumpTraining`
- `FreezeTag`
- `GunGame`

```
urbanterror_game_type: CaptureTheFlag
```
36 changes: 35 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,48 @@ urbanterror_admin_password: s3cr3T-are-p0ssiBL3
urbanterror_start_map: ut4_riyadh
urbanterror_game_type: CaptureTheFlag

urbanterror_bind_ip: "{{ ansible_default_ipv4.address }}"
urbanterror_bind_ip: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
urbanterror_bind_port: 27960

urbanterror_artifact: https://www.urbanterror.info/downloads/software/urt/43/UrbanTerror43_ded.tar.gz
urbanterror_binary: "Quake3-UrT-Ded.{{ ansible_machine }}"

urbanterror_config:
# intition version: 4.0.3
current_version: '4.0.3'
# id: 2 =
download_server: '2'
# id: 1 = Quake3-UrT (default)
# id: 2 = ioq3-m9 (BETA)
game_engine: '1'
ask_before_updating: false

urbanterror_directory: /opt/urbanterror

urbanterror_server_title: "UrbanTerror Server"
urbanterror_server_join_message: "Welcome to Urban Terror"
urbanterror_server_motd: "Urban Terror, Presented by FrozenSand"

urbanterror_server_admin: "darth.vader"
urbanterror_server_clan: "Imperial Force"
urbanterror_server_email: "darth.vader@imperial.force"
urbanterror_server_location: "Coruscant"
urbanterror_server_auth:
enable: false
# Minimum notoriety level to be able to connect to your server.
# 0 allows everyone to join
notoriety: 0
# Set this to 'true' to prevent clan tag thieves from joining your server
tags: true
# Set this to 'true' to block the officially banned cheaters from your server
cheaters: true
# 0 = no authentication message to everyone when a player connects
# 1 = message on the top of the screen
# 2 = message in the chat box
verbosity: 1
# Set this to 'true' to draw the account information in the userinfo of each player in the server logs
log: true

urbanterror_maps:
- ut4_abbey
- ut4_mandolin
Expand Down
2 changes: 1 addition & 1 deletion files/updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,4 @@ checkGameEngine
checkVersion
checkFiles
downloadFiles

writeSettings
Loading

0 comments on commit b45d192

Please sign in to comment.