|
1 | 1 | # sssd.service needs /etc/sssd/sssd.conf to start |
2 | | -if [ ! -f /etc/sssd/sssd.conf ]; then |
3 | | - cat << EOF > /etc/sssd/sssd.conf |
4 | | -[sssd] |
5 | | -config_file_version = 2 |
6 | | -services = nss, pam |
7 | | -domains = example.com |
| 2 | +SSSD_CONF="/etc/sssd/sssd.conf" |
| 3 | +SSSD_CONF_DIR="/etc/sssd/conf.d" |
| 4 | +{{{ bash_sssd_ensure_default_config("$SSSD_CONF", "$SSSD_CONF_DIR") }}} |
8 | 5 |
|
9 | | -[domain/example.com] |
10 | | -{{%- if ('rhel' in product or 'ol' in families) and product not in ['ol8', 'ol9', 'rhel8', 'rhel9']%}} |
11 | | -id_provider = proxy |
12 | | -proxy_lib_name = files |
13 | | -local_auth_policy = only |
14 | | -{{%- else %}} |
15 | | -id_provider = files |
16 | | -access_provider = simple |
17 | | -simple_allow_users = user1, user2 |
| 6 | +{{%- if ('rhel' in product or 'ol' in families) and product not in ['ol7', 'ol8', 'ol9', 'rhel8', 'rhel9']%}} |
| 7 | +{{{ bash_ensure_ini_config("$SSSD_CONF $SSSD_CONF_DIR/*.conf", "pam", "pam_cert_auth", "True") }}} |
18 | 8 | {{%- endif %}} |
19 | 9 |
|
20 | | -[nss] |
21 | | -filter_groups = root |
22 | | -filter_users = root |
23 | | -
|
24 | | -[pam] |
25 | | -{{%- if ('rhel' in product or 'ol' in families) and product not in ['ol8', 'ol9', 'rhel8', 'rhel9']%}} |
26 | | -pam_cert_auth = True |
| 10 | +{{%- if product in ["fedora"] or (('rhel' in product or 'ol' in families) and product not in ['ol7', 'ol8', 'ol9', 'rhel8', 'rhel9']) %}} |
| 11 | +{{{ bash_package_install("sssd-proxy") }}} |
| 12 | +authselect select sssd with-smartcard |
| 13 | +chmod 0640 $SSSD_CONF |
| 14 | +{{%- else %}} |
| 15 | +chmod 0600 $SSSD_CONF |
27 | 16 | {{%- endif %}} |
28 | | -EOF |
29 | | - {{%- if ('rhel' in product or 'ol' in families) and product not in ['ol8', 'ol9', 'rhel8', 'rhel9']%}} |
30 | | - dnf install sssd-proxy -y |
31 | | - authselect select sssd with-smartcard |
32 | | - chmod 0640 /etc/sssd/sssd.conf |
33 | | - {{%- else %}} |
34 | | - chmod 0600 /etc/sssd/sssd.conf |
35 | | - {{%- endif %}} |
36 | | -fi |
0 commit comments