> ## Documentation Index
> Fetch the complete documentation index at: https://docs.truu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy Frontline Access via Ansible

> Install, upgrade and uninstall TruU Frontline Access on Windows shared workstations with an Ansible playbook over WinRM, using the silent installer and config file.

TruU Frontline Access can be deployed to Windows shared workstations with Ansible instead of Intune. This guide shows you how to stage the installer bundle and `application.config` on each workstation, run the same silent install command used in the [Intune deployment](https://docs.truu.ai/docs/deploy-sw-via-intune.md), detect the installed version, and reboot when required.

> [!NOTE]
>
> **Prerequisites**
>
> * An Ansible control node with the `ansible.windows` and `community.windows` collections.
> * Target workstations reachable over WinRM (HTTPS on port 5986 is recommended).
> * An account with local administrator rights on the target workstations.
> * Access to the TruU Admin console to download the installer and config file.

## Step 1: Download the TruU application and config file

1. Log in to the TruU Admin console.
2. In the top right corner, click the user icon and select **Downloads**.
3. Accept the EULA terms to download the software.
4. Click the version of **Shared workstation** you want to deploy, enable **Include Config File in Download**, and click **Download**.
5. Validate that the config matches the modality used for authentication. For the TruU FIDO2 Authenticator, `RequiredFIDO2` must be set to `1`. See [TruU modalities](https://docs.truu.ai/docs/tru-u-authentication-modalities.md) for details.

## Step 2: Prepare the Ansible project

Create the following folder structure on your Ansible control node:

```text theme={null}
truu-ansible/
├── requirements.yml
├── install_truu.yml
├── uninstall_truu.yml
├── inventory/
│   └── hosts.ini
├── group_vars/
│   └── truu_workstations.yml
└── files/
    ├── signed-FrontlineAccessInstallerBundle_XX.X.X.XXXX_x64.exe
    └── application.config
```

Copy the installer bundle and `application.config` from Step 1 into the `files/` folder.

> [!WARNING]
>
> `application.config` must be in the same folder as the Frontline Access installer (`signed-FrontlineAccessInstallerBundle_XX.X.X.XXXX_x64.exe`). The install command references the config file by a relative path (`/config=application.config`), so the install fails or uses the wrong settings if the two files are in different folders. The playbook copies both files to the same staging folder on each workstation and runs the installer from that folder.

Install the required collections:

> [!WARNING]
>
> The following is a sample. Review and adjust it for your environment before use.

```yaml requirements.yml theme={null}
---
# SAMPLE ONLY: review and adjust for your environment before use.
collections:
  - name: ansible.windows
  - name: community.windows
```

```bash theme={null}
ansible-galaxy collection install -r requirements.yml
```

> [!TIP]
>
> `application.config` contains your tenant settings. Encrypt it with `ansible-vault encrypt files/application.config`. The `win_copy` module decrypts vaulted files automatically when it copies them to the workstation.

## Step 3: Define the inventory

List the shared workstations in an inventory group named `truu_workstations` and set the WinRM connection options for your environment.

> [!WARNING]
>
> The following is a sample. Review and adjust it for your environment before use.

```ini inventory/hosts.ini theme={null}
; SAMPLE ONLY: review and adjust for your environment before use.
[truu_workstations]
ws-floor-01.corp.example.com
ws-floor-02.corp.example.com

[truu_workstations:vars]
ansible_connection=winrm
ansible_port=5986
ansible_winrm_scheme=https
ansible_winrm_transport=kerberos
```

## Step 4: Set the deployment variables

The variables below control the version being deployed, the file names and the detection path. Set `truu_version` and `truu_installer` to match the files you downloaded. The installer file name must match exactly, including the `signed-` prefix.

> [!WARNING]
>
> The following is a sample. Review and adjust it for your environment before use.

```yaml group_vars/truu_workstations.yml theme={null}
---
# SAMPLE ONLY: review and adjust for your environment before use.
# Version being deployed (used for detection)
truu_version: "XX.X.X.XXXX"

# Exact file names placed in ./files/
truu_installer: "signed-FrontlineAccessInstallerBundle_XX.X.X.XXXX_x64.exe"
truu_config_file: "application.config"

# Paths on the workstation
truu_staging_dir: 'C:\Windows\Temp\TruU'
truu_detect_file: 'C:\Program Files\TruU Inc\TruUAgentService.exe'

# 0 = success, 3010 = success with reboot required, 1641 = success with reboot initiated
truu_success_codes: [0, 1641, 3010]
truu_reboot_codes: [1641, 3010]

# Set to true to always restart after install
truu_always_reboot: false

# Remove the installer and config file from the workstation after install
truu_cleanup_staging: true
```

## Step 5: Create the install playbook

The playbook mirrors the Intune Win32 app settings:

| Intune setting | Ansible equivalent |
| - | - |
| Install command | `win_command` runs `"<installer>.exe" /quiet /config=application.config` from the staging folder |
| Install behavior: System | `become_user: SYSTEM` |
| Detection rule: `TruUAgentService.exe` version greater than or equal to the deployed version | `win_file_version` with a version comparison. Workstations already at the target version are skipped |
| Device restart behavior | Reboots when the installer returns 3010 or 1641, or always when `truu_always_reboot` is `true` |

> [!WARNING]
>
> The following is a sample. Review and adjust it for your environment before use.

```yaml install_truu.yml theme={null}
---
# SAMPLE ONLY: review and adjust for your environment before use.
- name: Install TruU Frontline Access (Shared Workstation)
  hosts: truu_workstations
  gather_facts: false
  become: true
  become_method: runas
  become_user: SYSTEM

  tasks:
    - name: Check for existing TruU agent
      ansible.windows.win_stat:
        path: "{{ truu_detect_file }}"
      register: truu_exe

    - name: Read installed TruU agent version
      community.windows.win_file_version:
        path: "{{ truu_detect_file }}"
      register: truu_installed
      when: truu_exe.stat.exists

    - name: Decide whether install or upgrade is needed
      ansible.builtin.set_fact:
        truu_needs_install: >-
          {{ (not truu_exe.stat.exists)
             or (truu_installed.win_file_version.file_version is version(truu_version, '<')) }}

    - name: Install or upgrade TruU
      when: truu_needs_install | bool
      block:
        - name: Create staging directory
          ansible.windows.win_file:
            path: "{{ truu_staging_dir }}"
            state: directory

        - name: Copy installer bundle
          ansible.windows.win_copy:
            src: "files/{{ truu_installer }}"
            dest: "{{ truu_staging_dir }}\\{{ truu_installer }}"

        - name: Copy application.config
          ansible.windows.win_copy:
            src: "files/{{ truu_config_file }}"
            dest: "{{ truu_staging_dir }}\\{{ truu_config_file }}"
          no_log: true

        - name: Run silent install
          ansible.windows.win_command: '"{{ truu_installer }}" /quiet /config={{ truu_config_file }}'
          args:
            chdir: "{{ truu_staging_dir }}"
          register: truu_install
          async: 1800
          poll: 15
          changed_when: true
          failed_when: truu_install.rc not in truu_success_codes

        - name: Reboot if required
          ansible.windows.win_reboot:
            reboot_timeout: 900
            msg: "Rebooting to complete TruU Frontline Access installation"
          when: (truu_install.rc in truu_reboot_codes) or (truu_always_reboot | bool)

        - name: Re-read TruU agent version
          community.windows.win_file_version:
            path: "{{ truu_detect_file }}"
          register: truu_post

        - name: Verify installed version
          ansible.builtin.assert:
            that:
              - truu_post.win_file_version.file_version is version(truu_version, '>=')
            fail_msg: "TruU version {{ truu_post.win_file_version.file_version }} is below {{ truu_version }}"

      always:
        - name: Remove staging files
          ansible.windows.win_file:
            path: "{{ truu_staging_dir }}"
            state: absent
          when: truu_cleanup_staging | bool
```

> [!NOTE]
>
> The installer is run from the staging folder, which also contains `application.config`, so that the relative `/config=application.config` path resolves. This is the same way Intune runs the command from the package folder.

## Step 6: Run the deployment

Test the playbook against a single workstation first:

```bash theme={null}
ansible-playbook -i inventory/hosts.ini install_truu.yml --limit ws-floor-01.corp.example.com
```

When the install succeeds, deploy to the full group:

```bash theme={null}
ansible-playbook -i inventory/hosts.ini install_truu.yml
```

If you encrypted `application.config` with Ansible Vault, add `--ask-vault-pass`.

To upgrade, place the new installer bundle and config file in `files/`, update `truu_version` and `truu_installer`, and run the playbook again. Workstations already at or above the target version are left unchanged.

## Uninstall Frontline Access

The uninstall playbook runs the same uninstall command used in Intune: `"<installer>.exe" /quiet /uninstall`.

> [!WARNING]
>
> The following is a sample. Review and adjust it for your environment before use.

```yaml uninstall_truu.yml theme={null}
---
# SAMPLE ONLY: review and adjust for your environment before use.
- name: Uninstall TruU Frontline Access (Shared Workstation)
  hosts: truu_workstations
  gather_facts: false
  become: true
  become_method: runas
  become_user: SYSTEM

  tasks:
    - name: Check for TruU agent
      ansible.windows.win_stat:
        path: "{{ truu_detect_file }}"
      register: truu_exe

    - name: Uninstall TruU
      when: truu_exe.stat.exists
      block:
        - name: Create staging directory
          ansible.windows.win_file:
            path: "{{ truu_staging_dir }}"
            state: directory

        - name: Copy installer bundle
          ansible.windows.win_copy:
            src: "files/{{ truu_installer }}"
            dest: "{{ truu_staging_dir }}\\{{ truu_installer }}"

        - name: Run silent uninstall
          ansible.windows.win_command: '"{{ truu_installer }}" /quiet /uninstall'
          args:
            chdir: "{{ truu_staging_dir }}"
          register: truu_uninstall
          async: 1800
          poll: 15
          changed_when: true
          failed_when: truu_uninstall.rc not in truu_success_codes

        - name: Reboot if required
          ansible.windows.win_reboot:
            reboot_timeout: 900
          when: truu_uninstall.rc in truu_reboot_codes

      always:
        - name: Remove staging files
          ansible.windows.win_file:
            path: "{{ truu_staging_dir }}"
            state: absent
```

```bash theme={null}
ansible-playbook -i inventory/hosts.ini uninstall_truu.yml
```

## Troubleshooting

> [accordion] The installer file is not found
>
> Confirm that `truu_installer` matches the file name in `files/` exactly, including the `signed-` prefix and the version number.

> [accordion] The install succeeds but the version check fails
>
> Confirm that `truu_version` matches the version of the installer bundle you downloaded, and that `TruUAgentService.exe` is present in `C:\Program Files\TruU Inc\` on the workstation.

> [accordion] The install fails with an unexpected exit code
>
> Run the playbook with `-vvv` to see the return code. Check that `application.config` was copied to the staging folder and that it is set for the correct authentication modality.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.