-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6856000
commit 0a8c420
Showing
9 changed files
with
130 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# FreeBSD | ||
|
||
It is only possible to install Algo on existing systems only in order to avoid recompiling the kernel while deploying | ||
|
||
## Pre-paring the system | ||
|
||
Ensure that the following kernel options are enabled: | ||
|
||
``` | ||
# sysctl kern.conftxt | grep -iE "IPSEC|crypto" | ||
options IPSEC | ||
options IPSEC_NAT_T | ||
device crypto | ||
``` | ||
|
||
## Available roles | ||
|
||
* vpn | ||
|
||
## Installation | ||
|
||
`ansible-playbook deploy.yml -t local,vpn -e "server_ip=$server_ip server_user=$server_user IP_subject_alt_name=$server_ip Store_CAKEY=N" --skip-tags cloud` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
|
||
- name: Copy the keys to the strongswan directory | ||
copy: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
owner: "{{ item.owner }}" | ||
group: "{{ item.group }}" | ||
mode: "{{ item.mode }}" | ||
with_items: | ||
- src: "configs/{{ IP_subject_alt_name }}/pki/cacert.pem" | ||
dest: "{{ config_prefix|default('/') }}etc/ipsec.d/cacerts/ca.crt" | ||
owner: strongswan | ||
group: "{{ root_group|default('root') }}" | ||
mode: "0600" | ||
- src: "configs/{{ IP_subject_alt_name }}/pki/certs/{{ IP_subject_alt_name }}.crt" | ||
dest: "{{ config_prefix|default('/') }}etc/ipsec.d/certs/{{ IP_subject_alt_name }}.crt" | ||
owner: strongswan | ||
group: "{{ root_group|default('root') }}" | ||
mode: "0600" | ||
- src: "configs/{{ IP_subject_alt_name }}/pki/private/{{ IP_subject_alt_name }}.key" | ||
dest: "{{ config_prefix|default('/') }}etc/ipsec.d/private/{{ IP_subject_alt_name }}.key" | ||
owner: strongswan | ||
group: "{{ root_group|default('root') }}" | ||
mode: "0600" | ||
notify: | ||
- restart strongswan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
|
||
- name: Setup the config files from our templates | ||
template: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
owner: "{{ item.owner }}" | ||
group: "{{ item.group }}" | ||
mode: "{{ item.mode }}" | ||
with_items: | ||
- src: strongswan.conf.j2 | ||
dest: "{{ config_prefix|default('/') }}etc/strongswan.conf" | ||
owner: root | ||
group: "{{ root_group|default('root') }}" | ||
mode: "0644" | ||
- src: ipsec.conf.j2 | ||
dest: "{{ config_prefix|default('/') }}etc/ipsec.conf" | ||
owner: root | ||
group: "{{ root_group|default('root') }}" | ||
mode: "0644" | ||
- src: ipsec.secrets.j2 | ||
dest: "{{ config_prefix|default('/') }}etc/ipsec.secrets" | ||
owner: strongswan | ||
group: "{{ root_group|default('root') }}" | ||
mode: "0600" | ||
notify: | ||
- restart strongswan | ||
|
||
- name: Get loaded plugins | ||
shell: > | ||
find {{ config_prefix|default('/') }}etc/strongswan.d/charon/ -type f -name '*.conf' -exec basename {} \; | cut -f1 -d. | ||
register: strongswan_plugins | ||
|
||
- name: Disable unneeded plugins | ||
lineinfile: dest="{{ config_prefix|default('/') }}etc/strongswan.d/charon/{{ item }}.conf" regexp='.*load.*' line='load = no' state=present | ||
notify: | ||
- restart strongswan | ||
when: item not in strongswan_enabled_plugins and item not in strongswan_additional_plugins | ||
with_items: "{{ strongswan_plugins.stdout_lines }}" | ||
|
||
- name: Ensure that required plugins are enabled | ||
lineinfile: dest="{{ config_prefix|default('/') }}etc/strongswan.d/charon/{{ item }}.conf" regexp='.*load.*' line='load = yes' state=present | ||
notify: | ||
- restart strongswan | ||
when: item in strongswan_enabled_plugins or item in strongswan_additional_plugins | ||
with_items: "{{ strongswan_plugins.stdout_lines }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters