Install PTAnywhere using Ansible - PTAnywhere/ptAnywhere-installation GitHub Wiki

This page describes how to use the Ansible provisioning script.

Have you already parametrized it and do you want to run it? Please check this page first.

Configuration

Edit the inventory file called machine to specify your machine(s) details. The machines can belong to three different groups:

  • web is the group which contains the machines which will serve the PTAnywhere API (and optionally the HTML widgets which use it).
  • scheduling is the group which contains the machines where the session information will be stored.
  • pt_backend groups the machines which provide PT instances through their internal HTTP API.
  • (learninglocker-centos7's installation script can be found in its own repository)
  • (pt_configuration is used for the machine where the base PT installation is prepared. Therefore, it can be destroyed afterwards)

PTAnywhere installation diagram with Ansible groups

Copy vars.secret.yml.edit file to vars.secret.yml and edit it following the instructions detailed in the file.

You might also want to customize the values of the following variables:

  • Proxies can be set in a new role and assign machines to that role in the inventory file. To see a working example, check group_vars/kmi_proxied and group_vars/kmi_dmz and the kmi-staging inventory file.
  • remote_group in group_vars/local. By default, it has the same name as the remote user. It can be overridden by setting a custom_remote_group variable in the inventory file. To see an example, check the kmi-staging file.
  • installation_file in group_vars/pt_installation. This is the compressed folder of the base Packet Tracer installation. For more information, check this page.

Typical usage

Go to this project's root directory and simply type:

ansible-playbook -vvvv -u [remote-user] -i machine --ask-become-pass main.yml

You can also use any of the other entry points described in the next section. For example, to install only the web server run:

ansible-playbook (...) webservers.yml

Other entry points

The Ansible script has the following entry points:

  • main.yml installs of all the components of PTAnywhere. In other words, it includes the following subentry points:
  • webservers.yml installs and configures a Tomcat 7 server.
  • schedulers.yml installs and configures a Redis server.
  • ptinstances.yml installs and configures Docker, the Docker container with Packet Tracer and the internal HTTP API which manages these containers in Docker.
  • pt_only.yml installs Packet Tracer and configures a graphic access to it through VNC. For more information please check the Preparing the PT installation section.
  • pt_only_backup.yml fetches the configuration files from the previous installation.

Structure of the Ansible script

If you are planning to edit the script (or the inventory file), you should now that it is divided in the following roles:

  • tomcat7 installs and configures Tomcat 7.
  • redis installs and configures Redis.
  • docker installs and configures Docker.
  • packetTracer_docker creates a Docker image with PT, the Xcfe Desktop and VNC access.
  • packetTracer_docker_xvfb creates a Docker image with PT, Xvfb and VNC access. Optionally, it can also install the Xcfe Desktop.
  • pt_instance_manager creates a Docker container with a Packet Tracer installation inside and installs the HTTP API to manage it.
  • pt_configurator configures a standalone Packet Tracer installation (with VNC access).
  • pt_configurator_backup fetches the PT configuration files.
  • proxy configures the HTTP, HTTPS and FTP proxies in the environment.