initial download and build of sipp
still need to copy startup scripts (client/server) and cron
This commit is contained in:
@@ -36,3 +36,6 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- nrpe
|
||||
- hosts: sipclient
|
||||
roles:
|
||||
- sipclient
|
||||
|
||||
@@ -23,3 +23,10 @@
|
||||
content: "{{ lookup('template', '{{ role_path }}/templates/hosts.j2') }}"
|
||||
state: present
|
||||
tags: update_hosts
|
||||
- name: install programs and libraries
|
||||
become: true
|
||||
apt:
|
||||
name: [ 'expect', 'ftp', 'cadaver', 'iperf', 'iperf3', 'libpcap0.8', 'libsctp1', 'libsctp-dev', 'libncurses-dev', 'libssl-dev', 'libpcap-dev', 'vim', 'mc', 'smbclient', 'ncurses-dev' ]
|
||||
update_cache: true
|
||||
state: present
|
||||
tags: install_packages
|
||||
|
||||
8
roles/sipclient/files/startclient.sh
Executable file
8
roles/sipclient/files/startclient.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
if pgrep sipp >/dev/null
|
||||
then
|
||||
echo "sipp is running"
|
||||
else
|
||||
cd /home/pi/sipp
|
||||
./sipp -sn uac_pcap 192.168.198.2 -bg -l 10
|
||||
fi
|
||||
33
roles/sipclient/tasks/main.yaml
Executable file
33
roles/sipclient/tasks/main.yaml
Executable file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: download sipp source
|
||||
get_url:
|
||||
url: "https://github.com/SIPp/sipp/releases/download/v3.5.2/sipp-3.5.2.tar.gz"
|
||||
dest: "/home/pi/sipp-3.5.2.tar.gz"
|
||||
register: sipp_source
|
||||
tags: sipp
|
||||
- name: Unpacking SIPP
|
||||
unarchive:
|
||||
copy: no
|
||||
dest: /home/pi/
|
||||
src: "/home/pi/sipp-3.5.2.tar.gz"
|
||||
when: sipp_source.changed
|
||||
register: sipp_source_unpack
|
||||
tags: sipp
|
||||
- name: move sipp directory
|
||||
command: 'mv sipp-3.5.2 sipp'
|
||||
when: sipp_source_unpack is changed
|
||||
register: sipp_move_directory
|
||||
tags: sipp
|
||||
- name: configure sipp
|
||||
command: "./configure --with-openssl --with-pcap --with-sctp"
|
||||
args:
|
||||
chdir: "/home/pi/sipp"
|
||||
when: sipp_move_directory is changed
|
||||
tags: sipp
|
||||
register: sipp_configure
|
||||
- name: build sipp
|
||||
shell: make
|
||||
when: sipp_configure is changed
|
||||
args:
|
||||
chdir: "/home/pi/sipp"
|
||||
tags: sipp
|
||||
9
roles/sipserver/files/start.sh
Executable file
9
roles/sipserver/files/start.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
if pgrep sipp >/dev/null
|
||||
then
|
||||
echo "sipp is running"
|
||||
else
|
||||
cd /home/pi/sipp
|
||||
./sipp -sn uas -bg
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user