Commit Graph

900 Commits (34fcaa52efa72a333ef73b60e34b34625d9730c0)

Author SHA1 Message Date
Dustin 251611803f roles/taiga: Deploy Taiga project management app
The *taiga* role installs the three components of Taiga:

* taiga-back
* taiga-events
* taiga-front

*taiga-back* is a Python application. Its dependencies are installed via
`pip` in the *taiga* user's site-packages, and the application itself is
installed by unpacking the archive. *taiga-events* is a Node.js
application. Its dependencies are installed by `npm`, and is itself
installed by unpacking the archive. Finally, *taiga-front* is a
single-page browser application that is installed by unpacking the
archive, and served by Apache.

Taiga requires PostgreSQL and RabbitMQ.
2019-03-07 13:26:15 -06:00
Dustin 7211028f4d hosts: Add hass0.pyrocufflink.blue
*hass0.pyrocufflink.blue* is a virtual machine that runs Home Assistant.
It is dual-homed on the *pyrocufflink.blue* network and the isolated IoT
network.
2019-03-05 18:31:42 -06:00
Dustin 960528c001 roles/homeassistant: Deploy Home Assistant
This commit introduces a *homeassistant* role that installs and sets up
Home Assistant using `pip`.
2019-03-05 18:30:29 -06:00
Dustin f002da86ef dns0: Update DHCP server IP address
DHCP is provided by *dns1.pyrocufflink.blue* now, not the gateway. To
allow dynamic DNS updates from it, the correct source address must be
listed in the zone configuration for *pyrocufflink.red*.
2019-02-19 13:20:19 -06:00
Dustin 5571ee704b hosts: Remove dc1.pyrocufflink.blue
*dc1.pyrocufflink.blue* has been decommissioned after the failed Samba
update.
2019-02-16 10:11:59 -06:00
Dustin 284e3817e0 jenkins0: Bind Samba to real interface only
Because *jenkins0.pyrocufflink.blue* runs Docker, it has an extra
virtual interface and IP address, for container communication. By
default, Samba registers all IP addresses in DNS, and cannot
differentiate between the actual interface and the Docker bridge. This
can cause other hosts to attempt to contact *jenkins0.pyrocufflink.blue*
using the wrong address.

The `samba_interfaces` variable controls the value of the `interfaces`
global configuration option for Samba. One of the things this option
controls is which addresses to register in DNS. By setting it to the
network address of the *pyrocufflink.blue* network, we can prevent the
virtual address from being used at all.
2019-01-06 12:24:52 -06:00
Dustin 4ccab4bd40 public-web: Add missing group variables file 2019-01-04 20:52:41 -06:00
Dustin 2b61d80319 zabbix-server: Correctly set smtp_mynetworks
The `smtp_mynetworks` variable expects a list. Setting it to a string
resulted in each character in the string being interpreted as an item in
the list.
2019-01-04 20:52:23 -06:00
Dustin f4fad034dc roles/dch-proxy: Proxy pyrocufflink.net 2019-01-04 20:52:23 -06:00
Dustin 54ebfda86c websites: Disable default SSL virtual host
The default SSL virtual host is no longer needed, as all hosted sites
now have their own virtual host blocks.
2019-01-04 20:52:23 -06:00
Dustin ed5f7108dc websites: Add role for pyrocufflink.net site
The *websites/pyrocufflink.net* role configures the public web server to
host *pyrocufflink.net*. This site has two functions:

* It redirects `/` to http://dustin.hatch.name/
* It proxies user home directories (i.e. /~dustin/) to the file server
2019-01-04 20:52:23 -06:00
Dustin 87c63ae203 fileserver: Configure Apache ~user directories
This commit sets the `apache_userdir` variable, which enables the
per-user directories feature. This allows users to serve content via
HTTP by placing it in the `public_html` directory within their home
directories.

Although Apache is already installed on the file server in order to
serve the Aria2 web UI, it is not explicitly included in the
`fileserver.yml` playbook.
2019-01-04 20:52:23 -06:00
Dustin 52a9fb1c0e roles/apache: Set ServerName in default SSL vhost
The `ServerName` directive needs to be set inside the default SSL vhost,
as this property does not get inherited from the global configuration,
and it is needs to be set in order for SNI to work correctly.
2019-01-04 20:52:23 -06:00
Dustin ea1f52814d roles/apache: Configure mod_userdir
By default, per-user directories (i.e. `/~username/`) are disabled in
Fedora's configuration of Apache. This commit introduces a new variable,
`apache_userdir`, which can be used to enable this feature. It should be
set to a string other than *disabled*, which is the path under users'
home directories that will be served, if it is accessible. Normally, the
value would be `public_html`.
2019-01-04 20:52:23 -06:00
Dustin 972dbd1fdf websites/dcow: Add certbot role dependency
To support multiple websites with separate Let's Encrypt certificates,
the *certbot* role needs to be applied as a dependency of each
individual website role. This will allow each application to specify a
different value for `certbot_domains`.
2019-01-04 20:52:23 -06:00
Dustin d1a72de6b0 roles/certbot: Run periodically as certbot user
The default systemd unit configuration for *certbot-renew.service* runs
the `certbot renew …` command as root. This can cause permissions
issues, since this Ansible role expects the *certbot* user to be able to
access all configuration, data, and log files. As such, this commit adds
a systemd unit extension for *certbot-renew.service* to run the command
as *certbot*.
2019-01-04 20:52:23 -06:00
Dustin 50396c88d4 hosts: Mark vmhost0 offline
*vmhost0.pyrocufflink.blue* is currently offline for maintenance. To
avoid the unending stream of failed continuous enforcement Jenkins jobs,
it has been removed from the main inventory file and moved to "offline"
inventory.
2018-11-13 23:54:45 -06:00
Dustin f9b006c4bd Move dch_networks definition to all group
Defining the `dch_networks` object for the *all* group will allow any
role to use its values.
2018-10-13 12:43:35 -05:00
Dustin 5351e753d7 ci: dch-vpn: Use AD credentials
Now that the VPN server is a member of the *pyrocufflink.blue* domain,
Kerberos credentials are required to manage it.
2018-10-13 12:40:09 -05:00
Dustin 6d467c7b7d dch-vpn: Avoid configuring firewalld
FirewallD cannot be configured to allow traffic to be routed through the
system without NAT. This makes it unsuitable for running on a VPN
concentrator. Thus, any role that would configure FirewallD needs to be
informed that this machine does not use it.
2018-10-13 12:19:25 -05:00
Dustin bd7e9c88bf ci: dch-vpn: Update host filter 2018-10-13 12:07:30 -05:00
Dustin 9be2c2ac92 hosts: Remove gw0
Now that the USG is fully operational, *gw0* has been decommissioned.
2018-10-13 12:05:40 -05:00
Dustin 1745f268de smtp1: Allow relay from Management network 2018-10-13 11:50:31 -05:00
Dustin cdf2869ef1 zabbix-server: Only allow local SMTP relay
The Zabbix server also serves an SMTP relay, to minimize reliance on
external services when sending notifications. Since it inherits
configuration of the relay from the general *smtp-relay* group, it ends
up allowing all hosts to relay off of it. To avoid this, we set
`smtp_rmynetworks` at the *zabbix-server* group level to only allow the
local machine to relay messages.
2018-10-13 11:47:55 -05:00
Dustin 2b43a85c78 Add static leases for proxy/smtp
In order to allow access to these services through the firewall from the
management network, they need to have static addresses.
2018-10-07 21:42:18 -05:00
Dustin b61070fea8 dch-openvpn: Support road-warrior clients
Moving the route definitions to global scope, and defining an address
pool, will allow other clients besides *dhatch-d4b* to connect to and
use the OpenVPN tunnel service. This may be useful in situations where
IPsec is blocked
2018-10-07 21:42:18 -05:00
Dustin a1ca06a3c5 Move VPN server to dedicated VM
The VPN capability of the UniFi Security Gateway is extremely limited.
It does not support road-warrior IPsec/IKEv2 configuration, and its
OpenVPN configuration is inflexible. As with DHCP, the best solution is
to simply move service to another machine.

To that end, I created a new VM, *vpn0.pyrocufflink.blue*, to host both
strongSwan and OpenVPN. For this to work, the necessary TCP/UDP ports
need to be forwarded, of course, and all of the remote subnets need
static routes on the gateway, specifying this machine as the next hop.
Additionally, ICMP redirects need to be disabled, to prevent confusing
the routing tables of devices on the same subnet as the VPN gateway.
2018-10-07 21:42:18 -05:00
Dustin 9f32f94780 Move DHCP service to dns1.p.b
The DHCP server on the UniFi Security Gateway is pretty limited; it
cannot manage static leases (reservations), and does not offer any way
to build dynamic values for e.g. hostname or boot filename. Rather than
give up these features, I decided to just move the DHCP server to one of
the Raspberry Pis; the DNS server made the most sense.

To facilitate this move, I created the *pyrocufflink-dhcp* host group,
and moved the DHCP configuration variables there. Thus, it was a simple
matter of adding *dns1.pyrocufflink.blue* to this group to relocate the
service.

Of course, to serve clients on the other subnets, the gateway needs to
have DHCP relay enabled and pointing to the new server.
2018-10-07 21:42:18 -05:00
Dustin 36675d0523 dch-network: Add more FireMon networks
This commit updates the list of FireMon networks to include the Caverns
Production (172.16.0.0/24) and Caverns Admin (172.24.16.0/20) networks.
This is necessary to ensure OpenVPN routes are created for these
networks.
2018-08-26 17:32:23 -05:00
Dustin 07356697c8 roles/dch-openvpn-server: Use firemon_networks
The routes to FireMon networks are now defined using the
`firemon_networks` Ansible variable. The global `iroute` and
client-specific `route` options are generated from the CIDR blocks
specified in this list.
2018-08-26 17:32:23 -05:00
Dustin 88dd80e6fd aria2: Deploy aria2 download manager
The *aria2* role installs the *aria2* download manager and sets it up to
run as a system service with RPC enabled. It also sets up the web UI,
though that must be installed manually from an archive, for now.
2018-08-19 14:17:48 -05:00
Dustin 895974f346 rngd: PB to set up rngd
The *rng-tools* package provides `rngd`, a userspace process that feeds
the Linux entropy pool from additional sources. Notably, it mixes
entropy gathered from hardware random number generators, such as the one
on the BCM2835 SoC on the Raspberry Pi, and the KVM paravirtual random
number generator.

The `rngd.yml` playbook installs *rng-tools* and starts the `rngd`
service.
2018-08-13 20:25:22 -05:00
Dustin f250e00a17 roles/named: Provide default for named_keys
For hosts that do not have any TSIG keys, the `named_keys` variable
still must be defined (to an empty iterable) in order for the template
to expand properly.
2018-08-12 18:06:14 -05:00
Dustin 59dbe232e3 dch-network: Update DNS servers
All networks should now be using *dns0.pyrocufflink.blue* (4) and
*dns1.pyrocufflink.blue* (3) as the recursive DNS servers.
2018-08-12 17:30:14 -05:00
Dustin 07a23267c6 hosts: Add dns1.pyrocufflink.blue
To avoid having a single point of failure, a second recursive DNS server
is necessary. This will be useful in cases where the VM hosts must both
be taken offline, but Internet access is still required.

The new server, *dns1.pyrocufflink.blue*, has all the same zones defined
as the original. It forwards the *pyrocufflink.blue* zone and
corresponding reverse zones to the domain controllers, and acts as a
slave for the *pyrocufflink.red* zone.
2018-08-12 17:24:37 -05:00
Dustin d36e0d5a0a pyrocufflink-dns: Split named_zones definition
In order to support adding a second DNS server, the BIND zone
configuration needs to be partially modularized. While the forwarder
definitions for *pyrocufflink.blue*, etc. will remain the same, the
*pyrocufflink.red* zone will be different, as it will be a slave zone on
the second server. This commit breaks up the definition of the
`named_zones` variable into two parts:

* `pyrocufflink_red_zones`: This is a list of zone objects for
  *pyrocufflink.red* and its corresponding reverse zone. On
  *dns1.pyrocufflink.blue*, these are master zones. On the new server,
  these will be slaves.
* `pyrocufflink_common_zones`: This is a list of zone objects for the
  zones that are the same on both servers, since they are all forwarding
  zones.

Similarly, the `named_keys` variable only needs to be defined on the
master, since DHCP will only send updates there.
2018-08-12 17:23:34 -05:00
Dustin 26f3637bfa hosts: Add proxy0.pyrocufflink.blue
As its name suggests, *proxy0.pyrocufflink.blue* acts as an HTTP proxy
server running Squid.
2018-08-12 16:00:53 -05:00
Dustin b86ecb99fd squid: Add role and PB to deploy Squid 2018-08-12 16:00:32 -05:00
Dustin 00b04179b1 hosts: Remove smtp0.p.b
Now that the SMTP relay has been moved to *smtp1.pyrocufflink.blue*,
*smtp0* is no longer needed.
2018-08-12 15:23:08 -05:00
Dustin 72b148bd0e hosts: Add smtp1.p.b
*smtp1.pyrocufflink.blue* is a VM that will replace
*smtp0.pyrocufflink.blue*, a Raspberry Pi.

I decided that there is little use in having the availability guarantee of
a discreet machine for the SMTP relay. The only system that would NEED
to send mail if the VM host fails is Zabbix, which operates as its own
relay anyway. As such, the main relay can be a VM, and the Raspberry Pi
can be repurposed as a recursive DNS server.
2018-08-12 15:22:31 -05:00
Dustin 76b7db421c dch-network: Forward syncthing port to file0
*file0.pyrocufflink.blue* hosts syncthing. Forwarding the transport is
not strictly required, as syncthing can use relays to encapsulate
traffic in HTTPS, but allowing direct access improves performance.
2018-08-12 15:22:30 -05:00
Dustin 0b972da789 ci: Add pipeline for Koji 2018-08-12 10:27:20 -05:00
Dustin 18ed14f376 Add SSH host keys for burp0.p.b 2018-08-12 10:27:20 -05:00
Dustin 4e8bd8995b hosts: Add koji0.pyrocufflink.blue
*koji0.pyrocufflink.blue* hosts the Koji ecosystem, including a builder.
2018-08-12 10:27:20 -05:00
Dustin f9cba30582 koji: Add playbooks for Koji
The `koji.yml` playbook can be used to deploy an entire Koji ecosystem.
It is composed of three smaller playbooks:

* `koji-hub.yml`: Deploys the Koji hub, GC, and Kojira
* `koji-web.yml`: Deploys the Koji Web GUI
* `koji-builder.yml`: Deploys the Koji builder
2018-08-12 10:14:25 -05:00
Dustin a0dd911a63 roles/koji-builder: Deploy the Koji builder
The *koji-builder* role installs and configures the Koji builder
(*kojid*). It supports configuring an HTTP proxy, if required.
2018-08-12 10:14:25 -05:00
Dustin da4ec1612c roles/koji-web: Deploy the Koji Web UI
The *koji-web* role installs and configures the Koji Web GUI front-end
for Koji. It requires Apache and mod_wsgi. A client certificate is
required for authentication to the hub, and must be placed in the
host-specific subdirectory of `certs/koji`.
2018-08-12 10:08:01 -05:00
Dustin 6341d972f6 roles/koji-client: Configure the koji client
The *koji-client* role is a generic role that can be used to configure
the Koji client library/`koji` CLI tool. By default, it manages the
default configuration at `/etc/koji`, but by using the
`koji_client_dir`, `koji_client_user`, and `koji_client_id` variables,
it can be used to configure per-user client configuration as well.
2018-08-12 10:05:56 -05:00
Dustin aed2776e27 roles/kojira: Deploy the Koji repository agent
The *kojira* role sets up the Koji repository agent to manage
repository metadata for build tags. It runs as a daemon, usually on the
same machine as the Koji hub. A client certificate is required for
authentication, and must be supplied by placing it in the
`certs/koji/{{ inventory_hostname }}` directory.
2018-08-12 10:04:23 -05:00
Dustin 1a8d7ce29a roles/koji-gc: Deploy the Koji garbage collector
The *koji-gc* role sets up the Koji garbage collector utility to run
periodically. It uses cron for scheduling. A client certificate is
required for authentication, and must be supplied by placing it in the
`certs/koji/{{ inventory_hostname }}` directory.
2018-08-12 09:58:56 -05:00