I had the same issue with q_puppetagent_certname=$(hostname -f) however on CentOS6 i was able to get it working by changing $(hostname -f) to $HOSTNAME