---
# Controls access to user 'perfact' on all hosts and set up users on phonehome.
# This will remove SSH keys for users that have lost access and also those that
# were temporarily added (e.g. TODO).
#
# Add the new user include laptop-key at data/users/LOGINNAME and execute

# Access rights are determined by matching host-department assignments in
# data/hosts/ with those in data/users/.
# Additionally, keys can be added manually to the list 'extra_ssh_keys' (host
# attribute). Check the manual for details ("How SSH-Keys are deployed").


# Peter Lacke will close the firewall if too many ssh connections are created.
# To make using this role easier, all hosts except for those at Peterlacke are
# done first.
- hosts: all:!peterlackegroup
  gather_facts: no
  roles:
  - ssh_keys

# set-up users on phonehome
- hosts: pf-phonehome-2020-prod
  roles:
  - phonehome-server-perfact-users

# Hosts at Peter Lacke will be handled one by one with a pause in-between
- hosts: peterlackegroup
  serial: 1
  gather_facts: no
  roles:
  - ssh_keys
  tasks:
  - pause:
      prompt: "Wait in-between playbook execution at Peterlacke to avoid issues with the firewall"
      seconds: 20
