2017-02-21 20:20:04 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install radius server
|
2018-07-17 10:43:31 +02:00
|
|
|
apt: name=freeradius
|
2017-02-21 20:20:04 +01:00
|
|
|
|
|
|
|
- name: Ensure certificates are available
|
2018-07-17 10:43:31 +02:00
|
|
|
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/freeradius/3.0/certs/srv.key -out /etc/freeradius/3.0/certs/srv.crt -days 730 -subj "/CN={{ ansible_fqdn }}" creates=/etc/freeradius/3.0/certs/srv.crt
|
2017-02-21 20:20:04 +01:00
|
|
|
notify: Restart freeradius
|
|
|
|
|
|
|
|
- name: Ensure correct certificate permissions
|
2018-07-17 10:43:31 +02:00
|
|
|
file: path=/etc/freeradius/3.0/certs/srv.key owner=freerad mode=0400
|
2017-02-21 20:20:04 +01:00
|
|
|
notify: Restart freeradius
|
|
|
|
|
2019-03-25 20:42:27 +01:00
|
|
|
- name: Request nsupdate key for certificate
|
|
|
|
include_role: name=acme-dnskey-generate
|
|
|
|
vars:
|
|
|
|
acme_dnskey_san_domains:
|
|
|
|
- "{{ radius_hostname }}"
|
|
|
|
- "{{ radius_cn }}"
|
|
|
|
|
|
|
|
- name: Configure certificate manager for radius
|
2019-05-20 19:49:08 +02:00
|
|
|
template: src=certs.j2 dest=/etc/acertmgr/{{ radius_hostname }}.conf
|
2019-03-25 20:42:27 +01:00
|
|
|
notify: Run acertmgr
|
|
|
|
|
2017-02-21 20:20:04 +01:00
|
|
|
- name: Create DH parameters
|
|
|
|
command: openssl dhparam -outform PEM -out {{ item }} 2048 creates={{ item }}
|
|
|
|
with_items:
|
2018-07-17 10:43:31 +02:00
|
|
|
- /etc/freeradius/3.0/certs/dh
|
2017-02-21 20:20:04 +01:00
|
|
|
notify: Restart freeradius
|
|
|
|
|
|
|
|
- name: Configure radius server
|
2018-07-17 10:43:31 +02:00
|
|
|
template: src={{ item }}.j2 dest=/etc/freeradius/3.0/{{ item }} owner=freerad group=freerad
|
|
|
|
with_items:
|
2019-03-09 18:38:07 +01:00
|
|
|
- clients.conf
|
2017-02-21 20:20:04 +01:00
|
|
|
notify: Restart freeradius
|
2018-07-17 10:43:31 +02:00
|
|
|
|
|
|
|
- name: Configure radius server
|
|
|
|
copy: src={{ item }} dest=/etc/freeradius/3.0/{{ item }} owner=freerad group=freerad
|
2017-02-21 20:20:04 +01:00
|
|
|
with_items:
|
2019-03-09 18:38:07 +01:00
|
|
|
- mods-available/eap
|
|
|
|
- mods-config/files/authorize
|
|
|
|
- sites-available/default
|
2018-07-17 10:43:31 +02:00
|
|
|
notify: Restart freeradius
|
2017-02-21 20:20:04 +01:00
|
|
|
|
|
|
|
- name: Start the radius server
|
|
|
|
service: name=freeradius state=started enabled=yes
|