From e6ac39334aadb46165489a0118f1325bb42ba9ba Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Wed, 15 Jun 2016 10:36:08 -0400 Subject: [PATCH] Do not make repos and autosubscribing mutually exclusive Only add repos if rhsub_repos is defined instead of based on rhsub_autosubscribe. --- README.md | 4 ++-- tasks/main.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4e8af14..dfa2d43 100644 --- a/README.md +++ b/README.md @@ -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 ------------ diff --git a/tasks/main.yml b/tasks/main.yml index e743776..c87f111 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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