-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from yrobla/master
Two fixes: update rhel mirror, isolate rhn subscription
- Loading branch information
Showing
6 changed files
with
69 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
- name: fail if no credentials are provided | ||
fail: | ||
msg: "Please define rhn_subscription_username, rhn_subscription_password and rhn_subscription_pool_id to enroll your system" | ||
when: rhn_subscription_username is undefined or rhn_subscription_username|bool == false or | ||
rhn_subscription_password is undefined or rhn_subscription_password|bool == false or | ||
rhn_subscription_pool_id is undefine or rhn_subscription_password|bool == false | ||
|
||
- name: Unsubscribe previous system | ||
redhat_subscription: | ||
state: absent | ||
ignore_errors: true | ||
become: true | ||
|
||
- name: Cleanup previous systems | ||
command: "subscription-manager remove --all" | ||
changed_when: false | ||
become: true | ||
|
||
- name: Subscribe for RedHat systems | ||
redhat_subscription: | ||
state: present | ||
username: "{{ rhn_subscription_username }}" | ||
password: "{{ rhn_subscription_password }}" | ||
pool: "{{ rhn_subscription_pool_id }}" | ||
become: true | ||
changed_when: false | ||
|
||
- name: Attach to the desired pool | ||
command: "subscription-manager attach --pool={{ rhn_subscription_pool_id }}" | ||
become: true | ||
changed_when: false | ||
|
||
- name: Unsubscribe to previous repos | ||
command: "subscription-manager repos --disable=*" | ||
when: rhn_repos|length > 0 | ||
become: true | ||
|
||
- name: Subscribe to the list of desired repos | ||
command: "subscription-manager repos --enable {{ item }}" | ||
with_items: "{{ rhn_repos }}" | ||
when: rhn_repos|length > 0 | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters