Installing WAPT Server with Ansible

To avoid mistakes and automate your WAPT Server deployment, we provide Ansible roles for WAPT Server installation.

You can explore the role source code by visiting Tranquil IT repository on Github.

Requirements

  • Debian Linux or CentOS hosts;

  • a sudoers user on these hosts;

  • Ansible 2.8;

Installing the Ansible role

Discovery

Enterprise

  • install tranquilit.waptserver Ansible role;

    ansible-galaxy install tranquilit.waptserver
    
  • to install the role elsewhere, use the -p subcommand like this;

    ansible-galaxy install tranquilit.waptserver -p /path/to/role/directory/
    

Using the Ansible role

  • ensure you have a working ssh key deployed on your hosts, if not you can generate and copy one like below;

    ssh-keygen -t ed25519
    ssh-copy-id -i id_ed25519.pub user@srvwapt.mydomain.lan
    ssh user@srvwapt.mydomain.lan -i id_ed25519.pub
    
  • edit Ansible hosts inventory (./hosts) and add the Linux hosts;

    [srvwapt]
    srvwapt.mydomain.lan ansible_host=192.168.1.40
    
  • create a playbook with the following content in ./playbooks/wapt.yml;

    - hosts: srvwapt
      roles:
        - { role: tranquilit.waptserver }
    
  • run your playbook with the following command;

    ansible-playbook -i ./hosts ./playbooks/wapt.yml -u user --become --become-method=sudo -K
    

The server is now ready. You may go to the documentation on installing the WAPT console!!

Role variables

Available variables are listed below, along with default values (see defaults/main.yml):

  • version of WAPT that will be installed from WAPT Deb/RPM repository;

    wapt_version: "2.0"
    
  • version of PostgreSQL that will be installed from WAPT Deb/RPM repository;

    pgsql_version: "11"
    
  • version of CentOS used for RPM repository address;

    centos_version: "centos7"
    
  • launch_postconf defaults to True, it launches WAPT Server postconfiguration script silently;

    launch_postconf: True
    

Example Ansible playbook

Here is an example of an Ansible playbook.

- hosts: srvwapt
  vars_files:
    - vars/main.yml
  roles:
    - tranquilit.waptserver

Deploying the Linux WAPT Agent with Ansible

To avoid mistakes and automate your WAPT agents deployment on Linux, we provide Ansible roles for installing WAPT agents on:

  • Debian;

  • Ubuntu;

  • Redhat / CentOS;

You can explore the role source code by visiting this link on Github.

Requirements

  • Debian Linux or CentOS hosts;

  • a sudoers user on these hosts;

  • Ansible 2.8;

Installing the Ansible role

  • install tranquilit.waptagent Ansible role;

    ansible-galaxy install tranquilit.waptagent
    
  • to install the role elsewhere, use the -p subcommand like this;

    ansible-galaxy install tranquilit.waptagent -p /path/to/role/directory/
    

Using the Ansible role

  • ensure you have a working ssh key deployed on your hosts, if not you can generate and copy one like below;

    ssh-keygen -t ed25519
    ssh-copy-id -i id_ed25519.pub user@computer1.mydomain.lan
    ssh user@computer1.mydomain.lan -i id_ed25519.pub
    
  • edit Ansible hosts inventory in the ./hosts file and add the Linux hosts;

    [computers]
    computer1.mydomain.lan ansible_host=192.168.1.50
    computer1.mydomain.lan ansible_host=192.168.1.60
    
  • create a playbook with the following content in ./playbooks/deploywaptagent.yml;

    - hosts: computers
      roles:
        - { role: tranquilit.waptagent }
    
  • ensure all variables are correctly set (see wapt-get.ini variables);

    • wapt_server_url;

    • wapt_repo_url;

    • wapt_crt;

Important

Variables configuration is important as it will configure the behavior of the WAPT.

You must replace the default certificate with your Code-Signing public certificate.

  • run your playbook with the following command;

ansible-playbook -i ./hosts ./playbooks/deploywaptagent.yml -u user --become --become-method=sudo -K

Congratulations, you have installed your WAPT agent on your Linux hosts!

Role variables

Available variables are listed below, along with default values (see defaults/main.yml).

WAPT agent variables

  • version of WAPT that will be installed from WAPT Deb/RPM repository;

wapt_version: "2.0"
  • version of CentOS used for RPM repository address;

centos_version: "centos7"

wapt-get.ini variables

The wapt_server_url parameter points to your WAPT server and is used by default for the wapt_repo_url.

wapt_server_url: "https://srvwapt.mydomain.lan"
wapt_repo_url: "{{ wapt_server_url }}/wapt/"

You can override it like so:

wapt_server_url: "https://wapt.landomain.lan"
wapt_repo_url: "https://wapt.otherdomain.com/wapt/"

Certificate filename located in files/ subdirectory of the role:

wapt_crt: "wapt_ca.crt"

Example Ansible playbook

Here is an example of an Ansible playbook.

- hosts: hosts
  vars_files:
    - vars/main.yml
  roles:
    - tranquilit.waptagent