Commit Graph

247 Commits (a810e9c69179b9593e038ee96ea82554044f83d9)

Author SHA1 Message Date
Dustin a810e9c691 roles/cronie: Install cronie
The minimal Fedora installation does not include a cron implementation.
The *cronie* role can be applied to hosts installed in this way to
ensure that cron is available for task scheduling.
2018-08-08 21:38:56 -05:00
Dustin 47999302cf roles/dch-vpn-server: Update remote access DNS
This commit updates the DNS server addresses pushed to remote access VPN
clients to use the new DNS server on the *pyrocufflink.blue* network.
2018-08-08 21:37:30 -05:00
Dustin 06b2d3163b hosts: Add burp0.p.b
The machine *burp0.pyrocufflink.blue* runs a BURP server.
2018-08-08 20:14:40 -05:00
Dustin 7ebc2bdfa2 burp-{client,server}: PBs to deploy BURP
The `burp-client.yml` and `burp-server.yml` playbooks apply the
*burp-client* and *burp-server* roles to BURP clients and servers,
respectively. The server playbook also applies the *postfix* role to
ensure that SMTP is configured and backup notifications can be sent.
2018-08-08 20:14:25 -05:00
Dustin b7fafa6734 roles/burp-client: Deploy BURP client
The *burp-client* role installs and configures a BURP client. It should
support RHEL/CentOS/Fedora and Gentoo.

To manage the client password and other server-mandated configuration,
the role uses Ansible's delegation feature to generate a configuration
file in the "clientconfdir" on the BURP server.

An hourly cron task is scheduled that runs `burp -a t` every hour. This
allows the server to configure backup timebands and intervals.
2018-08-08 20:11:46 -05:00
Dustin ddd7031624 roles/burp-server: Deploy BURP server
The *burp-server* role installs and configures a BURP server. It is
adapted from a previous iteration, and should support CentOS/RHEL/Fedora
and Gentoo, as well as both BURP 1.x and 2.x (depending on which version
gets installed by the system package manager).

To manage the certificate authority, the *burp-server* role uses the
`burp_ca` command. This has the advantage of not requiring any external
certificate management, but effectively binds the CA to a specific
machine.
2018-08-08 20:08:16 -05:00
Dustin 241f9d6afa all: Set SMTP relay
All machines (except the relay itself of course) should use the
*mail.pyrocufflink.blue* SMTP relay to send email.
2018-08-07 20:04:09 -05:00
Dustin 0a975ae4af roles/postfix: Vary shlib directory by arch
The value of the `shlib_directory` is dependent the system architecture.
Specifically, x86_64 machines use `/usr/lib64/postfix`, while everything
else uses `/usr/lib/postfix`. This role was originally deployed on a
Raspberry Pi, so the original path was correct. Attempting to deploy it
on an x86_64 machine revealed the error.

This commit adds a new task that loads a variables file based on the
architecture. Each option defines an `arch_libdir` variable, which can
be expanded in the `postfix_shlib_directory` variable as needed.
2018-08-07 19:51:09 -05:00
Dustin ee6523faf6 pyrocufflink-dns: Correct IPv6 reverse zones
The zone names and forwarder addresses for IPv6 reverse lookups were
incorrect. This caused long timeouts when resolving IPv6 addresses, e.g.
for SSH.
2018-08-07 18:46:43 -05:00
Dustin 171edd72d9 hosts: Move vmhost1.p.b to hosts.offline
Because *vmhost1.pyrocufflink.blue* is usually sleeping, continuous
enforcement jobs always fail. By keeping it in a separate inventory
file, configuration policy can still be applied to it manually, but it
will be ignored by continuous enforcement.
2018-08-04 11:31:40 -05:00
Dustin b415c0403e dch-gw: Forward port 22 to file0 2018-08-03 00:27:44 -05:00
Dustin 4d45d727cb roles/dch-proxy: Remove backend myala
*myala.pyrocufflink.jazz* no longer hosts any public-facing websites,
and is in fact shut down. To prevent HAproxy from failing to start
because it cannot resolve the name, this backend needs to be removed.
2018-08-03 00:27:32 -05:00
Dustin cff7789862 dch-gw: Add DHCP lease for file0.p.b
It is necessary for the file server to have a static address in order
for port forwarding for SSH to work.
2018-08-02 20:42:33 -05:00
Dustin a58b0f6523 Add SSH host key for web0 2018-08-01 22:29:40 -05:00
Dustin 507eec6565 ci: dch-gw: Limit dhcpcd PB to dch-gw
To avoid applying configuration to hosts besides the gateway, the
`dhcpcd.yml` playbook needs to be limited.
2018-08-01 22:13:53 -05:00
Dustin b4bcb12750 Add SSH host keys for vmhost0, vmhost1 2018-08-01 22:11:40 -05:00
Dustin 69a7e869b4 hosts: Add file0.p.b 2018-08-01 22:11:40 -05:00
Dustin 155cb091f4 fileserver: PB to deploy fileserver role 2018-08-01 22:08:24 -05:00
Dustin 4aded1e75c pyrocufflink: Ensure Samba security is correct
Usually, the *samba* role is deployed as a dependency of the *winbind*
role, which explicitly sets `samba_security` to `ads`. The new
*fileserver* role also depends on the *samba* role, but it does NOT sett
that variable. This can cause `smb.conf` to be rewritten with a
different value whenever one or the other role is applied.

Explicitly setting the `samba_security` variable at the group level
ensures that the value is consistent no matter how the *samba* role is
applied. Since all domain member machines need the same value,
regardless of what function they perform, this is safe.
2018-08-01 22:05:18 -05:00
Dustin 84a5d66b7a roles/fileserver: Deploy Samba file server
The *fileserver* role configures Samba as a file sharing server. It uses
the *samba* role to handle cross-distribution installation of Samba
itself, and is focused primarily on configuring shared folders.
2018-08-01 22:04:07 -05:00
Dustin f078522d97 roles/vmhost: Open libvirt migration firewall port 2018-07-29 10:39:36 -05:00
Dustin da79e8482c vmhost1: Update net-ifaces script 2018-07-29 10:39:12 -05:00
Dustin a95937d111 roles/dch-storage-net: Add After device dependency
This commit adds an *after* ordering dependency on the network device
unit to the *wait-global-address@.service* template unit. Without this
dependency, the service will wait forever for a global address if the
device does not exist. With the dependency, though, if the device does
not appear within the default timeout, the wait service will never
start, causing all dependent services to fail, but allowing the boot
process to continue.
2018-07-29 10:14:00 -05:00
Dustin 131c872d32 Merge remote-tracking branch 'refs/remotes/origin/master' 2018-07-29 10:02:28 -05:00
Dustin 9bf2a911c6 roles/dch-proxy: Switch default backend to web0.p.b
The public-facing websites are now hosted by *web0.pyrocufflink.blue*
and *myala.pyrocufflink.jazz* has been decommissioned.
2018-07-29 09:41:10 -05:00
Dustin 67fc5c8c05 hosts: Add web0.p.b
*web0.pyrocufflink.blue* hosts the public-facing websites
2018-07-29 09:39:02 -05:00
Dustin 2d8418c7a7 websites: PB to deploy public-facing websites 2018-07-29 09:37:47 -05:00
Dustin 33ee3bf08d websites: Add role for darkchestofwonders.us
The *websites/darkchestofwonders.us* role prepares a machine to host
http://darkchestofwonders.us/. The website itself is published via rsync
by Jenkins.
2018-07-29 09:34:41 -05:00
Dustin 1f16b4c3e4 websites: Add role for nratonpass.com
The *websites/nratonpass.com* role prepares a machine to host
http://nratonpass.com/. The website itself is published via rsync by
Jenkins.
2018-07-29 09:34:21 -05:00
Dustin ae5d8bee56 websites: Add role for ebonfire.com
The *websites/ebonfire.com* role prepares a machine to host
http://ebonfire.com/. The website itself is published via rsync by
Jenkins.
2018-07-29 09:33:31 -05:00
Dustin 3d46e6b411 websites: Add role for dustin.hatch.name
The *websites/dustin.hatch.name* role configures a server to host
http://dustin.hatch.name/. The role only applies basic configuration;
the actual website application is published by Jenkins.
2018-07-29 09:32:19 -05:00
Dustin 4a5d319a17 roles/certbot: Reload Apache before cert requests
The Apache service needs to be reloaded after the *certbot* role
configures it to serve the `/.well-known/acme-challenge` path, so that
the changes can take effect before the `certbot` command is run to
request the certificate(s).
2018-07-29 09:28:12 -05:00
Dustin 9f5f692b6a roles/apache: Do not start Apache
If another role that depends on the *apache* role accidentally creates
an invalid configuration, it will be impossible to correct it by
subsequent invocations of its playbook. This is because the *apache*
role always tries to start the service, which will fail if the
configuration is invalid, thus aborting the playbook. With this early
abort, there is no way for later tasks to correct the error.

Playbooks that include the *apache* role should have a task that is
executed after all the roles have been applied to ensure the service is
running.
2018-07-29 09:25:54 -05:00
Dustin e8f9f48bfd roles/winbind: Actually perform domain join 2018-07-26 16:54:03 -05:00
Dustin 11dc40bc76 hosts: Add vmhost{0,1}.p.b 2018-07-23 17:35:10 -05:00
Dustin a8dd2e9ec3 vmhost: PB to set up VM hosts 2018-07-23 17:35:10 -05:00
Dustin f8ae016042 roles/dch-storage-net: Set up/mount shared storage
The *dch-storage-net* role configures a machine to connect the storage
network and mount shared folders from the storage appliance.

The `wait-global-address.sh` script and corresponding
*wait-global-address@.service* systemd unit template are necessary to
ensure that the storage network is actually available before attempting
to mount the shared volumes. This is particularly important at boot,
since `dhcpcd` does not implement any kind of signaling that can be used
by *network-online.target*, so the network is considered "online" as
soon as the `dhcpcd` process has started. This typically results in
"network unreachable" errors.
2018-07-23 17:35:10 -05:00
Dustin abd05f8443 roles/vmhost: Configure libvirtd+QEMU
The *vmhost* role installs and configures the libvirt daemon to host
QEMU/KVM virtual machines.
2018-07-23 17:35:10 -05:00
Dustin 82e8f7f9e7 net-ifaces: PB to apply net-ifaces role 2018-07-23 17:35:10 -05:00
Dustin 704850caa9 roles/net-ifaces: Configure virtual net interfaces
The *net-ifaces* role manages a script that creates virtual network
interfaces, such as bridge, bond, and VLAN, that `dhcpcd`/`dhclient`
alone cannot. This provides a lightweight alternative to
*systemd-networkd* and *NetworkMangager*.
2018-07-23 17:35:10 -05:00
Dustin 44a82688e4 roles/dhcpcd: Always send FQDN
Though the default for the `fqdn` value is listed as `both` in
*dhcpcd.conf(5)*, the current behavior of `dhcpcd` suggests that it may
actually be `none`. Without explicitly setting `fqdn both`, the value of
the kernel node name is sent as-is in the *hostname* option (12). If the
node name is set to the FQDN, then dynamic DNS gets broken, since the
DHCP server always appends its domain name to the provided hostname.
Setting `fqdn both` causes `dhcpcd` to send the FQDN in the *FQDN*
option (81), which the DHCP server interprets correctly.
2018-07-23 17:35:10 -05:00
Dustin 1302cd8825 roles/dhcpcd: Use a list for allow/deny interfaces
Using a list to specify the values for the `allowinterfaces` and
`denyinterfaces` parameters in `dhcpcd.conf` makes the configuration
policy cleaner and more type-safe.
2018-07-23 17:35:10 -05:00
Dustin 620fcc79b8 dch-network: Use dc0.p.b for NTP on test network 2018-07-23 17:35:10 -05:00
Dustin a3b0349b4c roles/freeradius: Enable/start service
The *radiusd* service needs to be set to start on boot, lest the WiFi
goes down when the server is rebooted!
2018-07-23 12:25:14 -05:00
Dustin 9cf4111af7 gw0: Set dhcpcd_nodev
Disabling device management in `dhcpcd` avoids the "received NULL
device" log spam.
2018-07-20 17:47:04 -05:00
Dustin da2d73b676 roles/dhcpcd: Disable device management module
Today I realized that `dhcpcd` has been logging several hundred thousand
of these messages every second:

    libudev: received NULL device

This was causing both `dhcpcd` and `systemd-journald` to consume 100%
CPU.

I am not entirely sure what a "device management" module is in the
context of `dhcpcd`, but it does not seem to be required. Setting the
`nodev` option in `dhcpcd.conf` suppresses the messages, and seems to
have no effect on the operation of the daemon.
2018-07-20 17:46:47 -05:00
Dustin c88ee8bd99 dch-gw: Restrict traffic from Management network
Traffic from the management network is not allowed except for specific
services. NTP is required of course, for time synchronization with the
pyrocufflink.blue domain controllers. RADIUS is necessary for WiFi
authentication, which is also handled by the DCs.
2018-07-15 12:16:43 -05:00
Dustin d6b4e4a098 dch-network: Add NTP servers for Management net 2018-07-15 09:42:22 -05:00
Dustin 5f65864d3a dch-network: Correct Management router interface 2018-07-15 09:41:46 -05:00
Dustin 44552dcd4a dch-gw: Add DHCP reservation for unifi0
The UniFi controller has been moved to a Raspberry Pi on the Management
network. This machine needs a static address to use in the "inform URL"
it sends to managed devices.
2018-07-15 09:19:53 -05:00