Commit Graph

799 Commits (07f84e7fdcf6da2e4fc3e7ce8e6546751104f672)

Author SHA1 Message Date
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
Dustin 5ad0104500 hosts: Add git0.p.b to certbot
The *git.pyrocufflink.blue* site now uses a certificate issued by Let's
Encrypt.
2018-06-13 22:23:27 -05:00
Dustin 974cc3dceb Set Let's Encrypt account email globally 2018-06-13 22:23:27 -05:00
Dustin d5769c254d certbot: Playbook to deploy certbot 2018-06-13 22:23:27 -05:00
Dustin c6a50313dc roles/certbot: Set up Let's Encrypt certificates
The *certbot* role installs and configures the `certbot` ACME client. It
adjusts the default configuration to allow the tool to run as an
unprivileged user, and then configures Apache to work with the *webroot*
plugin. It registers for an account and requests a certificate for the
domains specified by the `certbot_domains` Ansible variable. Finally, it
enables the *certbot-renew.timer* systemd unit to schedule automatic
renewal of all Let's Encrypt certificates.
2018-06-13 22:23:21 -05:00
Dustin efc6b62903 dch-gw: Forward HTTP, HTTPS to rprx0.p.b 2018-06-12 22:44:54 -05:00
Dustin 83253cb6d6 dch-gw: Add DHCP reservation for rprx0.p.b
*rprx0.pyrocufflink.blue* needs a DHCP reservation and static address
for port forwarding of HTTP and HTTPS.
2018-06-12 22:44:54 -05:00
Dustin 5318f0c5a1 hosts: Add rprx0.p.b
*rprx0.pyrocufflink.blue* provides a reverse proxy for HTTP and HTTPS
for all public-facing web services
2018-06-12 22:44:54 -05:00
Dustin c5fe4a66aa roles/dch-proxy: Deploy reverse HTTP/HTTPS proxy
The *dch-proxy* role sets up HAProxy to provide a revers proxy for all
public-facing web services on the Pyrocufflink network. It uses the TLS
Server Name Indication (SNI) extension to determine the proper backend
server based on the name requested by the client.

For now, only Gitea is configured; the name *git.pyrocufflink.blue* is
proxied to *git0.pyrocufflink.blue*. All other names are proxied to
Myala.
2018-06-12 22:31:15 -05:00
Dustin 235468a71c roles/haproxy: Basic setup for HAproxy
The *haproxy* installs HAproxy and sets up basic configuration for it.
It configures the systemd unit to launch the service with the `-f
/etc/haproxy` arguments, which will cause it to load all files from the
`/etc/haproxy` directory, instead of just `/etc/haproxy/haproxy.cfg`.
This will allow other roles to add frontend and backend configuration by
adding additional files to this directory.
2018-06-12 22:31:15 -05:00
Dustin 2f41ac3520 hosts: Add all domain members to zabbix group
By making the *pyrocufflink* group a child of the *zabbix* group, all
hosts that are members of the former will have Zabbix installed.
2018-06-12 21:13:39 -05:00
Dustin c2f819554c hosts: Alphabetize groups 2018-06-12 21:13:15 -05:00
Dustin 701ce24eb3 roles/ssh-hostkeys: Add keys for git0.p.b 2018-06-09 14:36:17 -05:00
Dustin a6182c74cb roles/zabbix-server: Redirect HTTP -> HTTPS 2018-06-09 14:35:22 -05:00
Dustin 6396b9fc49 gitea: Restrict SSH configuration
Since Gitea servers may be exposed directly to the Internet, it is
important to prevent SSH tunneling, lest the server become an ingress
point into the network.

Additionally, the *gitea* user should not be allowed to use password
authentication, as this would only work if the user actually has a
password (which it does not) and would result in shell access instead of
Gitea.
2018-06-06 21:45:36 -05:00
Dustin 2be0e3d0a5 roles/sshd: Configure OpenSSH daemon
The *sshd* role can be used to configure the OpenSSH daemon. It supports
configuring a few options globally, as well as a limited set of options
in `Match` blocks (e.g. per-user/group configuration).
2018-06-06 21:44:28 -05:00
Dustin 4a91b55a49 pyrocufflink: Trust DCH Root CA
The *DCH Root CA* certificate needs to be trusted on all hosts, as most
internal communication is secured with certificates it has issued.
2018-06-04 20:03:55 -05:00
Dustin 861c6f4fe1 roles/trustca: Generic role for adding CA certs
The `trustca` role can be used to add CA certificates to the system
trust store. It requires a variable, `ca`, to be defined, referring to
the name of a file containing a CA certificate to install.
2018-06-04 20:03:55 -05:00
Dustin 4f6260d77d hosts: git0: Define Gitea SSH domain 2018-06-04 20:03:55 -05:00