8
0
Fork
You've already forked admin-tools
0
Ansible playbooks and other admin tools used to administrate #! servers
  • Jinja 44%
  • HCL 33.5%
  • Python 16.4%
  • Shell 6.1%
Find a file
2021年02月03日 06:43:37 -06:00
doc Update doc/Blocking account 2018年09月28日 14:11:33 -05:00
files Update Pubkeys for dgrove 2019年03月10日 01:37:50 -06:00
library secrets/ldap: Add a playbook for setting LDAP passwords 2017年11月20日 06:25:54 +01:00
roles Update roles/coreos-authorized_keys 2017年11月17日 20:33:33 +01:00
secrets secrets/ldap: Add a playbook for setting LDAP passwords 2017年11月20日 06:25:54 +01:00
terraform main.tf: Upgrade to Terraform 0.14 2021年02月03日 06:43:37 -06:00
vault users: Rename group board_members to board 2018年12月19日 23:40:39 +01:00
.gitattributes Update lists of vault files 2017年09月06日 17:12:28 +01:00
.gitignore Terraform: R53 DNS in code 2017年05月13日 02:40:08 +02:00
.gitmodules Refactor CoreOS stuff 2015年12月14日 18:23:25 +01:00
.travis.yml Merge branch 'master' into certs 2017年09月05日 03:32:58 +01:00
.vault_newpassphrase.sh vault_newpassphrase.sh: Update gpg invocation 2017年08月01日 14:29:18 +01:00
ansible.cfg ansible.cfg: Enforce sufficient parallelism to handle all hosts 2017年12月05日 13:28:03 +01:00
coreos.yml Use file-local variables to make Emacs load the Ansible minor mode 2017年09月22日 03:00:15 +02:00
credentials.yml Avoid using strategy: free in playbooks 2017年12月05日 13:29:15 +01:00
hosts Update doc and inventory for the SSH port of ldap.#! 2018年07月01日 20:54:14 +02:00
irc.yml Avoid using strategy: free in playbooks 2017年12月05日 13:29:15 +01:00
ldap_ban.yml ldap_ban: Add an option to remove users' SSH pubkeys from LDAP 2019年02月28日 04:35:01 -06:00
LICENSE.md Added LICENSE file. 2015年09月27日 12:43:36 +05:45
lint.sh ansible-lint: Ignore 0405 "Remote package tasks should have a retry" 2018年12月20日 00:15:21 +01:00
mail.yml Use file-local variables to make Emacs load the Ansible minor mode 2017年09月22日 03:00:15 +02:00
README.md ldap_ban: Add option to delete users homedirs 2018年09月28日 14:11:32 -05:00
secrets.yml secrets/ldap: Add a playbook for setting LDAP passwords 2017年11月20日 06:25:54 +01:00
shell.yml Avoid using strategy: free in playbooks 2017年12月05日 13:29:15 +01:00
vault.yml Cleanup vault.yml 2018年12月19日 23:59:37 +01:00
vault_passphrase.pgp add re-encrypted vault passphrase 2018年07月01日 10:59:50 -07:00
vault_passphrase.sh add my key fingerprint to RECIPIENTS 2018年06月30日 21:24:15 -04:00

#! Admin Tools

Ansible playbooks and other admin tools/docs for maintaining the #! network.

Requirements

  • Recent version of Ansible
  • Local #! pass database
  • User with sudo access on all servers

Git configuration

You might also want to use the following snippet in ~/.gitconfig:

[diff "gpg"]
	textconv = gpg --no-tty --decrypt
	cachetextconv = false
[diff "ansible-vault"]
	textconv = ansible-vault view
	cachetextconv = false

SSH configuration

All the "service servers" (as opposed to shell servers) listen for SSH on port 8993 (ASCII-encoding of #!), and the user is core, with the following exceptions:

  • lon1.irc.hashbang.sh and sfo1.irc.hashbang.sh do not yet follow that convention;
  • git-infra.hashbang.sh is a service hosted on nyc3.apps.hashbang.sh which uses port 22.

This is expressed in the following .ssh/config snippet:

Host da1.hashbang.sh ny1.hashbang.sh sf1.hashbang.sh to1.hashbang.sh
 User your_nick
Host git-infra.hashbang.sh
 User git
Host sfo1.irc.hashbang.sh ldap.hashbang.sh
 User core
Host *.hashbang.sh hashbang.sh
 User core
 Port 8993

Playbooks

There are several playbooks present here:

  • shell.yml is used to synchronise the configuration (incl. installed packages) across the shell servers.

  • credentials.yml is used to deploy the admin's SSH keys across all servers:

    • admins can login as root on the shell servers;
    • they can login as core on the CoreOS servers.
  • coreos.yml performs CoreOS-specific tasks. Currently, it only bootstraps the Ansible agent's dependencies.

  • mail.yml deploy the mail aliases and Postfix configuration.

  • irc.yml deploys static and templated configuration to the IRC servers, including oper blocks for users defined in group_vars/all/users.yml.

  • ldap_ban.yml disables user accounts in LDAP and terminates their sessions on the shell servers; it requires python-ldap installed. Invoke as follows:

     ansible-playbook ldap_ban.yml
    

    For scripting purposes, the script accepts a comma-separated list of users, (users), and a Boolean determining if the homedirs should be deleted (delete).

Usage

Install a package

See doc/Installing_packages.md.

Making a configuration change

  1. Prepare your change for shell-etc, test it locally.
  2. Create a pull-request for it on Github, wait for a review.
  3. Perform a signed merge into master: git merge -S --no-ff branch
    Only merge into master things that you will deploy immediately. Do not merge if you aren't in a position to follow-up with a deploy.
  4. Run the shell.yml playbook, see below.

Sync packages & configuration across all shell servers

Simply run the appropriate Ansible playbook:

ansible-playbook shell.yml