rhtconsulting / rhc-ose

OpenShift Automation and Utilities by Red Hat Consulting
42 stars 34 forks source link

subscription-manager role gives error for missing rhsm_password when subscribing with Satellite #163

Open etsauer opened 8 years ago

etsauer commented 8 years ago

I invoke the subscription-manager role in a play like:

- name: Subscribe servers
  hosts: dns-servers
  roles:
  - { role: subscription-manager, when: hostvars.localhost.rhsm_register, tags: 'subscription-manager' }

My inventory contains:

[all:vars]

rhsm_register=yes
rhsm_server='casl-sat6-1.rhc-ose.labs.redhat.com'
rhsm_org='RHC-OSE'
rhsm_activationkey='OSEv3-Library'
rhsm_method='satellite'

When run, I get an error saying:

PLAY [Subscribe servers] ********************************************** 

GATHERING FACTS *************************************************************** 
ok: [casl-esauer-yolAIJxG-dns-server1]

TASK: [subscription-manager | Initialize rhsm_password variable if vars_prompt was used] *** 
fatal: [casl-esauer-yolAIJxG-dns-server1] => One or more undefined variables: 'dict object' has no attribute 'rhsm_password'

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/root/role-openstack.retry

casl-esauer-yolAIJxG-dns-server1 : ok=1    changed=0    unreachable=1    failed=0   
localhost                  : ok=17   changed=5    unreachable=0    failed=0   

If i'm providing an activation key, then I shouldn't need to provide rhsm_password, correct?

cc: @vvaldez

etsauer commented 8 years ago

@vvaldez tried including a dummy value for rhsm_password to see if I get by it, but it looks like it then tries both subscription methods:

TASK: [subscription-manager | Register to Satellite using activation key] ***** 
skipping: [casl-esauer-R9xr3oH5-dns-server1]

TASK: [subscription-manager | Register using username and password] *********** 
skipping: [casl-esauer-R9xr3oH5-dns-server1] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})

Then eventually fails at the attach task since it's not successfully subscribed.

vvaldez commented 8 years ago

@etsauer looking into this now. First thing I see is that the variable is rhsm_satellite and no longer rhsm_server and the rhsm_method is no longer used, any chance that is an older version of the original PR? I also don't read in rhsm_register that is dynamically determined based on which parameters are set. When I run the latest subscription-manager role with those same variables you specified I get this:

TASK: [Initialize Subscription Manager fact] ********************************** 
ok: [localhost] => {"ansible_facts": {"rhsm_register": true}}

TASK: [Determine if Subscription Manager should be used] ********************** 
skipping: [localhost]

TASK: [Validate Subscription Manager organization is set] ********************* 
skipping: [localhost]

TASK: [Validate Subscription Manager authentication is defined] *************** 
skipping: [localhost]

TASK: [Validate activation key and Hosted are not requested together] ********* 
failed: [localhost] => {"failed": true}
msg: Cannot register to RHSM Hosted with 'rhsm_activationkey'

FATAL: all hosts have already failed -- aborting

This should be caught in the pre_tasks lines 42-49:

- name: "Validate activation key and Hosted are not requested together"
  fail: msg="Cannot register to RHSM Hosted with 'rhsm_activationkey'"
  when:
    - rhsm_satellite is undefined or rhsm_satellite is none or rhsm_satellite|trim == ''
    - rhsm_activationkey is defined
    - rhsm_activationkey is not none
    - rhsm_activationkey|trim != ''
    - rhsm_register

Do you have the pre_task called before the role in the play? You may be able to simply add:

pre_tasks:
  - include: roles/subscription-manager/pre_tasks/pre_tasks.yml

It shouldn't be trying both key and password, those tasks say skipping, did it try to execute one or both? You can try -vv on the playbook run. However, I do see where a problem may occur if using a key and no password, I will work on addressing that now.

vvaldez commented 8 years ago

@etsauer this worked for me using these variables:

rhsm_satellite='casl-sat6-1.rhc-ose.labs.redhat.com'
rhsm_org='RHC-OSE'
rhsm_activationkey='OSEv3-Library'

Here's the task when it runs with no rhsm_password specified:

TASK: [Set password fact] ***************************************************** 
skipping: [localhost] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})

The full pre_tasks output should look like this:

TASK: [Set password fact] ***************************************************** 
skipping: [localhost] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})

TASK: [Initialize Subscription Manager fact] ********************************** 
ok: [localhost] => {"ansible_facts": {"rhsm_register": true}}

TASK: [Determine if Subscription Manager should be used] ********************** 
skipping: [localhost]

TASK: [Validate Subscription Manager organization is set] ********************* 
skipping: [localhost]

TASK: [Validate Subscription Manager authentication is defined] *************** 
skipping: [localhost]

TASK: [Validate activation key and Hosted are not requested together] ********* 
skipping: [localhost]

Here's the tasks output and looks like rhsm_password gets set to "" so should not cause an issue:

TASK: [subscription-manager | Initialize rhsm_password variable if vars_prompt was used] *** 
ok: [casl-vvaldez-3HQ1hpq2-master1] => {"ansible_facts": {"rhsm_password": ""}}
ok: [casl-vvaldez-3HQ1hpq2-node1] => {"ansible_facts": {"rhsm_password": ""}}
ok: [casl-vvaldez-3HQ1hpq2-node2] => {"ansible_facts": {"rhsm_password": ""}}

TASK: [subscription-manager | Initializing Subscription Manager authenticaiton method] *** 
ok: [casl-vvaldez-3HQ1hpq2-node1] => {"ansible_facts": {"rhsm_authentication": false}}
ok: [casl-vvaldez-3HQ1hpq2-node2] => {"ansible_facts": {"rhsm_authentication": false}}
ok: [casl-vvaldez-3HQ1hpq2-master1] => {"ansible_facts": {"rhsm_authentication": false}}

TASK: [subscription-manager | Setting Subscription Manager Activation Key Fact] *** 
ok: [casl-vvaldez-3HQ1hpq2-node1] => {"ansible_facts": {"rhsm_authentication": "key"}}
ok: [casl-vvaldez-3HQ1hpq2-master1] => {"ansible_facts": {"rhsm_authentication": "key"}}
ok: [casl-vvaldez-3HQ1hpq2-node2] => {"ansible_facts": {"rhsm_authentication": "key"}}

TASK: [subscription-manager | Setting Subscription Manager Username and Password Fact] *** 
skipping: [casl-vvaldez-3HQ1hpq2-master1]
skipping: [casl-vvaldez-3HQ1hpq2-node1]
skipping: [casl-vvaldez-3HQ1hpq2-node2]

TASK: [subscription-manager | Initializing registration status] *************** 
ok: [casl-vvaldez-3HQ1hpq2-master1] => {"ansible_facts": {"registered": false}}
ok: [casl-vvaldez-3HQ1hpq2-node2] => {"ansible_facts": {"registered": false}}
ok: [casl-vvaldez-3HQ1hpq2-node1] => {"ansible_facts": {"registered": false}}

TASK: [subscription-manager | Checking subscription status (a failure means it is not registered and will be)] *** 
<10.3.14.171> REMOTE_MODULE command /usr/bin/subscription-manager status
<10.3.14.173> REMOTE_MODULE command /usr/bin/subscription-manager status
<10.3.14.174> REMOTE_MODULE command /usr/bin/subscription-manager status
failed: [casl-vvaldez-3HQ1hpq2-node2] => {"changed": false, "cmd": ["/usr/bin/subscription-manager", "status"], "delta": "0:00:00.774864", "end": "2016-04-27 18:01:35.546353", "rc": 1, "start": "2016-04-27 18:01:34.771489", "stdout_lines": ["+-------------------------------------------+", "   System Status Details", "+-------------------------------------------+", "Overall Status: Unknown"], "warnings": []}
stdout: +-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Unknown
...ignoring
failed: [casl-vvaldez-3HQ1hpq2-master1] => {"changed": false, "cmd": ["/usr/bin/subscription-manager", "status"], "delta": "0:00:01.032250", "end": "2016-04-27 18:01:34.905738", "rc": 1, "start": "2016-04-27 18:01:33.873488", "stdout_lines": ["+-------------------------------------------+", "   System Status Details", "+-------------------------------------------+", "Overall Status: Unknown"], "warnings": []}
stdout: +-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Unknown
...ignoring
failed: [casl-vvaldez-3HQ1hpq2-node1] => {"changed": false, "cmd": ["/usr/bin/subscription-manager", "status"], "delta": "0:00:01.198467", "end": "2016-04-27 18:01:35.716684", "rc": 1, "start": "2016-04-27 18:01:34.518217", "stdout_lines": ["+-------------------------------------------+", "   System Status Details", "+-------------------------------------------+", "Overall Status: Unknown"], "warnings": []}
stdout: +-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Unknown
...ignoring

TASK: [subscription-manager | Set registration fact if system is already registered] *** 
skipping: [casl-vvaldez-3HQ1hpq2-master1]
skipping: [casl-vvaldez-3HQ1hpq2-node2]
skipping: [casl-vvaldez-3HQ1hpq2-node1]

TASK: [subscription-manager | Cleaning any old subscriptions] ***************** 
<10.3.14.171> REMOTE_MODULE command /usr/bin/subscription-manager clean
<10.3.14.173> REMOTE_MODULE command /usr/bin/subscription-manager clean
<10.3.14.174> REMOTE_MODULE command /usr/bin/subscription-manager clean
changed: [casl-vvaldez-3HQ1hpq2-master1] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "clean"], "delta": "0:00:00.949749", "end": "2016-04-27 18:01:37.249929", "rc": 0, "start": "2016-04-27 18:01:36.300180", "stderr": "", "stdout": "All local data removed", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-node2] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "clean"], "delta": "0:00:00.884338", "end": "2016-04-27 18:01:38.263553", "rc": 0, "start": "2016-04-27 18:01:37.379215", "stderr": "", "stdout": "All local data removed", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-node1] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "clean"], "delta": "0:00:01.088542", "end": "2016-04-27 18:01:38.143971", "rc": 0, "start": "2016-04-27 18:01:37.055429", "stderr": "", "stdout": "All local data removed", "warnings": []}

TASK: [subscription-manager | Install Satellite certificate] ****************** 
<10.3.14.171> REMOTE_MODULE command rpm -Uvh --force http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm
<10.3.14.173> REMOTE_MODULE command rpm -Uvh --force http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm
<10.3.14.174> REMOTE_MODULE command rpm -Uvh --force http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm
changed: [casl-vvaldez-3HQ1hpq2-node2] => {"changed": true, "cmd": ["rpm", "-Uvh", "--force", "http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm"], "delta": "0:00:04.623497", "end": "2016-04-27 18:01:44.240323", "rc": 0, "start": "2016-04-27 18:01:39.616826", "stderr": "", "stdout": "Retrieving http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm\nPreparing...                          ########################################\nUpdating / installing...\nkatello-ca-consumer-casl-sat6-1.rhc-os########################################", "warnings": ["Consider using yum module rather than running rpm"]}
changed: [casl-vvaldez-3HQ1hpq2-master1] => {"changed": true, "cmd": ["rpm", "-Uvh", "--force", "http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm"], "delta": "0:00:05.585997", "end": "2016-04-27 18:01:44.351047", "rc": 0, "start": "2016-04-27 18:01:38.765050", "stderr": "", "stdout": "Retrieving http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm\nPreparing...                          ########################################\nUpdating / installing...\nkatello-ca-consumer-casl-sat6-1.rhc-os########################################", "warnings": ["Consider using yum module rather than running rpm"]}
changed: [casl-vvaldez-3HQ1hpq2-node1] => {"changed": true, "cmd": ["rpm", "-Uvh", "--force", "http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm"], "delta": "0:00:06.450659", "end": "2016-04-27 18:01:45.757167", "rc": 0, "start": "2016-04-27 18:01:39.306508", "stderr": "", "stdout": "Retrieving http://casl-sat6-1.rhc-ose.labs.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm\nPreparing...                          ########################################\nUpdating / installing...\nkatello-ca-consumer-casl-sat6-1.rhc-os########################################", "warnings": ["Consider using yum module rather than running rpm"]}

TASK: [subscription-manager | Register to Satellite using activation key] ***** 
<10.3.14.171> REMOTE_MODULE command /usr/bin/subscription-manager register --activationkey=OSEv3-Library --org=RHC-OSE
<10.3.14.174> REMOTE_MODULE command /usr/bin/subscription-manager register --activationkey=OSEv3-Library --org=RHC-OSE
<10.3.14.173> REMOTE_MODULE command /usr/bin/subscription-manager register --activationkey=OSEv3-Library --org=RHC-OSE
changed: [casl-vvaldez-3HQ1hpq2-master1] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "register", "--activationkey=OSEv3-Library", "--org=RHC-OSE"], "delta": "0:00:40.168098", "end": "2016-04-27 18:02:26.427722", "rc": 0, "start": "2016-04-27 18:01:46.259624", "stderr": "", "stdout": "The system has been registered with ID: 25292e4e-a01d-4b15-8657-dac2e7b85470 \n\nInstalled Product Current Status:\nProduct Name: Red Hat Enterprise Linux 7 Public Beta\nStatus:       Not Subscribed\n\nProduct Name: Red Hat Enterprise Linux Server\nStatus:       Subscribed\n\nUnable to find available subscriptions for all your installed products.", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-node2] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "register", "--activationkey=OSEv3-Library", "--org=RHC-OSE"], "delta": "0:00:41.529731", "end": "2016-04-27 18:02:28.769209", "rc": 0, "start": "2016-04-27 18:01:47.239478", "stderr": "", "stdout": "The system has been registered with ID: 00d64662-4f9d-43d0-ac25-3294264f5531 \n\nInstalled Product Current Status:\nProduct Name: Red Hat Enterprise Linux 7 Public Beta\nStatus:       Not Subscribed\n\nProduct Name: Red Hat Enterprise Linux Server\nStatus:       Subscribed\n\nUnable to find available subscriptions for all your installed products.", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-node1] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "register", "--activationkey=OSEv3-Library", "--org=RHC-OSE"], "delta": "0:00:53.462181", "end": "2016-04-27 18:02:40.465779", "rc": 0, "start": "2016-04-27 18:01:47.003598", "stderr": "", "stdout": "The system has been registered with ID: 832eaa76-403d-48dd-b1a7-a4ecd5ea9dce \n\nInstalled Product Current Status:\nProduct Name: Red Hat Enterprise Linux 7 Public Beta\nStatus:       Not Subscribed\n\nProduct Name: Red Hat Enterprise Linux Server\nStatus:       Subscribed\n\nUnable to find available subscriptions for all your installed products.", "warnings": []}

TASK: [subscription-manager | Register using username and password] *********** 
skipping: [casl-vvaldez-3HQ1hpq2-master1] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})
skipping: [casl-vvaldez-3HQ1hpq2-node1] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})
skipping: [casl-vvaldez-3HQ1hpq2-node2] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})

TASK: [subscription-manager | Register using username, password and organization] *** 
skipping: [casl-vvaldez-3HQ1hpq2-master1] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})
skipping: [casl-vvaldez-3HQ1hpq2-node1] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})
skipping: [casl-vvaldez-3HQ1hpq2-node2] => (item={'skipped': True, 'censored': 'results hidden due to no_log parameter', 'changed': False})

TASK: [subscription-manager | Auto-attach to Subscription Manager Pool] ******* 
<10.3.14.171> REMOTE_MODULE command /usr/bin/subscription-manager attach --auto
<10.3.14.173> REMOTE_MODULE command /usr/bin/subscription-manager attach --auto
<10.3.14.174> REMOTE_MODULE command /usr/bin/subscription-manager attach --auto
changed: [casl-vvaldez-3HQ1hpq2-node2] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "attach", "--auto"], "delta": "0:00:07.571345", "end": "2016-04-27 18:02:49.832621", "rc": 0, "start": "2016-04-27 18:02:42.261276", "stderr": "", "stdout": "\n\nInstalled Product Current Status:\nProduct Name: Red Hat Enterprise Linux 7 Public Beta\nStatus:       Not Subscribed\n\nProduct Name: Red Hat Enterprise Linux Server\nStatus:       Subscribed\n\nUnable to find available subscriptions for all your installed products.", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-master1] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "attach", "--auto"], "delta": "0:00:08.030685", "end": "2016-04-27 18:02:49.208955", "rc": 0, "start": "2016-04-27 18:02:41.178270", "stderr": "", "stdout": "\n\nInstalled Product Current Status:\nProduct Name: Red Hat Enterprise Linux 7 Public Beta\nStatus:       Not Subscribed\n\nProduct Name: Red Hat Enterprise Linux Server\nStatus:       Subscribed\n\nUnable to find available subscriptions for all your installed products.", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-node1] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "attach", "--auto"], "delta": "0:00:08.398679", "end": "2016-04-27 18:02:50.282162", "rc": 0, "start": "2016-04-27 18:02:41.883483", "stderr": "", "stdout": "\n\nInstalled Product Current Status:\nProduct Name: Red Hat Enterprise Linux 7 Public Beta\nStatus:       Not Subscribed\n\nProduct Name: Red Hat Enterprise Linux Server\nStatus:       Subscribed\n\nUnable to find available subscriptions for all your installed products.", "warnings": []}

TASK: [subscription-manager | Attach to a specific pool] ********************** 
skipping: [casl-vvaldez-3HQ1hpq2-master1]
skipping: [casl-vvaldez-3HQ1hpq2-node1]
skipping: [casl-vvaldez-3HQ1hpq2-node2]

TASK: [subscription-manager | Disable all repositories] *********************** 
<10.3.14.171> REMOTE_MODULE command /usr/bin/subscription-manager repos --disable=*
<10.3.14.173> REMOTE_MODULE command /usr/bin/subscription-manager repos --disable=*
<10.3.14.174> REMOTE_MODULE command /usr/bin/subscription-manager repos --disable=*
changed: [casl-vvaldez-3HQ1hpq2-node1] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--disable=*"], "delta": "0:00:06.415025", "end": "2016-04-27 18:02:58.066957", "rc": 0, "start": "2016-04-27 18:02:51.651932", "stderr": "", "stdout": "Repository 'rhel-server-rhscl-7-rpms' is disabled for this system.\nRepository 'rhel-7-server-optional-rpms' is disabled for this system.\nRepository 'rhel-7-server-rh-common-rpms' is disabled for this system.\nRepository 'rhel-7-server-rpms' is disabled for this system.\nRepository 'rhel-ha-for-rhel-7-server-rpms' is disabled for this system.\nRepository 'rhel-7-server-ose-3.0-rpms' is disabled for this system.\nRepository 'rhel-7-server-satellite-tools-6.1-rpms' is disabled for this system.\nRepository 'rhel-7-server-ose-3.1-rpms' is disabled for this system.\nRepository 'rhel-7-server-supplementary-rpms' is disabled for this system.\nRepository 'rhel-7-server-extras-rpms' is disabled for this system.", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-master1] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--disable=*"], "delta": "0:00:06.609570", "end": "2016-04-27 18:02:57.520826", "rc": 0, "start": "2016-04-27 18:02:50.911256", "stderr": "", "stdout": "Repository 'rhel-server-rhscl-7-rpms' is disabled for this system.\nRepository 'rhel-7-server-optional-rpms' is disabled for this system.\nRepository 'rhel-7-server-rh-common-rpms' is disabled for this system.\nRepository 'rhel-7-server-rpms' is disabled for this system.\nRepository 'rhel-ha-for-rhel-7-server-rpms' is disabled for this system.\nRepository 'rhel-7-server-ose-3.0-rpms' is disabled for this system.\nRepository 'rhel-7-server-satellite-tools-6.1-rpms' is disabled for this system.\nRepository 'rhel-7-server-ose-3.1-rpms' is disabled for this system.\nRepository 'rhel-7-server-supplementary-rpms' is disabled for this system.\nRepository 'rhel-7-server-extras-rpms' is disabled for this system.", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-node2] => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--disable=*"], "delta": "0:00:06.584036", "end": "2016-04-27 18:02:58.574005", "rc": 0, "start": "2016-04-27 18:02:51.989969", "stderr": "", "stdout": "Repository 'rhel-server-rhscl-7-rpms' is disabled for this system.\nRepository 'rhel-7-server-optional-rpms' is disabled for this system.\nRepository 'rhel-7-server-rh-common-rpms' is disabled for this system.\nRepository 'rhel-7-server-rpms' is disabled for this system.\nRepository 'rhel-ha-for-rhel-7-server-rpms' is disabled for this system.\nRepository 'rhel-7-server-ose-3.0-rpms' is disabled for this system.\nRepository 'rhel-7-server-satellite-tools-6.1-rpms' is disabled for this system.\nRepository 'rhel-7-server-ose-3.1-rpms' is disabled for this system.\nRepository 'rhel-7-server-supplementary-rpms' is disabled for this system.\nRepository 'rhel-7-server-extras-rpms' is disabled for this system.", "warnings": []}

TASK: [subscription-manager | Enable specified repositories] ****************** 
<10.3.14.173> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-rpms
<10.3.14.171> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-rpms
<10.3.14.174> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-rpms
changed: [casl-vvaldez-3HQ1hpq2-node2] => (item=rhel-7-server-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-rpms"], "delta": "0:00:05.584747", "end": "2016-04-27 18:03:05.374151", "item": "rhel-7-server-rpms", "rc": 0, "start": "2016-04-27 18:02:59.789404", "stderr": "", "stdout": "Repository 'rhel-7-server-rpms' is enabled for this system.", "warnings": []}
<10.3.14.174> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-ose-3.1-rpms
changed: [casl-vvaldez-3HQ1hpq2-node1] => (item=rhel-7-server-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-rpms"], "delta": "0:00:05.931996", "end": "2016-04-27 18:03:05.498773", "item": "rhel-7-server-rpms", "rc": 0, "start": "2016-04-27 18:02:59.566777", "stderr": "", "stdout": "Repository 'rhel-7-server-rpms' is enabled for this system.", "warnings": []}
<10.3.14.173> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-ose-3.1-rpms
changed: [casl-vvaldez-3HQ1hpq2-master1] => (item=rhel-7-server-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-rpms"], "delta": "0:00:06.208944", "end": "2016-04-27 18:03:05.068151", "item": "rhel-7-server-rpms", "rc": 0, "start": "2016-04-27 18:02:58.859207", "stderr": "", "stdout": "Repository 'rhel-7-server-rpms' is enabled for this system.", "warnings": []}
<10.3.14.171> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-ose-3.1-rpms
changed: [casl-vvaldez-3HQ1hpq2-node2] => (item=rhel-7-server-ose-3.1-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-ose-3.1-rpms"], "delta": "0:00:06.279523", "end": "2016-04-27 18:03:12.902051", "item": "rhel-7-server-ose-3.1-rpms", "rc": 0, "start": "2016-04-27 18:03:06.622528", "stderr": "", "stdout": "Repository 'rhel-7-server-ose-3.1-rpms' is enabled for this system.", "warnings": []}
<10.3.14.174> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-extras-rpms
changed: [casl-vvaldez-3HQ1hpq2-node1] => (item=rhel-7-server-ose-3.1-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-ose-3.1-rpms"], "delta": "0:00:06.918137", "end": "2016-04-27 18:03:13.621381", "item": "rhel-7-server-ose-3.1-rpms", "rc": 0, "start": "2016-04-27 18:03:06.703244", "stderr": "", "stdout": "Repository 'rhel-7-server-ose-3.1-rpms' is enabled for this system.", "warnings": []}
<10.3.14.173> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-extras-rpms
changed: [casl-vvaldez-3HQ1hpq2-master1] => (item=rhel-7-server-ose-3.1-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-ose-3.1-rpms"], "delta": "0:00:07.742413", "end": "2016-04-27 18:03:14.061626", "item": "rhel-7-server-ose-3.1-rpms", "rc": 0, "start": "2016-04-27 18:03:06.319213", "stderr": "", "stdout": "Repository 'rhel-7-server-ose-3.1-rpms' is enabled for this system.", "warnings": []}
<10.3.14.171> REMOTE_MODULE command /usr/bin/subscription-manager repos --enable=rhel-7-server-extras-rpms
changed: [casl-vvaldez-3HQ1hpq2-node2] => (item=rhel-7-server-extras-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-extras-rpms"], "delta": "0:00:06.243236", "end": "2016-04-27 18:03:20.322408", "item": "rhel-7-server-extras-rpms", "rc": 0, "start": "2016-04-27 18:03:14.079172", "stderr": "", "stdout": "Repository 'rhel-7-server-extras-rpms' is enabled for this system.", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-node1] => (item=rhel-7-server-extras-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-extras-rpms"], "delta": "0:00:06.062598", "end": "2016-04-27 18:03:20.869193", "item": "rhel-7-server-extras-rpms", "rc": 0, "start": "2016-04-27 18:03:14.806595", "stderr": "", "stdout": "Repository 'rhel-7-server-extras-rpms' is enabled for this system.", "warnings": []}
changed: [casl-vvaldez-3HQ1hpq2-master1] => (item=rhel-7-server-extras-rpms) => {"changed": true, "cmd": ["/usr/bin/subscription-manager", "repos", "--enable=rhel-7-server-extras-rpms"], "delta": "0:00:06.614694", "end": "2016-04-27 18:03:21.860282", "item": "rhel-7-server-extras-rpms", "rc": 0, "start": "2016-04-27 18:03:15.245588", "stderr": "", "stdout": "Repository 'rhel-7-server-extras-rpms' is enabled for this system.", "warnings": []}
vvaldez commented 8 years ago

I realized this issue only occurs if you don't have rhsm_password set at all, in my case all my tests were using the default inventory file which has rhsm_password='' in it. This PR fixes this issue.