Make redhat_subscription parameters optional
Using default(omit), parameters not part of environment won't be sent to the module, so fully ignored. Indeed, username/password/state/autosubscribe are all optional. Change-Id: I3a81cdaccd2d90a43dec95d21b26d9ea503ed313
This commit is contained in:
parent
99c534dc3d
commit
4c77ba509d
|
@ -14,8 +14,8 @@ Role Variables
|
||||||
|
|
||||||
| Name | Default Value | Description |
|
| Name | Default Value | Description |
|
||||||
|-------------------|---------------------|----------------------|
|
|-------------------|---------------------|----------------------|
|
||||||
| `rhn_username` | `{{ lookup('env', 'RHN_USERNAME') }}` | Red Hat Portal username. |
|
| `rhn_username` | No default | Red Hat Portal username. |
|
||||||
| `rhn_password` | `{{ lookup('env', 'RHN_PASSWORD') }}` | Red Hat Portal password. |
|
| `rhn_password` | No default | Red Hat Portal password. |
|
||||||
| `rhsub_state` | `enable` | Whether to enable or disable a Red Hat subscription. |
|
| `rhsub_state` | `enable` | Whether to enable or disable a Red Hat subscription. |
|
||||||
| `rhsub_autosubscribe` | `yes` | Whether or not to autosubscibe to available repositories. |
|
| `rhsub_autosubscribe` | `yes` | 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. |
|
| `rhsub_repos` | `[undefined]` | If defined, the list of repositories to enable or disable. See `defaults/main.yml` for examples. |
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
rhn_username: "{{ lookup('env', 'RHN_USERNAME') }}"
|
# These parameters aren't required, so no default is provided:
|
||||||
rhn_password: "{{ lookup('env', 'RHN_PASSWORD') }}"
|
# rhn_username: joe
|
||||||
|
# rhn_password: secrete
|
||||||
|
|
||||||
rhsub_state: present # present or absent
|
rhsub_state: present # present or absent
|
||||||
rhsub_autosubscribe: True
|
rhsub_autosubscribe: True
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
|
|
||||||
- name: Manage Red Hat subscription
|
- name: Manage Red Hat subscription
|
||||||
redhat_subscription:
|
redhat_subscription:
|
||||||
username: "{{ rhn_username }}"
|
username: "{{ rhn_username|default(omit) }}"
|
||||||
password: "{{ rhn_password }}"
|
password: "{{ rhn_password|default(omit) }}"
|
||||||
state: "{{ rhsub_state }}"
|
state: "{{ rhsub_state|default(omit) }}"
|
||||||
autosubscribe: "{{ rhsub_autosubscribe }}"
|
autosubscribe: "{{ rhsub_autosubscribe|default(omit) }}"
|
||||||
tags:
|
tags:
|
||||||
- rhsub
|
- rhsub
|
||||||
- rhsub_register
|
- rhsub_register
|
||||||
|
|
Loading…
Reference in New Issue