Commit Graph

98 Commits (f3739d91ac2017f80875288d1fb72253014af57d)

Author SHA1 Message Date
Dustin f3739d91ac hosts: Add hosts to zabbix group
Hosts in the *zabbix* group will get the Zabbix agent deployed to them.
2018-04-14 15:47:49 -05:00
Dustin 3bbe5aee6a hosts: Add zbx0.pyrocufflink.blue
The host *zbx0.pyrocufflink.blue* (a Raspberry Pi) runs the Zabbix
server and web UI. It has a reserved IPv4 address to simplify reverse
DNS management for now, since Samba's dynamic DNS client does not
register PTR records.
2018-04-14 15:47:30 -05:00
Dustin 9ace01788a zabbix: Playbooks for Zabbix server, agents 2018-04-14 15:31:17 -05:00
Dustin c982f4818f postgresql: PB to deploy PostgreSQL server 2018-04-14 15:28:46 -05:00
Dustin 668b158cf9 roles/zabbix-agent: Deploy Zabbix agent
The *zabbix-agent* role installs the Zabbix monitoring agent on the
managed node, and sets it up to communicate with the Zabbix server
specified by the `zabbix_server` variable. This role "should" be
compatible with most distributions; it has been tested with Fedora and
Gentoo.
2018-04-14 15:27:02 -05:00
Dustin 3a7c9b52bf roles/zabbix-server: Deploy Zabbix server, web UI
The *zabbix-server* role deploys the Zabbix server database, daemon, and
web interface. It requires the *apache* role to configure Apache HTTPD
to serve the web UI.
2018-04-14 15:26:54 -05:00
Dustin afe4fb7eff roles/postgresql-server: Deploy PostgreSQL
The *postgresql-server* role installs and configures PostgreSQL on
Fedora/RHEL-based distributions.
2018-04-14 15:23:44 -05:00
Dustin f89b279d3a roles/apache: Role to deploy Apache HTTPD
The *apache* role installs and configures the Apache HTTPD server and
its *mod_ssl* module. It currently only works on Fedora/RHEL-based
distributions.
2018-04-14 15:21:15 -05:00
Dustin 0ce0c0f834 pyrocufflink-dns: Add IPv6 reverse DNS zones
These IPv6 reverse DNS zones are managed by the Samba AD DCs for the
*pyrocufflink.blue* domain. These zones correspond to the IPv6 prefixes
used by the "blue" network.
2018-04-14 15:15:02 -05:00
Dustin be876c1053 ci: Schedule daily runs 2018-04-14 09:43:19 -05:00
Dustin ea5f289905 roles/winbind: Use ad idmap backend
The `ad` identity mapper backend is apparently the only one that can
use shell, home directory, etc. attributes from the directory now (as of
Samba 4.6).
2018-04-08 14:40:04 -05:00
Dustin 5489ddac1f roles/ssh-hostkeys: Add keys for cm0.p.b 2018-04-08 14:28:25 -05:00
Dustin 6d9406e389 ansible.cfg: Set remote_tmp
Many hosts (should) have `/tmp` mounted with the `noexec` flag, which
prevents Ansible modules written there from running. To work around
this, the `remote_tmp` configuration option should be set to a path
under `/var/tmp`, which is not mounted noexec.
2018-04-08 14:26:53 -05:00
Dustin a4aeda6371 ci: pyrocufflink: Add pipline for domain members
The `pyrocufflink` Jenkins pipleline applies the `pyrocufflink.yml`
playbook to ensure AD domain member configuration is correct.
2018-04-08 14:24:43 -05:00
Dustin f57588d590 ci: samba-dc: Disable check mode 2018-04-08 14:10:55 -05:00
Dustin b13164f77e ci: samba-dc: Use Kerberos authentication 2018-04-08 14:10:40 -05:00
Dustin ac215ab520 ci: samba-dc: Correct credentials sudo-pass ID 2018-04-08 12:43:33 -05:00
Dustin 45bb2f5cd3 roles/ansible: Install python-netaddr
The *python-netaddr* package is needed on Ansible control machines for
the `ipaddr`, etc. Jinja2 template filters.
2018-04-08 12:33:54 -05:00
Dustin 38884cdb32 ci: Use dedicated slave instead of Docker
Using a dedicated slave node instead of a Docker container has a few
advantages:

* Persistent configuration is possible, without making weird assumptions
  (e.g. Jenkins UID/GID) in the Dockerfile
* Can limit concurrent deployments by controlling executor count on the
  node
2018-04-08 12:32:02 -05:00
Dustin 7c8227c30f jenkins-slave: Apply ssh-hostkeys role
The *ssh-hostkeys* role needs to be applied to Jenkins slave nodes so
that e.g. SCM host keys are available.
2018-04-08 12:32:02 -05:00
Dustin 06a21b2090 ssh-hostkeys: Manage global SSH host key database
The *ssh-hostkeys* role is used to manage the global SSH host key
database. This file is consulted by the `ssh` command when verifying
remote host keys on first connect. If the host key is found here, it is
copied to the user's host key database file without prompting for
verification.
2018-04-08 12:32:02 -05:00
Dustin 1f6cc840eb hosts: Add cm0.pyrocufflink.blue
This host is a Jenkins slave dedicated configuration management using
Ansible.
2018-04-08 12:20:13 -05:00
Dustin ac4e9fc390 ansible: Install Ansible
The `ansible.yml` playbook and corresponding *ansible* role simply
install Ansible and related utilities, such as OpenSSH and GnuPG.
2018-04-08 12:20:03 -05:00
Dustin 54bc5570f1 jenkins-slave: PB to deploy Jenkins slave 2018-04-08 12:04:03 -05:00
Dustin fd347fa600 roles/jenkins-slave: Prepare host for Jenkins
The *jenkins-slave* role prepares a host to have the Jenkins slave
agent deployed on it. Deploying the agent itself is done by the Jenkins
master, through the web UI.
2018-04-08 11:59:18 -05:00
Dustin 9a2dfa261c pyrocufflink: Configure sudo for server admins
Members of the *Server Admins* AD group need to be able to use `sudo`
for privilege elevation on all domain member servers.
2018-04-08 10:52:08 -05:00
Dustin 984628cbbc roles/samba-dc: Fix typo in host principal name
The service principal name added to `/etc/krb5.keytab` had a trailing
`}` character because of a typo in the Ansible task. This resulted in
GSSAPI authentication failing because server processes could not find
the host key in the key table.
2018-04-08 10:50:51 -05:00
Dustin fff486ca03 pyrocufflink: Ensure winbind is running
Since the first pass of `pyrocufflink.yml` always fails to start the
*winbind* service (since the machine is not yet a member of the domain),
a second pass is required to start it. It can't be started as part of
the *winbind* role, though, since it would fail. As such, it has to be
started at the very end of the play.
2018-04-08 10:13:19 -05:00
Dustin 712d298b38 hostname: Also write /etc/hosts
This commit introduces a new role, *hostname*, that is used by the
`hostname.yml` playbook to set the hostname. It also writes
`/etc/hosts` using a template.
2018-04-08 10:11:43 -05:00
Dustin 66339a827d ci: Add Jenkinsfile for domain controllers 2018-04-07 22:57:22 -05:00
Dustin ef52097095 ci: Update known_hosts 2018-04-07 22:57:15 -05:00
Dustin 6bc55cfb45 hosts: Remove hard-coded IP addresses
Now that DNS is up and running on the blue network, these hosts no
longer need their IP addresses in the inventory. These were wrong,
anyway.
2018-04-07 22:57:15 -05:00
Dustin 2272a9fedc ci: Begin continuous integration setup 2018-04-07 17:06:32 -05:00
Dustin 87b9b0c60d dch-gw: Allow outbound NTP 2018-04-07 09:40:50 -05:00
Dustin ef2b31880b dch-gw: Allow outbound DHCP
Connection Tracking does not work for DHCP messages, since many are
broadcast. As such, the firewall must explicitly allow datagrams
destined for the DHCP client port.
2018-04-07 09:39:22 -05:00
Dustin de5aa114d1 dch-network: Use dns0.pyrocufflink.blue everywhere
All internal networks (except Guest) now use *dns0.pyrocufflink.blue*
for DNS resolution.
2018-04-06 20:40:22 -05:00
Dustin 2d8bb54ba9 gw0: Use internal DNS 2018-04-06 20:38:11 -05:00
Dustin b5620631ff dch-gw: Add IPv6 ULA prefix to pyrocufflink.blue
For internal services, particularly DNS, it is easier to use a ULA
prefix than rely exclusively on routed addresses, since these can change
relatively frequently.
2018-04-06 20:36:30 -05:00
Dustin 2bc6bc69f3 dch-gw: Fix network address for pyrocufflink.red 2018-04-06 20:35:52 -05:00
Dustin 452a030b9d dch-gw: Remove Malfurion
Malfurion (second pyrocufflink.jazz Active Directory Domain Controller)
is currently offline.
2018-04-06 20:35:04 -05:00
Dustin 5c8a552eb2 fixup-dns 2018-04-06 20:31:18 -05:00
Dustin 3edf038e5e dch-gw: Change pyrocufflink.blue SLA ID
When specifying a SLA ID of "0", *dhcpcd* uses the whole delegated
subnet (i.e. /56 instead of /64).
2018-04-06 20:24:53 -05:00
Dustin 14440840e2 dch-gw: Clean up DNS/NTP address enumerations
Instead of listing the addresses for DNS and NTP servers again in the
DHCP server configuration, these are now taken from the canonical
definitions in the `dch_networks` variable.
2018-04-06 20:21:34 -05:00
Dustin e8ff331acc dch-gw: Update radvd_interfaces for multi-prefix
The *radvd* role now supports/requires specifying a list of prefixes for
each interface.
2018-04-06 20:19:09 -05:00
Dustin 2d5a614633 roles/radvd: Support multiple prefixes per network
It is occasionally necessary to advertise multiple prefixes on the same
interface, particularly when those prefixes are not on-link. The *radvd*
role thus now expects each item in `radvd_interfaces` list to have a
`prefixes` property, which itself is a list of prefixes to advertise.
Prefixes can specify properties such as `on_link`, `autonomous`,
`preferred_lifetime`, etc.
2018-04-06 20:16:02 -05:00
Dustin b83e832df9 roles/dch-gw: Explicitly accept forwarded ports
Marking packets matching port-forwarding rules, and then allowing
traffic carrying that mark did not seem to work well. Often, packets
seemed to get dropped for no apparent reason, and outside connections to
NAT'd services was sometimes slow as a result. Explicitly listing every
destination host/port in the `forward` table seems to resolve this
issue.
2018-04-06 20:13:03 -05:00
Dustin e9c9445a96 roles/named: Support global forwarders
The *named* role now supports configuring BIND to use forwarders for
recursive queries instead of or in addition to the root nameservers.
2018-04-06 20:11:08 -05:00
Dustin a0a4b91faf roles/dch-gw: Configure the filter table
The *filter* table is responsible for deciding which packets will be
accepted and which will be rejected. It has three chains, which classify
packets according to whether they are destined for the local machine
(input), passing through this machine (forward) or originating from the
local machine (output).

The *dch-gw* role now configures all three chains in this table. For
now, it defines basic rules, mostly based on TCP/UDP destination port:

* Traffic destined for a service hosted by the local machine (DNS, DHCP,
  SSH), is allowed if it does not come from the Internet
* Traffic passing through the machine is allowed if:
  * It is passing between internal networks
  * It is destined for a host on the FireMon network (VPN)
  * It was NATed to in internal host (marked 323)
  * It is destined for the Internet
* Only DHCP, HTTP, and DNS are allowed to originate from the local
machine

This configuration requires an `internet_iface` variable, which
indicates the name of the network interface connected to the Internet
directly.
2018-03-29 10:06:30 -05:00
Dustin da5da95894 hosts: add gw0 2018-03-29 07:52:20 -05:00
Dustin c5e3c861ab roles/dch-gw: Ensure dhcpcd starts after network
`dhcpcd` needs to start after the `network` service has started, as the
latter creates the interfaces to which the former needs to delegate IPv6
prefixes.
2018-03-29 07:52:20 -05:00