Do not make repos and autosubscribing mutually exclusive

Only add repos if rhsub_repos is defined instead of based on rhsub_autosubscribe.
This commit is contained in:
Sam Doran 2016-06-15 10:36:08 -04:00
parent fde32cacea
commit e6ac39334a
2 changed files with 5 additions and 5 deletions

View File

@ -17,8 +17,8 @@ Role Variables
| `rhn_username` | `{{ lookup('env', 'RHN_USERNAME') }}` | Red Hat Port username. |
| `rhn_password` | `{{ lookup('env', 'RHN_PASSWORD') }}` | Red Hat Portal password. |
| `rhsub_state` | `enable` | Whether to enable or disable a Red Hat subscription. |
| `rhsub_autosubscribe` | `True` | Whether or not to autosubscibe to available repositories. If set, will skip the task that manages individual repositories. |
| `rhsub_repos` | `{}` | List of repositories to enable or disable. See `defaults/main.yml` for examples. |
| `rhsub_autosubscribe` | `True` | Whether or not to autosubscibe to available repositories. |
| `rhsub_repos` | `[undefined]` | If defined, the list of repositories to enable or disable. See `defaults/main.yml` for examples. |
Dependencies
------------

View File

@ -4,7 +4,7 @@
tags:
- rhsub
- name: Register Red Hat subscription
- name: Manage Red Hat subscription
redhat_subscription:
username: "{{ rhn_username }}"
password: "{{ rhn_password }}"
@ -15,9 +15,9 @@
- rhsub_register
- name: Configure repository subscriptions
command: subscription-manage repos --{{ item.state }} --{{ item.name }}
command: subscription-manager repos --{{ item.state }} {{ item.name }}
with_items: "{{ rhsub_repos }}"
when: not rhsub_autosubscribe
when: rhsub_repos is defined
tags:
- rhsub
- rhsub_repos