Commit Graph

527 Commits (98401b3c1ecf2957349e6f470bd7b51fe3f87261)

Author SHA1 Message Date
Dustin 26e887d0b0 Add new FireMon user network address 2019-08-23 08:48:22 -05:00
Dustin 8b0ead0570 hosts: dc0: Renew LDAP certificate 2019-05-08 11:07:27 -05:00
Dustin 9bce245f05 hosts: Remove cm0.p.b
*cm0.pyrocufflink.blue* has been deprecated and shut down.
Configuration Management jobs now run on regular Jenkins nodes, and are
serialized using "lockable resources" instead of a single executor.
2019-05-08 10:49:59 -05:00
Dustin 53f2a8e365 ci: Install findutils in build environment
The *findutils* package is needed for the `find` command, which is used
at the end of the CI pipelines to remove the `sudo-pass` vault files.
2019-05-02 16:27:58 -05:00
Dustin d6a5439057 hosts: Decommission dns1.p.b
*dns1.pyrocufflink.blue* has been decommissioned.  Having a second DNS
server never really worked correctly for some reason, and the
maintenance overhead of the Raspberry Pi is just not worth it right now.
The DHCP service has been moved to *dns0.pyrocufflink.blue*.
2019-05-02 10:29:43 -05:00
Dustin b7381b3fb1 ci: Use lockable resource to enforce serial runs
It is important that only one configuration management job run at a
time. Currently, this is enforced by having only one agent with the
*ansible* label, and that agent has only one executor. This is not an
ideal solution, because it requires maintaining a separate machine for
this purpose.

The *Lockable Resources Plugin* provides an alternate solution to this
problem. Using this plugin, jobs can acquire an exclusive lock on a
"resource" that prevents other jobs that require the same resource from
running. Any job that starts while the lock is held will wait until it
is released before executing. This will enforce the same serial
execution policy, but does not require a separate, dedicated machine.
Jobs will be able to run on any executor with the appropriate label.

Using this option, it is now possible to run configuration management
jobs on the normal agents, defining the execution environment in a
Docker image, so the *cm0.pyrocufflink.blue* agent can be
decommissioned.
2019-05-02 09:58:20 -05:00
Dustin f368938550 roles/gitea: Add Oauth2 JWT Secret
Newer versions of Gitea need a JWT secret for Oauth2.  Gitea will
attempt to generate one at startup if it is not already specified in the
configuration file, but this will fail since the file is not writable by
the user running the service.  As such, it must be set via configuration
policy.
2019-04-24 16:18:19 -05:00
Dustin 12b645e574 zabbix-server: Allow SMTP relay from any loopback
The Zabbix server resolves *localhost* to `::1`, but Postfix resolves it
to `127.0.0.1`.  This causes Postfix to reject incoming mail from Zabbix
with "Relay access denied."  Explicitly setting the `mynetworks` setting
to include both the IPv4 and IPv6 loopback addresses will ensure that no
mail is rejected from local processes, regardless of how name resolution
happens.
2019-04-15 10:05:04 -05:00
Dustin d8704fcb43 ssh-hostkeys: Add key for hass0.p.b 2019-03-22 16:53:43 -05:00
Dustin c8d6bae093 wheelhost: Publish wheels built by Jenkins
The point of the "wheel host" is to serve as a repository of Python
packages (wheels) built by Jenkins for consumption by `pip` et al. For
applications and libraries that do not provide all of their dependencies
as binary packages, this makes a convenient way to install them without
requiring all of the build tools and dependencies on the destination
machine.

The idea here is that a Jenkins job runs `pip wheel` for a distribution
package name or `requirements.txt` file and then uploads the resulting
wheel files using `rsync`. Apache is configured to serve the upload
directory with an index compatible with `pip`'s `--find-links`.
2019-03-22 10:19:27 -05:00
Dustin 2265dd235b roles/hass-dhcp: Deploy DHCP server for HA
The *hass-dhcp* role installs dnsmasq and configures it to serve DHCP
requests on the Home Assistant network. Since this network is not
routed, the regular DHCP relay/server setup will not work.
2019-03-22 09:43:30 -05:00
Dustin 51d6e13a13 websites: pyrocufflink.net: Disable rewrite log 2019-03-22 09:34:50 -05:00
Dustin cb92f47b4d roles/samba: Manage LDAP TLS certificates
This commit adds tasks to the *samba-dc* role to install TLS
certificates for the Samba LDAP server, and configures Samba to use
them.
2019-03-22 09:31:19 -05:00
Dustin b0690f942f roles/taiga: Fix HTTP->HTTPS redirect
The HTTP->HTTPS redirect must be defined in global scope in order for it
to work.
2019-03-22 09:29:56 -05:00
Dustin 7e585445b9 roles/vmhost: Enable KSM
This commit adds a systemd unit to enable the Kernel Same-page Merging
daemon on VM hosts. This allows much greater virtual machine density,
especially when many VMs are running the same guest OS.
2019-03-22 09:29:56 -05:00
Dustin 909c8e7a03 roles/haproxy: Add support for Debian hosts
Debian does not support system-wide SSL cipher suite profiles of course,
so these options need to be specified explicitly when deploying HAProxy
on Debian-based machines.
2019-03-22 09:29:56 -05:00
Dustin ceb56edf06 roles/net-ifaces: Create bridges for mgmt and hass
This commit updates the net-ifaces scripts for both *vmhost0* and
*vmhost1* to create VLAN and bridge interfaces for the Management and
Home Assistant networks.
2019-03-22 09:29:56 -05:00
Dustin 066bc807bd vm-hosts: Add mgmt and hass libvirt networks 2019-03-22 09:29:56 -05:00
Dustin 728657fdd5 pyrocufflink-dhcp: Add options to mgmt network
Specifying the DNS domain and UniFi address on the Management network
helps Ubiquiti devices more quickly locate the UniFi controller.
2019-03-22 09:29:56 -05:00
Dustin 691461cd8c roles/winbind: Fix error handling in ads_member
This commit fixes a couple of issues with the `ads_member` module
surrounding handling of errors from the `net ads join` command.
2019-03-22 09:29:56 -05:00
Dustin 159a42bb70 pyrocufflink-dns: Add FireMon zones 2019-03-22 09:29:56 -05:00
Dustin 417df821a3 pyrocufflink-dns: Remove pyrocufflink.jazz 2019-03-22 09:29:56 -05:00
Dustin a9d3b7894e roles/dhcpd: Support UniFi DHCP option 43
The `ubnt.unifi-address` DHCP option can be set to provide Ubiquiti
hardware with the hostname of the UniFi controller.
2019-03-22 09:29:56 -05:00
Dustin 5d47aad8a9 roles/zabbix: Add support for Debian
The *zabbix-agent* package for Debian locates configuration and log
files differently from other distributions.
2019-03-22 09:29:56 -05:00
Dustin 1a62a780ca hosts: Add taiga0.pyrocufflink.blue 2019-03-22 09:29:56 -05:00
Dustin d842b0ad25 roles/ssh-hostkeys: Sort ssh_known_hosts
Keep this file sorted using `ex`:

    ex -c 'sort|x' roles/ssh-hostkeys/files/ssh_known_hosts
2019-03-07 13:31:41 -06:00
Dustin 26ee57c6ca roles/rabbitmq: Deploy RabbitMQ
The *rabbitmq* role installs and configures the RabbitMQ message broker.
2019-03-07 13:29:29 -06:00
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