Skip to content
This example playbook demonstrates the use of our publicly available Ansible roles for the proServer.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
deployer_examples
group_vars
host_vars
host_vars_examples
roles
.envrc
.gitignore
.gitmodules
LICENSE
README.md
Vagrantfile
Vagrantinventory.yaml
ansible.cfg
inventory.ini
playbook.yaml

README.md

proServer Ansible Template

This repository contains Ansible playbook examples for your proServer. It depends on our open open source Ansible roles, which are included as submodules. As of now, there are two supported applications:

There are several components (roles):

Relational databases

Full text search databases

In-memory databases

Web servers

Mail servers

Other components

Getting Started

1) Clone this repository and submodules

git clone --recurse-submodules https://github.com/punktDe/proserver-ansible-template.git
cd proserver-ansible-template

2) Install Ansible on your local machine. Ansible >=2.8 should work. See the Ansible Installation Guide for detailed instructions for your operating system. If you have Python 3 and venv installed, you can use this command:

python3 -m venv venv
venv/bin/pip install ansible
source .envrc  # Hint: Install Direnv (direnv.net) to do this automatically in the future.

3) Adapt Ansible configuration

Basically there are two files, that define the services and configuration for your proServer instance:

inventory.ini

Your inventory contains a list of hosts (proServers) and the groups each host belongs to. The groups are later used by the playbook to determine which roles (applications and components) to provision on a host.

Replace at least any occurrence of vpro0000 with your proServer ID(s) and uncomment staging/production within the application groups section.

host_vars/

The host_vars directory contains a number of files, each file represents a host from your inventory. You can copy examples from the host_vars_examples directory. development.yaml represents the development environment (Vagrant+VirtualBox).

mv host_vars_examples/neos/* host_vars/

Then replace at least any occurrence of vpro0000 with your proServer ID(s).

Local development environment with Vagrant and VirtualBox

1) Install Vagrant and VirtualBox

On macOS, you can install Vagrant and VirtualBox via Homebrew:

brew cask install vagrant virtualbox

Ubuntu:

sudo apt-get install vagrant virtualbox

2) Clone this repository and it's submodules

git clone --recurse-submodules https://github.com/punktDe/proserver-ansible-example.git
cd proserver-ansible-example

3) Start proServer as a virtual machine using Vagrant

vagrant up --provision

4) Update /etc/hosts to include virtual host names used in your playbook

You can also use your own domain if you like. Just update neos.domain and mailhog.domain in your host vars.

echo "172.17.78.40 neos.proserver-dev.local typo3.proserver-dev.local mailhog.proserver-dev.local" | sudo tee -a /etc/hosts

5) Go to http://neos.proserver-dev.local

Start provisioning of your proServer

ansible-playbook --ssh-extra-args=-oProxyJump=jumping@ssh-jumphost.karlsruhe.punkt.de --limit=staging playbook.yaml

Replace --limit=staging with --limit=production to provision the production environment. You can also remove the limit parameter to provision all environments from your inventory.ini.

Neos configuration hints

The neos role will template the file /usr/local/etc/neos.env, which contains useful information about your environment (e.g. domain name, database type and credentials). You can use the helhum/dotenv-connector package to read the file and use any variable it contains in your Neos configuration.

composer require helhum/dotenv-connector
composer config extra.helhum/dotenv-connector.env-file /usr/local/etc/neos.env
# Configuration/Settings.yaml
Neos:
  Flow:
    persistence:
      backendOptions:
        driver: "%env:DB_DRIVER%"
        dbname: "%env:DB_NAME%"
        user: "%env:DB_USER%"
        password: "%env:DB_PASS%"
        host: "%env:DB_HOST%"
        charset: "%env:DB_CHARSET%"

TYPO3 configuration hints

The typo3 role will template the file /usr/local/etc/typo3.env, which contains useful information about your environment (e.g. domain name, database type and credentials). You can use the helhum/dotenv-connector package to read the file and use any variable it contains in your TYPO3 configuration.

composer require helhum/dotenv-connector
composer config extra.helhum/dotenv-connector.env-file /usr/local/etc/typo3.env
# htdocs/typo3conf/AdditionalConfiguration.php
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'] = getenv('DB_NAME');
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user'] = getenv('DB_USER');
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password'] = getenv('DB_PASS');
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'] = strpos(getenv('DB_HOST'), ':') === false ? getenv('DB_HOST') : '[' . getenv('DB_HOST') . ']';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = getenv('SITE_DOMAIN');

Deployment

Deployer can be used to deploy Neos or TYPO3 to a proServer. deployer_examples/ contains a set of Deployer configuration examples.

Helpful links

You can’t perform that action at this time.