forked from wshen88/aap4ocpv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path22-add_repos.yml
More file actions
52 lines (46 loc) · 1.76 KB
/
22-add_repos.yml
File metadata and controls
52 lines (46 loc) · 1.76 KB
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
---
- name: "Config yum repository for RHEL 9 VMs"
hosts: all
gather_facts: false
vars:
vm_namespace: wm-test
vm_env_id: store-dev
vm_db_suffix: db
vm_db_name: "{{ vm_env_id }}-{{ vm_db_suffix }}"
vm_app_suffix: app
vm_app_name: "{{ vm_env_id }}-{{ vm_app_suffix }}"
vm_hosts:
- "{{ vm_namespace }}-{{ vm_env_id }}-{{ vm_db_suffix }}"
- "{{ vm_namespace }}-{{ vm_env_id }}-{{ vm_app_suffix }}"
tasks:
#- name: Print created hostname
# ansible.builtin.debug:
# var: vm_hosts
- name: "Configure BaseOS repository for RHEL 9"
ansible.builtin.yum_repository:
name: rhel9-baseos
baseurl: http://10.66.208.72/repos/rhel-9-for-x86_64-baseos-rpms
enabled: yes
gpgcheck: no
description: "BaseOS repo for RHEL 9"
when: inventory_hostname in vm_hosts
- name: "Configure AppStream repository for RHEL 9"
ansible.builtin.yum_repository:
name: rhel9-apps
baseurl: http://10.66.208.72/repos/rhel-9-for-x86_64-appstream-rpms
enabled: yes
gpgcheck: no
description: "AppStream repo for RHEL 9"
when: inventory_hostname in vm_hosts
#- ansible_facts['os_family'] == "RedHat"
#- ansible_facts['distribution_major_version'] == "9"
#- inventory_hostname in vm_hosts
- name: Disable IPV6 setting
ansible.builtin.command: nmcli connection modify "System eth0" ipv6.method "disabled"
when: inventory_hostname in vm_hosts
- name: Restart connection
ansible.builtin.command: nmcli connection up "System eth0"
when: inventory_hostname in vm_hosts
- name: Ensure all repositories are cleaned and refreshed
ansible.builtin.command: yum clean all
when: inventory_hostname in vm_hosts