---
# default for all
# 80-perfact.conf comes from roles/general/sshd_config/tasks/templates/sshd_config/80-perfact.conf
- name: harden ssh-server perfact default
  tags: sshd_config
  become: true
  template:
    src: "sshd_config/80-perfact.conf"
    dest: "/etc/ssh/sshd_config.d/80-perfact.conf"
    owner: root
    group: root
    mode: 0644
  notify: restart ssh-server


# pf-phonehome-2020-prod needs a very different configuration
# The default config comes from:
#     roles/general/sshd_config/tasks/templates/90-custom.conf
# An individual file can be placed in:
#     roles/NAME-OF_Main-Role/templates/sshd_config/90-custom.conf

# After moving to reoles/genral th search order is:
# "Could not find or access 'sshd_config/90-custom.conf'\nSearched in:
#    roles/general/sshd_config/templates/sshd_config/90-custom.conf
#    roles/general/sshd_config/sshd_config/90-custom.conf
#  This is the individual file for pf-phonehome-2020-prod:
#    roles/phonehome_deploy/templates/sshd_config/90-custom.conf
#    roles/phonehome_deploy/sshd_config/90-custom.conf
#  this is the general template:
#    roles/general/sshd_config/tasks/templates/sshd_config/90-custom.conf
#    roles/general/sshd_config/tasks/sshd_config/90-custom.conf
#    templates/sshd_config/90-custom.conf
#    sshd_config/90-custom.conf

- name: harden ssh-server perfact custom phonehome
  tags: sshd_config
  become: true
  template:
    src: "sshd_config/90-custom.conf"
    dest: "/etc/ssh/sshd_config.d/90-custom.conf"
    owner: root
    group: root
    mode: 0644
  notify: restart ssh-server
