Commit Graph

420 Commits (c135700d85eedecf15e120c40cd752b97a2070c5)

Author SHA1 Message Date
Dustin f16b7557cd roles/sudo: Configure sudo and policy
The *sudo* role installs `sudo` and configures policy for it. By
default, users who are members of the *sudo* group can run any command
as root.
2018-03-11 18:16:17 -05:00
Dustin 0fa0c2f66e roles/system-auth: Configure PAM system authentication
The *system-auth* role deploys PAM configuration for system-wide user
authentication. It is specifically focused on Active Directory
authentication using Samba/Winbind.
2018-03-11 18:16:17 -05:00
Dustin 7217c1c8a0 roles/nsswitch: Configure glibc name service
The *nsswitch* role can be used to configure the name service switch on
glibc-based distributions, including Gentoo, Fedora, and CentOS. It is
specifically focused on Active Directory authentication via
Samba/Winbind.
2018-03-11 18:16:17 -05:00
Dustin 5ed1b23321 roles/named: Set minimal responses
Including authority and additional responses in all responses is just a
waste of bandwidth.
2018-02-21 22:40:40 -06:00
Dustin 3473694eb0 roles/named: Improve support for other zone types
Only *master* zones need zone files pre-populated, as the other types of
zones are populated by data named receives from queries and transfers.
Other types of zones require other options, however, to be usable. This
commit introduces minimal support for specifying *slave*, *forward*, and
*stub* zones.
2018-02-21 22:33:52 -06:00
Dustin 83817ca340 roles/bind: Simplify zone allow-update settings
Items in the `allow_update` property can use the address match list
syntax to specify arbitrary restrictions, including TSIG key names.
There is really no need for a special case for key names.
2018-02-21 22:28:35 -06:00
Dustin eca967c8b3 roles/named: Support managing TSIG keys
To support signing of updates, TSIG keys can be defined using the
`named_keys` variable. This variable takes a list of objects with the
following properties:

* `name`: The name of the key
* `algorithm`: The signature algorithm (default: `hmac-md5`)
* `secret`: The base64-encoded key material
2018-02-20 16:12:23 -06:00
Dustin 0629a063bc roles/named: Support managing zones
The *named* role now supports generating configuration for authoritative
DNS zones and DNSSEC keys. Zones are defined by populating the
`named_zones` variable with a list of objects describing the zone. Zone
properties can include:

* `name`: The DNS domain name
* `type`: The zone type, defaults to `master`
* `allow_update`: A list of hosts/networks or DNSSEC key names (which
  must be specified as an object with a `key` property)
* `update_policy`: A list of BIND update policy statements
* `ttl`: The default (minimum) TTL for the zone
* `origin`: The authoritative name server for the zone
* `refresh`, `retry`, `expire`: Record cache timeout values
* `default_records`: A list of default records, defined as objects with
  the following properties:
  * `name`: The RR name
  * `type`: The RR type (default: `A`)
  * `value`: The RR value

Zone files will be created in `/var/named/dynamic`. Existing zone files
will **not** be overwritten; management of zone records is done using
`nsupdate` or similar.
2018-02-20 16:12:05 -06:00
Dustin 7144701787 roles/named: Add missing variable defaults 2018-02-20 13:25:10 -06:00
Dustin efbb563670 roles/samba-dc: Conditionally configure BIND9_DLZ
This commit adjusts the tasks in the *samba-dc* role to use a
conditional include to restrict tasks relating to the BIND9_DLZ plugin
only to hosts that are configured to use it.
2018-02-19 22:46:27 -06:00
Dustin 03ef6a402a roles/samba: Add some management tools
The *bind-utils* package contains `dig` and `nsupdate`, which are used
to query and manage DNS records.

The *cyrus-sasl-gssapi* package contains the GSSAPI plugin for
SASL-aware applications, including `ldapsearch`.

The *ldb-tools* package contains `ldbsearch` and other tools for
directly using Samba database files.
2018-02-18 13:14:35 -06:00
Dustin f458a46e3f roles/samba-dc: Additional BIND SELinux contexts
The `/var/lib/samba/bind-dns` directory contains files that are
hard-linked to files in the `/var/lib/samba/private` directory. All
paths for a file must have the same context, or `restorecon` will
effectively "toggle" the labels each time it is run.
2018-02-18 13:10:31 -06:00
Dustin 94154a9f2b roles/samba-dc: Correct restorecon path
Evidently, some files in `/var/lib/samba` match multiple file context
rules. Thus, when running `restorecon` against the entire
`/var/lib/samba` directory, files in the `bind-dns` subdirectory may end
up with the wrong label. To work around this issue, `restorecon` is now
run only on that subdirectory to ensure the correct labels are applied.

This is likely to cause problems when a full filesystem relabel is
scheduled.
2018-02-18 10:09:57 -06:00
Dustin 7191903801 roles/named: Restart daemon after modifying config
The `named` daemon does not seem to pick up all changes to the
configuration file during a graceful reload. To avoid strange states,
the daemon is now fully restarted after the configuration file is
regenerated.
2018-02-18 10:09:57 -06:00
Dustin f5b922265b roles/named: Add allow-update block to named.conf
The `allow-update` block in `named.conf` enumerates the hosts/networks
that are allowed to issue dynamic DNS updates. This is required in
Active Directory and other environments where clients and/or DHCP
servers create DNS records automatically.

By default, the block is omitted from the generated configuration file.
The `named_allow_update` variable can be set to a list of patterns (e.g.
CIDR blocks, ACL names, etc.) to populate it.
2018-02-18 10:04:27 -06:00
Dustin cb7c36d65a roles/samba-dc: Support joining existing domain
The *samba-dc* role now supports joining an existing Active Directory
domain as an additional domain controller. The `samba_is_first_dc` variable
controls whether the machine will be provisioned with a new domain (when
true) or added to an existing domain (when false).

Joining an existing domain naturally requires credentials of a user with
permission to add a new DC, the `samba_dc_join_username` and
`samba_dc_join_password` variables can be used to specify them.
Alternatively, if these variables are not defined, then the process will
attempt to use Kerberos credentials. This would require playbooks to
make a ticket-granting-ticket available somehow, such as by executing
`kinit` prior to applying the *samba-dc* role.
2018-01-29 15:11:07 -06:00
Dustin b493d81cfa roles/named: Deploy BIND DNS server
The *named* role configures the BIND DNS server on managed nodes. It
writes `/etc/named.conf`, using a template that supports most of the
commonly-used options. The configuration can be augmented by other
templates, etc. by specifying file paths in the `named_options_include`
or `named_global_include` variables, both of which are lists.
2018-01-29 15:07:31 -06:00
Dustin 42ce2434ad roles/samba-dc: Deploy a Samba AD DC
The *samba-dc* role installs Samba on the managed node and configures it
as an Active Directory Domain controller. A custom module,
`samba_domain` handles the provisioning using `samba-tool domain
provision` in an idempotent way.
2018-01-29 15:07:15 -06:00
Dustin ec524416c6 roles/kerberos: Configure mit-krb5
The *kerberos* role configures the MIT Kerberos library.  Specifically,
it creates `/etc/krb5.conf` and populates it with some basic default
options. It also creates the `/etc/krb5.conf.d` directory, into which
other roles can write additional configuration files.
2018-01-29 15:05:51 -06:00
Dustin b870daff58 roles/base: Basic config management support
The *base* role performs the basic tasks needed to manage a node using
Ansible. Specifically, it installs the necessary packages for
manipulating SELinux policy.
2018-01-29 15:02:10 -06:00