mirror of
https://github.com/trailofbits/algo.git
synced 2025-06-07 15:43:54 +02:00
client fixes (#605)
This commit is contained in:
parent
9d8e39f63d
commit
78bd5b017c
3 changed files with 9 additions and 9 deletions
|
@ -8,7 +8,7 @@
|
||||||
add_host:
|
add_host:
|
||||||
name: "{{ client_ip }}"
|
name: "{{ client_ip }}"
|
||||||
groups: client-host
|
groups: client-host
|
||||||
ansible_ssh_user: "{{ server_ssh_user }}"
|
ansible_ssh_user: "{{ ssh_user }}"
|
||||||
vpn_user: "{{ vpn_user }}"
|
vpn_user: "{{ vpn_user }}"
|
||||||
server_ip: "{{ server_ip }}"
|
server_ip: "{{ server_ip }}"
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
sudo apt-get update -qq && sudo apt-get install -qq -y python2.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
|
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: "'ubuntu' in distribution.stdout"
|
when: "'ubuntu' in distribution.stdout|lower"
|
||||||
|
|
||||||
- name: Fedora 25 | Install prerequisites
|
- name: Fedora 25 | Install prerequisites
|
||||||
raw: >
|
raw: >
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 &&
|
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 &&
|
||||||
rpm -ql python2-dnf || dnf install python2-dnf -y
|
rpm -ql python2-dnf || dnf install python2-dnf -y
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: "'fedora' in distribution.stdout"
|
when: "'fedora' in distribution.stdout|lower"
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- { role: client, tags: ['client'] }
|
- { role: client, tags: ['client'] }
|
||||||
|
|
|
@ -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)
|
* `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)
|
* `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
|
* `server_ip` - The vpn server ip address
|
||||||
|
|
||||||
### Example:
|
### Example:
|
||||||
|
|
||||||
```shell
|
```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:
|
### Additional options:
|
||||||
|
|
|
@ -39,9 +39,9 @@
|
||||||
create: yes
|
create: yes
|
||||||
with_items:
|
with_items:
|
||||||
- dest: "{{ configs_prefix }}/ipsec.conf"
|
- dest: "{{ configs_prefix }}/ipsec.conf"
|
||||||
line: "include ipsec.*.conf"
|
line: "include ipsec.{{ IP_subject_alt_name }}.conf"
|
||||||
- dest: "{{ configs_prefix }}/ipsec.secrets"
|
- dest: "{{ configs_prefix }}/ipsec.secrets"
|
||||||
line: "include ipsec.*.secrets"
|
line: "include ipsec.{{ IP_subject_alt_name }}.secrets"
|
||||||
notify:
|
notify:
|
||||||
- restart strongswan
|
- restart strongswan
|
||||||
|
|
||||||
|
@ -51,10 +51,10 @@
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
with_items:
|
with_items:
|
||||||
- src: "configs/{{ IP_subject_alt_name }}/pki/certs/{{ vpn_user }}.crt"
|
- 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"
|
- src: "configs/{{ IP_subject_alt_name }}/pki/cacert.pem"
|
||||||
dest: "{{ configs_prefix }}/ipsec.d/cacerts/{{ IP_subject_alt_name }}.pem"
|
dest: "{{ configs_prefix }}/ipsec.d/cacerts/{{ IP_subject_alt_name }}.pem"
|
||||||
- src: "configs/{{ IP_subject_alt_name }}/pki/private/{{ vpn_user }}.key"
|
- 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:
|
notify:
|
||||||
- restart strongswan
|
- restart strongswan
|
||||||
|
|
Loading…
Add table
Reference in a new issue