initial download and build of sipp

still need to copy startup scripts (client/server) and cron
This commit is contained in:
Pi
2019-03-14 14:27:10 -04:00
parent 23915d0549
commit 49fd61019b
6 changed files with 62 additions and 0 deletions

2
hosts
View File

@@ -77,3 +77,5 @@ sdwcltm8
sdwsrvm
ubuntu-server-1
[sipclient]
sdwcltm6

View File

@@ -36,3 +36,6 @@
- hosts: all
roles:
- nrpe
- hosts: sipclient
roles:
- sipclient

View File

@@ -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

View 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
View 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
View 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