Commit Graph

8 Commits (0eb6220672d16b009870d8296c3afaa836d876cb)

Author SHA1 Message Date
Dustin 24a0dfa750 samba-dc: Gather facts for all DCs
Since the `samba-dc.yml` playbook executes on a single host at a time,
if the fact cache is not current, only the facts for the current host
will be available.  This prevents some tasks, especially the
configuration of the trusted SSH host keys for `sysvolsync`, to have
incorrect data.  To avoid this, we need to explicitly gather facts for
all of the domain controllers before starting to configure any of them.
2024-06-23 10:43:15 -05:00
Dustin ffe972d79b r/samba-cert: Obtain LDAP/TLS cert via ACME
The *samba-cert* role configures `lego` and HAProxy to obtain an X.509
certificate via the ACME HTTP-01 challenge.  HAProxy is necessary
because LDAP server certificates need to have the apex domain in their
SAN field, and the ACME server may contact *any* domain controller
server with an A record for that name.  HAProxy will forward the
challenge request on to the first available host on port 5000, where
`lego` is listening to provide validation.

Issuing certificates this way has a couple of advantages:

1. No need for the wildcard certificate for the *pyrocufflink.blue*
   domain any more
2. Renewals are automatic and handled by the server itself rather than
   Ansible via scheduled Jenkins job

Item (2) is particularly interesting because it avoids the bi-monthly
issue where replacing the LDAP server certificate and restarting Samba
causes the Jenkins job to fail.

Naturally, for this to work correctly, all LDAP client applications
need to trust the certificates issued by the ACME server, in this case
*DCH Root CA R2*.
2024-06-12 18:33:24 -05:00
Dustin 73499e3593 samba-dc: Do not apply sudo role
The *sudo* role should not be applied by the `samba-dc.yml` playbook.
It's not relevant to deploying Samba, and will just get applied by the
`domain-controller.yml` playbook later, anway.  Further, it fails when
a new domain controller is first provisioned, because at this step,
the system is not yet configured to resolve user IDs via winbind;
rather than add users to groups, it tries to create them.
2023-10-27 17:57:20 -05:00
Dustin 90f9e5eba5 samba-dc: Manage sudoers
Domain controllers only allow users in the *Domain Admins* AD group to
use `sudo` by default.  *dustin* and *jenkins* need to be able to apply
configuration policy to these machines, but they are not members of said
group.
2022-12-23 08:47:31 -06:00
Dustin f0a70c70e5 samba-dc: Install dch-selinux
The *dch-selinux* package contains a SELinux policy module for Samba AD
DC.  This policy defines a `samba_t` domain for the `samba` process.
While the domain is (currently) unconfined, it is necessary in order to
provide a domain transition rule for `winbindd`.  Without this rule,
`winbindd` would run in `unconfined_service_t`, which causes its IPC
pipe files to be incorrectly labelled, preventing other confined
services like `sshd` from accessing them.
2022-12-23 06:54:28 -06:00
Dustin 9d3c5c0da7 samba-dc: Apply to one machine at a time
Avoid accidentally taking down the whole domain with a bad task.  It'll
fail on one DC and never change the other(s).
2021-11-07 16:20:03 -06:00
Dustin 5a91cb731a samba-dc: Configure samba4 winbind
The *samba-dc* role now configures `winbindd` on domain controllers to
support identity mapping on the local machine. This will allow domain
users to log into the domain controller itself, e.g. via SSH.

The Fedora packaging of *samba4* still has some warts. Specifically, it
does not have a proper SELinux policy, so some work-arounds need to be
put into place in order for confined processes to communicate with
winbind.
2018-03-11 18:16:17 -05:00
Dustin ac354643c5 samba-dc: Playbook to deploy Samba AD DCs
The `samba-dc.yml` playbook simply applies the *samba-dc* role to
managed nodes in the *samba-dc* host group.
2018-01-29 15:07:24 -06:00