Skip to content

chusiang/testlink.ansible.role

Repository files navigation

Ansible Role: TestLink

Build Status Ansible Galaxy Docker Hub Vagrant

An Ansible role of Deploy TestLink with Nginx, PHP 7 (php-fpm) and MySQL 5.6+ on Ubuntu and Debian.

Ubuntu 16.04 Ubuntu 14.04 (EOL) Debian 8
TestLink 1.9.17 1.9.15 1 1.9.17
Nginx 1.14.0 1.12.2 1.14.0
PHP 7.0.29 7.0.29 7.0.29
MySQL 5.7.21 5.6.33 5.6.39 2

Requirements

If we want to use this TestLink role on debian 8, we need include tasks/pre_tasks.yml in pre_tasks for use mysql-server-5.6.

pre_tasks:
  - name: manual add mysql repository
    include: tasks/pre_tasks.yml

roles:
  - williamyeh.nginx
  - chusiang.php7
  - geerlingguy.mysql

Role Variables

If you have a stand alone database server, you can setting the setup_local_database to false, it will not run tasks of install database server.

setup_local_database: true

# TestLink
testlink_tarball_version: '1.9.17'
testlink_tarball_url: 'https://downloads.sourceforge.net/project/testlink/TestLink%201.9/TestLink%201.9.17/testlink-1.9.17.tar.gz'
testlink_tarball_md5: '7183c30133fecc18c8074142016b6a44'
testlink_var_path: '/var/testlink'
testlink_db_name: 'testlinkdb'
testlink_db_user: 'testlinkdb'
testlink_db_password: 'cUv4UK6ardC6cMGL'
testlink_db_host: 'localhost'

# Nginx
nginx_user: 'www-data'
nginx_testlink_path: '/usr/share/nginx/testlink'
nginx_server_name: 'testlink.example.tw'
nginx_enable_ssl: false

# PHP-FPM
php_owner: '{{ nginx_user }}'
php_group: '{{ nginx_user }}'
php_max_execution_time: '3000'
php_session_gc_maxlifetime: '60000'

# MySQL 5.6.x
#
# - TestLink 1.9.15 need mysql-server 5.6.x
#  - https://github.com/TestLinkOpenSourceTRMS/testlink-code
mysql_root_password: ''
mysql_root_password_update: 'no'
mysql_packages:
  - 'mysql-server'
  - 'mysql-client'
  - 'python-mysqldb'

Dependencies

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

By the way, if you need to switch apt mirror, you can use chusiang.switch-apt-mirror role.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
  roles:
     - { role: chusiang.testlink }

Docker Container

This repository contains Dockerized Ansible, published to the public Docker Hub via automated build mechanism.

Docker Hub: chusiang/testlink

Images

  • ubuntu-16.04 (lastest)
  • ubuntu-14.04 (EOL)
  • debian-8

Usage

  • Run container.

    $ docker run --name=testlink -p 8080:80 -d chusiang/testlink
    3bf486c1515b9c28499bbd48f1fe3d3164434108636a49585b1a7b4e3965293e
    
  • Check container status.

    $ docker ps
    CONTAINER ID    IMAGE                COMMAND      CREATED           STATUS           PORTS                            NAMES
    3bf486c1515b    chusiang/testlink    "/run.sh"    20 minutes ago    Up 20 minutes    443/tcp, 0.0.0.0:8080->80/tcp    testlink
    
  • Go TestLink web (http://localhost:8080).

    2016-10-22-testlink-login-page

  • Login the default administrator account, the name and password are admin / admin.

License

Copyright (c) chusiang from 2016-2018 under the MIT license.

Footnotes

  1. The TestLink 1.9.15 is base on PHP > 5.4 and MySQL 5.6.x, please be careful. (more)

  2. It only have MySQL 5.5.x by default on Debian 8, so I use the mysql official development repo to over the MySQL 5.6.x. (more)