Commit Graph

717 Commits (a3ea838cac41caa4532449151a0e2eede2223e21)

Author SHA1 Message Date
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
Dustin 9f89c4c835 Move APs to Management network
The UniFi access points are now connected to the Management network.
Their IP addresses have thus changed.
2018-07-15 09:19:39 -05:00
Dustin d811a9fe22 dch-gw: Add Management network
The Management network (VLAN 10, 172.30.0.240/28) will be used for
communication with and configuration of network devices including
switches and access points. This keeps configuration separate from
normal traffic, and allows complete isolation of infrastructure devices.
2018-07-15 09:15:26 -05:00
Dustin 6e77d3cf07 roles/dch-openvpn-server: Add FireMon Mgmt subnet 2018-07-14 19:16:40 -05:00
Dustin 16a883f2f1 roles/ssh-hostkeys: Add keys for jenkins0.p.b 2018-07-03 13:30:34 -05:00
Dustin 03e5764de1 roles/dch-openvpn-server: Correct routes
The `ifconfig` global directive specifies the IP address added to the
tunnel interface device, not the network. The `push route` directives
need to include this address to correctly send route information to
clients.
2018-07-01 16:47:43 -05:00
Dustin 036234bba5 ci: Add pipeline for dch-vpn playbook 2018-07-01 15:32:14 -05:00
Dustin d4fc139028 dch-proxy: PB to deploy HAProxy 2018-07-01 15:19:20 -05:00
Dustin 6602dd5b4a dch-gw: Allow inbound TCP port 9876
TCP port 9876 is used for the OpenVPN-over-TLS service.
2018-07-01 15:18:19 -05:00
Dustin c3f1f5750d roles/dch-proxy: Add OpenVPN backend
The `openvpn` haproxy backend allows forwarding TLS traffic for
*vpn.securepassage.com* to the OpenVPN-over-TLS service on the gateway.
2018-07-01 15:17:14 -05:00
Dustin e3c003e4aa hosts: gw0: Add OpenVPN certs/key 2018-07-01 15:16:51 -05:00
Dustin ad10f0c44c dch-vpn: Apply dch-openvpn-role 2018-07-01 15:16:39 -05:00
Dustin 780c8783db roles/dch-openvpn-server: Deploy OpenVPN server
The *dch-openvpn-server* role installs and configures OpenVPN and
stunnel to provide both native OpenVPN service as well as
OpenVPN-over-TLS. The latter uses stunnel, listening on TCP port 9876,
to allow better firewall traversal and TCP port sharing via reverse
proxy.
2018-07-01 15:14:23 -05:00
Dustin b13f28f505 hosts: Add jenkins0.p.b 2018-06-24 13:27:47 -05:00
Dustin a02ddbb53f roles/apache: Support setting ServerTokens
The `apache_server_tokens` variable can now be set, which controls the
value of the `ServerTokens` directive. If the variable is set, the
`ServerTokens` directive will be added to the `00-servername.conf` file.
2018-06-23 14:42:45 -05:00
Dustin 10d6b52460 roles/samba: Support selecting interfaces
The `samba_interfaces` variable can now be defined to populate the
`interfaces` global configuration parameter in `smb.conf`. This
parameter controls the interfaces or addresses to which the Samba server
binds, and also the IP addresses that are registered in DNS.
2018-06-23 14:42:45 -05:00
Dustin 9d54411d52 roles/dch-proxy: Add backend for Jenkins
This commit configures HAProxy to proxy *jenkins.pyrocufflink.net* and
*jenkins.pyrocufflink.blue* to the Jenkins master.
2018-06-23 14:42:45 -05:00
Dustin c95a4b7379 roles/certbot: Support using existing account data
The *certbot* role now supports copying the data for an existing Let's
Encrypt account to the managed node using an archive. If an archive
named for the inventory hostname (typically the FQDN) of the managed
node is found in the `accounts` directory under the `files` directory of
the *certbot* role, it will be copied to the managed node and extracted
at `/var/lib/letsencrypt/accounts`. This takes the place of running
`certbot register` to sign up for a new account.
2018-06-23 13:44:34 -05:00
Dustin 52436acb48 roles/certbot: Add some task tags
The *install* tag is applied to any task that installs a package.

The *user* tag is applied to any task that creates an OS user or group.

The *group* tag is applied to any task that creates an OS user group.
2018-06-23 13:43:14 -05:00
Dustin 7766cc1d05 ci: zabbix: Specify credentials
Since the host *gw0* is not a member of the *pyrocufflink.blue* domain,
GSSAPI authentication does not work. As such, the SSH private key has to
be made available to the `ansible-playbook` process for authentication
to that host.
2018-06-22 19:43:08 -05:00
Dustin cae9f2e3c2 ci: zabbix: Separate server, agent stages
Separating the Zabbix server and agent playbooks into separate stages
allows better visibility into the time taken for each.
2018-06-22 19:43:06 -05:00
Dustin 0500adadfa ci: zabbix: Use multiple sudo-pass files
The `zabbix.yml` playbook applies to hosts that are not members of the
*pyrocufflink.blue* domain, and thus have different passwords for
`sudo`. Using the `-e` argument to `ansible-playbook` and specifying a
single Vault-encrypted file that defines the `ansible_become_password`
variable effectively forces Ansible to try to use that password on every
host. This is because variables defined on the command line, or read
from a file specified on the command line, have the highest precedence.

To use different passwords on different hosts, the normal variable
scoping rules have to be used. To that end, one `sudo-pass` file is
created in the `group_vars/pyrocufflink` directory, so it will apply to
all machines that are members of the *pyrocufflink.blue* domain.
Additionally, another `sudo-pass` file is created in the `host_vars/gw0`
directory; it will only apply to the gateway device.
2018-06-22 19:33:23 -05:00
Dustin b809d4294f pyrocufflink: Convert variables file to directory
Converting the *pyrocufflink* group variables definition from a file to
a directory will allow Jenkins jobs to place a Vault-envrypted file
within it that defines the `ansible_become_password` variable. In this
way, a different password can be used for machines that are members of
the *pyrocufflink.blue* domain than for other hosts. The existing
mechanism of specifying the path to the Vault-encrypted file that
defines the variable allows only a single password to be defined, so it
does not work when multiple machines in the same play have different
passwords.
2018-06-22 19:20:22 -05:00
Dustin ddafc09839 dch-gw: Open Zabbix ports in the firewall
Obviously, the Zabbix agent (active and passive) ports need to be open
in order for the gateway device itself to be monitored by Zabbix.
2018-06-19 20:41:45 -05:00
Dustin 5188250cfc hosts: Add dch-gw to zabbix group
The gateway device is now monitored by Zabbix. Adding it to the *zabbix*
group ensures that the Zabbix agent is installed and configured
correctly.

Because the *zabbix-agent* role has a task to configure FirewallD, the
`host_uses_firewalld` variable needs to be set to `false` for *gw0*,
since it does not use FirewallD.
2018-06-19 20:40:58 -05:00
Dustin f78fe14eae roles/zabbix: Respect host_uses_firewalld
For machines that do not use firewalld, the *zabbix-agent* role will now
skip attempting to open the Zabbix agent port using the `firewalld`
module. The `host_uses_firewalld` variable controls this behavior.
2018-06-19 20:37:09 -05:00
Dustin b5ea6b702a roles/ssh-hostkeys: Add keys for rprx0.p.b 2018-06-18 20:08:30 -05:00
Dustin 7b687db1c1 roles/ssh-hostkeys: Add keys for git0.p.b 2018-06-18 20:08:12 -05:00
Dustin f14683aaac git0: Set gitea_root_url
The `gitea_root_url` variable is used to configure the root URL for
Gitea, which is in turn used to generate HTTP/HTTPS "clone" links for
Git repositories. If this value is not set, the default is used, which
does not work since the application is behind a reverse proxy.
2018-06-18 19:22:21 -05:00
Dustin fd172ddf7c roles/dch-proxy: Redirect git.p.n to Gitea
The name *git.pyrocufflink.net* now proxies to Gitea instead of CGit.
2018-06-13 22:23:27 -05:00
Dustin 222acdba32 git0: Switch to Let's Encrypt certificate 2018-06-13 22:23:27 -05:00