---
- hosts: local
  gather_facts: no
  tasks:
    - name: Add the test host
      add_host:
        groups: test
        name: "{{ lookup('env','PAPERTRAIL_TEST_HOSTNAME') }}"
        ansible_connection: "{{ lookup('env','PAPERTRAIL_TEST_CONNECTION') }}"
        ansible_ssh_host: "{{ test_ssh_host | omit }}"
        ansible_ssh_port: "{{ test_ssh_port | omit }}"

- hosts: test
  vars:
    papertrail_log_domain: "{{ lookup('env','PAPERTRAIL_LOG_DOMAIN') }}"
    papertrail_log_port: "{{ lookup('env','PAPERTRAIL_LOG_PORT') }}"
  roles:
    - { role: '../../' }
...

---
- hosts: local
  gather_facts: no
  tasks:
    - name: Add the test host
      add_host:
        groups: test
        name: "{{ lookup('env','PAPERTRAIL_TEST_HOSTNAME') }}"
        ansible_connection: "{{ lookup('env','PAPERTRAIL_TEST_CONNECTION') }}"
        ansible_ssh_port: "{{ test_ssh_port | default('22') }}"

- hosts: test
  vars:
    papertrail_log_domain: "{{ lookup('env','PAPERTRAIL_LOG_DOMAIN') }}"
    papertrail_log_port: "{{ lookup('env','PAPERTRAIL_LOG_PORT') }}"
  roles:
    - { role: '../../' }
...

Change as omit() comes in in later versions of ansible
Change as omit() comes in in later versions of ansible
