Our local school has been running RHEL clones since 2010 : CentOS 5, 6, and 7. Currently it’s a mix of Rocky Linux 8 and 9.
For central authentication we’ve always been using NIS (ypserv). I know it’s considered obsolete and has been removed from RHEL 9. But its bone-headed configuration has worked well these past 15 years.
I’m currently writing an Ansible playbook to automate NIS configuration on Rocky Linux 8. I’m mostly using the procedure described here:
One of the first steps consists in defining the NIS domain using the following command:
# ypdomainname scholae.lan
I’d like to make this idempotent in Ansible, so I wonder what this command does under the hood. What file(s) does it create and/or alter under the hood ?
domainname, nisdomainname, ypdomainname will print the name of the system as returned by the getdomainname(2) function. This is also known as the YP/NIS domain name of the system.
and getdomainname() says that it calls uname().
You could strace ypdomainname xxx and/or grep -r xxx /etc ?