-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollback.yml
57 lines (48 loc) · 1.36 KB
/
rollback.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
- hosts: all
vars_files:
- ./vars.yml
tasks:
- name: Uninstall Katello Agent
yum:
state: absent
name: katello-agent
- name: Unregister from Satellite 6
redhat_subscription:
state: absent
ignore_errors: true
- name: Check for existing katello-ca-consumer package, remove it when exist
package:
name: katello-ca-consumer*
state: absent
- name: Check if /etc/yum/pluginconf.d/rhnplugin.conf exists
stat:
path: /etc/yum/pluginconf.d/rhnplugin.conf
register: stat_result
- name: Enable RHN yum Plugin if rhnplugin.conf exists
lineinfile:
path: /etc/yum/pluginconf.d/rhnplugin.conf
regexp: '^enabled'
line: 'enabled=1'
when: stat_result.stat.exists
- name: Check Sat5 systemid backup file)
stat:
path: /etc/sysconfig/rhn/systemid.backup
register: stat_result
- name: Restore /etc/sysconfig/rhn/systemid
copy:
remote_src: true
src: /etc/sysconfig/rhn/systemid.backup
dest: /etc/sysconfig/rhn/systemid
mode: "0644"
when: stat_result.stat.exists
- name: Disable RHSM plugin
lineinfile:
path: /etc/yum/pluginconf.d/subscription-manager.conf
regexp: '^enabled'
line: 'enabled=0'
when: stat_result.stat.exists
- name: Remove obsolete Yum Cache Directory
file:
path: /var/cache/yum
state: absent