Issue with redhat_subscription module #48302

Hi,
I'm trying to register new machines with ansible.
Prior using ansible I used to run:
subscription-manager register --org="MYCOMPANY" --activationkey="MYKEY"

In my ansible playbook i used redhat_subscription module in this way:

- name: Register and subscribe to Satellite server
      redhat_subscription:
        state: present
        activationkey: MYKEY
        org_id: MYCOMPANY
when I try to run playbook i receive this error:

fatal: [1.1.1.1]: FAILED! => {"changed": false, "cmd": "/usr/sbin/subscription-manager register --org MYCOMPANY --activationkey VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "msg": "Validation failed: Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123, Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123", "rc": 70, "stderr": "Validation failed: Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123, Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123\n", "stderr_lines": ["Validation failed: Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123, Name hostname can contain only lowercase letters, numbers, dashes and dots according to RFC921, RFC952 and RFC1123"], "stdout": "", "stdout_lines": }

I also tried to use organization id number instead name but it fails anyway.
Where am i wronging?
Thanks,
Fabio

Issue fixed. Hostname was set with “-” and after changed it (without -) everything is fine.
Fabio