-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathprepare-rhel.yml
67 lines (60 loc) · 1.77 KB
/
prepare-rhel.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
---
- hosts: all
become: true
vars:
force_register: false
install_pkgs_list:
- tmux
- vim
- insights-client
register_insights: true
epel: false
# https://access.redhat.com/articles/simple-content-access
# XXX someone figure out how to simplify subs process by using sca
# Currently it's both slow and risky.
sca: true
tasks:
- name: Subscribe to Red Hat
redhat_subscription:
state: present
username: "{{ rh_subs_username }}"
password: "{{ rh_subs_password }}"
autosubscribe: false
force_register: "{{ force_register }}"
tags: subs
- name: Enable required repositories
rhsm_repository:
# yamllint disable-line rule:line-length
name: "{{ enabled_repos_rhel[ ansible_facts['distribution_major_version'] ] }}"
state: enabled
tags: regs
- name: Add codeready builder for epel
rhsm_repository:
name: codeready-builder-for-rhel-8-x86_64-rpms
state: enabled
when: epel | bool
tags: regs
- name: Install Epel repos
yum:
# yamllint disable-line rule:line-length
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts['distribution_major_version'] }}.noarch.rpm"
state: present
disable_gpg_check: true
when: epel | bool
tags: regs
- name: install stuff
yum:
name: "{{ install_pkgs_list }}"
state: present
tags: packages
- name: register insights
command: insights-client --register
args:
removes: /etc/insights-client/.unregistered
tags: insights
- name: enable insights
systemd:
name: insights-client
state: started
enabled: true
tags: insights