80 lines
1.8 KiB
YAML
80 lines
1.8 KiB
YAML
|
- name: Install dependencies for this role
|
||
|
apt:
|
||
|
pkg: "{{ item }}"
|
||
|
state: present
|
||
|
with_items:
|
||
|
- bridge-utils
|
||
|
- ebtables
|
||
|
- git
|
||
|
- iproute2
|
||
|
- libnetfilter-conntrack-dev
|
||
|
- libnfnetlink-dev
|
||
|
- python3-dev
|
||
|
- python3-virtualenv
|
||
|
- virtualenv
|
||
|
- gcc
|
||
|
- libnl-3-dev
|
||
|
- libevent-dev
|
||
|
|
||
|
- name: Get Tunneldigger
|
||
|
git:
|
||
|
repo: https://github.com/wlanslovenija/tunneldigger
|
||
|
dest: /srv/tunneldigger
|
||
|
register: tunneldigger
|
||
|
|
||
|
- name: generate virtualenv.
|
||
|
command:
|
||
|
"virtualenv -p /usr/bin/python3 env_tunneldigger"
|
||
|
args:
|
||
|
chdir: /srv/tunneldigger/
|
||
|
creates: "/srv/tunneldigger/env_tunneldigger/bin/python3"
|
||
|
when: tunneldigger.changed
|
||
|
|
||
|
- name: Install python dependencies
|
||
|
command: "/srv/tunneldigger/env_tunneldigger/bin/python setup.py install"
|
||
|
args:
|
||
|
chdir: /srv/tunneldigger/broker
|
||
|
when: tunneldigger.changed
|
||
|
|
||
|
- name: Copy l2tp broker config template
|
||
|
template:
|
||
|
src: l2tp_broker.cfg.j2
|
||
|
dest: /srv/tunneldigger/l2tp_broker.cfg
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0444
|
||
|
|
||
|
- name: Copy tunneldigger script template
|
||
|
template:
|
||
|
src: bataddif.sh.j2
|
||
|
dest: /srv/tunneldigger/bataddif.sh
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0500
|
||
|
|
||
|
- name: Copy tunneldigger scripts
|
||
|
template:
|
||
|
src: batdelif.sh.j2
|
||
|
dest: /srv/tunneldigger/batdelif.sh
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0500
|
||
|
|
||
|
- name: Copy tunneldigger service template
|
||
|
copy:
|
||
|
src: tunneldigger.service
|
||
|
dest: /etc/systemd/system/tunneldigger.service
|
||
|
mode: 0444
|
||
|
|
||
|
- name: Deploy tunneldigger.conf to /etc/modules-load.d/
|
||
|
copy:
|
||
|
src: tunneldigger.conf
|
||
|
dest: /etc/modules-load.d/tunneldigger.conf
|
||
|
notify: load kernel modules
|
||
|
|
||
|
- name: Tunneldigger reload
|
||
|
command: "{{item}}"
|
||
|
with_items:
|
||
|
- systemctl daemon-reload
|
||
|
- systemctl enable tunneldigger.service
|
||
|
when: tunneldigger.changed
|