Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
client fixes (trailofbits#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunph1ld authored and dguido committed Jun 21, 2017
1 parent b18f9bf commit 124e80a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions deploy_client.yml
Expand Up @@ -8,7 +8,7 @@
add_host:
name: "{{ client_ip }}"
groups: client-host
ansible_ssh_user: "{{ server_ssh_user }}"
ansible_ssh_user: "{{ ssh_user }}"
vpn_user: "{{ vpn_user }}"
server_ip: "{{ server_ip }}"

Expand All @@ -35,7 +35,7 @@
sudo apt-get update -qq && sudo apt-get install -qq -y python2.7 &&
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
changed_when: false
when: "'ubuntu' in distribution.stdout"
when: "'ubuntu' in distribution.stdout|lower"

- name: Fedora 25 | Install prerequisites
raw: >
Expand All @@ -44,7 +44,7 @@
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 &&
rpm -ql python2-dnf || dnf install python2-dnf -y
changed_when: false
when: "'fedora' in distribution.stdout"
when: "'fedora' in distribution.stdout|lower"

roles:
- { role: client, tags: ['client'] }
4 changes: 2 additions & 2 deletions docs/client-linux.md
Expand Up @@ -9,13 +9,13 @@ The playbook is `deploy_client.yml`

* `client_ip` - The IP address of your client machine (You can use `localhost` in order to deploy locally)
* `vpn_user` - The username. (Ensure that you have valid certificates and keys in the `configs/SERVER_ip/pki/` directory)
* `client_ssh_user` - The username that we need to use in order to connect to the client machine via SSH (ignore if you are deploying locally)
* `ssh_user` - The username that we need to use in order to connect to the client machine via SSH (ignore if you are deploying locally)
* `server_ip` - The vpn server ip address

### Example:

```shell
ansible-playbook deploy_client.yml -e 'client_ip=client.com vpn_user=jack server_ip=vpn-server.com server_ssh_user=root'
ansible-playbook deploy_client.yml -e 'client_ip=client.com vpn_user=jack server_ip=vpn-server.com ssh_user=root'
```

### Additional options:
Expand Down
8 changes: 4 additions & 4 deletions roles/client/tasks/main.yml
Expand Up @@ -39,9 +39,9 @@
create: yes
with_items:
- dest: "{{ configs_prefix }}/ipsec.conf"
line: "include ipsec.*.conf"
line: "include ipsec.{{ IP_subject_alt_name }}.conf"
- dest: "{{ configs_prefix }}/ipsec.secrets"
line: "include ipsec.*.secrets"
line: "include ipsec.{{ IP_subject_alt_name }}.secrets"
notify:
- restart strongswan

Expand All @@ -51,10 +51,10 @@
dest: "{{ item.dest }}"
with_items:
- src: "configs/{{ IP_subject_alt_name }}/pki/certs/{{ vpn_user }}.crt"
dest: "{{ configs_prefix }}/ipsec.d/certs/{{ IP_subject_alt_name }}_{{ vpn_user }}.crt"
dest: "{{ configs_prefix }}/ipsec.d/certs/{{ vpn_user }}.crt"
- src: "configs/{{ IP_subject_alt_name }}/pki/cacert.pem"
dest: "{{ configs_prefix }}/ipsec.d/cacerts/{{ IP_subject_alt_name }}.pem"
- src: "configs/{{ IP_subject_alt_name }}/pki/private/{{ vpn_user }}.key"
dest: "{{ configs_prefix }}/ipsec.d/private/{{ IP_subject_alt_name }}_{{ vpn_user }}.key"
dest: "{{ configs_prefix }}/ipsec.d/private/{{ vpn_user }}.key"
notify:
- restart strongswan

0 comments on commit 124e80a

Please sign in to comment.