-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkatello_agent.yml
84 lines (78 loc) · 2.77 KB
/
katello_agent.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
- name: Install/Upgrade Katello-Agents and dependencies, bring up goferd service for RHEL 6 & 7
hosts: all
become: true
tasks:
# - name: 1Remove previous version of installed katello-ca-consumer
# yum:
# name: katello-ca-consumer-satelite.example.com-1.0-1.noarch
# state: absent
# ignore_errors: yes
# - name: 2Remove previous version of installed katello-ca-consumer
# yum:
# name: katello-ca-consumer-satelite.example.com-1.0-2.noarch
# state: absent
# ignore_errors: yes
# - name: 3Remove previous version of installed katello-ca-consumer
# yum:
# name: katello-ca-consumer-satelite.example.com-1.0-3.noarch
# state: absent
# ignore_errors: yes
# - name: Installing Latest katello-ca-consumer
# command: 'rpm -ivh http://satelite.example.com/pub/katello-ca-consumer-satelite.example.com-1.0-4.noarch.rpm'
# ignore_errors: yes
- name: unset the release version for RHEL 6
command: 'subscription-manager release --unset'
when:
- ansible_distribution_major_version == "6"
- name: set the release version for RHEL 7
command: 'subscription-manager release --set=7.4'
when:
- ansible_distribution_major_version == "7"
- name: Refresh repos
command: 'subscription-manager repos'
when:
- ansible_distribution_major_version == "6" and ansible_distribution_major_version == "7"
- name: Disable all repos
command: 'subscription-manager repos --disable=*'
- name: Install Katello-Agent for RHEL 6
yum:
name: katello-agent
state: latest
enablerepo: rhel-6-server-satellite-tools-6.3-rpms
notify:
- restart_goferd
when:
- ansible_distribution_major_version == "6"
- name: Install virt-who for RHEL 6
yum:
name: virt-who
state: latest
enablerepo: rhel-6-server-satellite-tools-6.3-rpms,rhel-6-server-rpms
when:
- ansible_distribution_major_version == "6"
- name: Install Katello-Agent for RHEL 7
yum:
name: katello-agent
state: latest
enablerepo: rhel-7-server-satellite-tools-6.3-rpms
notify:
- restart_goferd
when:
- ansible_distribution_major_version == "7"
- name: Install virt-who for RHEL 7
yum:
name: virt-who
state: latest
enablerepo: rhel-7-server-satellite-tools-6.3-rpms,rhel-7-server-rpms
when:
- ansible_distribution_major_version == "7"
- name: set the release version for RHEL 6
command: subscription-manager release --set=6.8
when:
- ansible_distribution_major_version == "6"
handlers:
- name: restart_goferd
service:
name: goferd
state: restarted