-update sipp roles. sipp is common, download, compiles, and installs scripts
sipclient and sipserver set up respective cron jobs
This commit is contained in:
10
hosts
10
hosts
@@ -59,7 +59,6 @@ sdwsrvm
|
|||||||
sdwsrvl
|
sdwsrvl
|
||||||
|
|
||||||
[facebook]
|
[facebook]
|
||||||
sdwcltm3
|
|
||||||
sdwcltm5
|
sdwcltm5
|
||||||
sdwsrvm
|
sdwsrvm
|
||||||
sdwcltm4
|
sdwcltm4
|
||||||
@@ -89,7 +88,14 @@ ubuntu-server-1
|
|||||||
[sipclient]
|
[sipclient]
|
||||||
sdwcltm2
|
sdwcltm2
|
||||||
sdwcltm3
|
sdwcltm3
|
||||||
|
sdwcltm4
|
||||||
|
sdwcltm5
|
||||||
sdwcltm6
|
sdwcltm6
|
||||||
|
sdwcltm7
|
||||||
|
sdwcltm8
|
||||||
|
sdwcltm9
|
||||||
|
sdwsrvl
|
||||||
|
sdwsrvm
|
||||||
|
|
||||||
[sipserver]
|
[sipserver]
|
||||||
sdwcltm3
|
ubuntu-server-2
|
||||||
|
|||||||
@@ -39,3 +39,8 @@
|
|||||||
- hosts: sipclient
|
- hosts: sipclient
|
||||||
roles:
|
roles:
|
||||||
- sipp
|
- sipp
|
||||||
|
- sipclient
|
||||||
|
- hosts: sipserver
|
||||||
|
roles:
|
||||||
|
- sipp
|
||||||
|
- sipserver
|
||||||
|
|||||||
20
roles/sipclient/tasks/main.yaml
Executable file
20
roles/sipclient/tasks/main.yaml
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
- name: enable sip client
|
||||||
|
become: true
|
||||||
|
cron:
|
||||||
|
name: "sip client"
|
||||||
|
minute: "*/30"
|
||||||
|
hour: "8-18"
|
||||||
|
weekday: "1-5"
|
||||||
|
job: "/usr/bin/perl -e 'sleep int rand 1800' && /home/pi/sipp/startclient.sh"
|
||||||
|
user: root
|
||||||
|
tags: sipclient_cron
|
||||||
|
- name: stop sip calling after hours
|
||||||
|
become: true
|
||||||
|
cron:
|
||||||
|
name: "stop sip client"
|
||||||
|
hour: "17"
|
||||||
|
weekday: "1-5"
|
||||||
|
job: "/usr/bin/perl -e 'sleep int rand 1800' && /home/pi/sipp/stopclient.sh"
|
||||||
|
user: root
|
||||||
|
tags: sipclient_stop
|
||||||
2
roles/sipp/files/stopclient.sh
Normal file
2
roles/sipp/files/stopclient.sh
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#/bin/bash
|
||||||
|
echo "q" >/dev/udp/127.0.0.1/8888
|
||||||
@@ -42,5 +42,18 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- { src: "{{ role_path }}/files/startserver.sh", dest: "/home/pi/sipp/startserver.sh" }
|
- { src: "{{ role_path }}/files/startserver.sh", dest: "/home/pi/sipp/startserver.sh" }
|
||||||
- { src: "{{ role_path }}/files/startclient.sh", dest: "/home/pi/sipp/startclient.sh" }
|
- { src: "{{ role_path }}/files/startclient.sh", dest: "/home/pi/sipp/startclient.sh" }
|
||||||
|
- { src: "{{ role_path }}/files/stopclient.sh", dest: "/home/pi/sipp/stopclient.sh" }
|
||||||
tags: sipp
|
tags: sipp
|
||||||
|
- name: copy scripts2
|
||||||
|
copy:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
owner: pi
|
||||||
|
group: pi
|
||||||
|
mode: a+x
|
||||||
|
with_items:
|
||||||
|
- { src: "{{ role_path }}/files/startserver.sh", dest: "/home/pi/sipp/startserver.sh" }
|
||||||
|
- { src: "{{ role_path }}/files/startclient.sh", dest: "/home/pi/sipp/startclient.sh" }
|
||||||
|
- { src: "{{ role_path }}/files/stopclient.sh", dest: "/home/pi/sipp/stopclient.sh" }
|
||||||
|
tags: sipp_scripts
|
||||||
|
|
||||||
|
|||||||
9
roles/sipserver/tasks/main.yaml
Executable file
9
roles/sipserver/tasks/main.yaml
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: enable cron job for sip server
|
||||||
|
become: true
|
||||||
|
cron:
|
||||||
|
name: "sipserver"
|
||||||
|
minute: "*/30"
|
||||||
|
user: root
|
||||||
|
job: "/home/pi/sipp/startserver.sh"
|
||||||
|
tags: sipserver_cron
|
||||||
Reference in New Issue
Block a user