Skip to content

Commit c0af004

Browse files
authored
Adds RHEL9 support for freeipa_server and freeipa_client roles (#176)
Signed-off-by: Chuck Levesque <clevesque@cloudera.com>
1 parent 6dd9290 commit c0af004

File tree

7 files changed

+44
-8
lines changed

7 files changed

+44
-8
lines changed

roles/freeipa_client/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@
8989
{{ ansible_default_ipv4.address }} {{ inventory_hostname }} {{ inventory_hostname_short }}
9090
notify: restart host
9191

92+
- name: Check for existence of /etc/dhcp/dhclient.conf
93+
ansible.builtin.stat: path=/etc/dhcp/dhclient.conf
94+
register: dhclient_conf
95+
9296
- name: Set /etc/dhcp/dhclient.conf for domain search and name servers
9397
ansible.builtin.lineinfile:
9498
path: /etc/dhcp/dhclient.conf
@@ -103,6 +107,7 @@
103107
entries:
104108
domain_search: supersede domain-search "{{ ipaserver_domain }}";
105109
domain_name_servers: supersede domain-name-servers {{ ipa_server_ips | sort | union(fallback_nameservers) | join(', ') }};
110+
when: dhclient_conf.stat.exists
106111
notify: restart host
107112

108113
- name: Flush handlers

roles/freeipa_server/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@
2525
ipaserver_resolv_nameservers: [ '8.8.8.8' ]
2626
ipaserver_server_recursion: true
2727
enable_dns: false
28+
needs_python2: True

roles/freeipa_server/tasks/main.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,21 @@
3030
name: nss
3131
state: latest
3232

33-
- name: Install Python and supporting packages
33+
- name: Install Python2 when needed
3434
ansible.builtin.package:
3535
lock_timeout: 180
36-
name: "{{ __pyver_item }}"
36+
name: python2
3737
update_cache: yes
3838
state: present
39-
loop:
40-
- python3
41-
- python2
42-
loop_control:
43-
loop_var: __pyver_item
44-
39+
when: needs_python2
40+
41+
- name: Install Python3
42+
ansible.builtin.package:
43+
lock_timeout: 180
44+
name: python3
45+
update_cache: yes
46+
state: present
47+
4548
- name: Disable SELinux
4649
ansible.posix.selinux:
4750
state: disabled
@@ -110,6 +113,10 @@
110113
backup: yes
111114
notify: restart host
112115

116+
- name: Check for existence of /etc/dhcp/dhclient.conf
117+
ansible.builtin.stat: path=/etc/dhcp/dhclient.conf
118+
register: dhclient_conf
119+
113120
- name: Set /etc/dhcp/dhclient.conf for domain search and name servers
114121
ansible.builtin.lineinfile:
115122
path: /etc/dhcp/dhclient.conf
@@ -124,6 +131,7 @@
124131
entries:
125132
domain_search: supersede domain-search "{{ [[name_prefix, domain] | join('.'), domain] | join('", "') }}";
126133
domain_name_servers: supersede domain-name-servers 127.0.0.1, {{ ipaserver_resolv_nameservers | join(', ') }};
134+
when: dhclient_conf.stat.exists
127135
notify: restart host
128136

129137
- name: Flush handlers

roles/freeipa_server/vars/RedHat-7.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
# limitations under the License.
1616

1717
ipaserver_packages: [ "ipa-server", "libselinux-python" ]
18+
needs_python2: True

roles/freeipa_server/vars/RedHat-8.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
# limitations under the License.
1616

1717
ipaserver_packages: [ "@idm:DL1/server" ]
18+
needs_python2: True
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
3+
# Copyright 2023 Cloudera, Inc. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
ipaserver_packages: [ "ipa-server" ]
18+
ipaserver_packages_dns: [ "ipa-server-dns" ]
19+
needs_python2: False

roles/freeipa_server/vars/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
# limitations under the License.
1616

1717
ipaserver_packages: [ "ipa-server", "python3-libselinux" ]
18+
needs_python2: True

0 commit comments

Comments
 (0)