diff --git a/tasks/main.yml b/tasks/main.yml
index 2c00eab..ae4916c 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -82,8 +82,8 @@
       puppetdb: "{{ puppetdb }}"
       hostvars: "{{ hostvars[inventory_hostname] }}"
       logfile: "{{ puppet_logfile }}"
-      whoami: "{{ ansible_fqdn }}"
+      whoami: "{{ puppet_report_as }}"
     delegate_to: localhost
     connection: local
 
-  when: puppetdb is defined
+  when: puppetdb is defined and puppet_report_as is defined