-updates to hosts

-changes to templates for scripts
This commit is contained in:
mpelle426
2019-07-12 14:18:25 +01:00
parent 16b3b5e162
commit 2ed3936e53
5 changed files with 12 additions and 8 deletions

10
hosts
View File

@@ -1,9 +1,9 @@
# list all of the raspberry PI devices in the network # list all of the raspberry PI devices in the network
# the host name on each will be set to the first column # the host name on each will be set to the first column
# it can be 1-20 characters, letters, digits, and hyphens # it can be 1-20 characters, letters, digits, and hyphens
ned-host1 ansible_host=147.191.214.121 ned-host1 ansible_host=192.168.88.217
ned-host2 ansible_host=192.168.88.217 ned-host2 ansible_host=192.168.88.234
ned-host3 ansible_host=192.168.88.230 ned-host3 ansible_host=192.168.88.218
[ansible-hosts] [ansible-hosts]
# there must only be one ansible-host. this is the device # there must only be one ansible-host. this is the device
@@ -16,6 +16,10 @@ ned-host1
ned-host2 ned-host2
ned-host3 ned-host3
[pi:vars]
vncpassword=vncpass99
pipassword=pipassword99
[samba-server] [samba-server]
# it is best to have only one samba-server host # it is best to have only one samba-server host
ned-host1 ned-host1

View File

@@ -4,5 +4,5 @@ then
echo "sipp is running" echo "sipp is running"
else else
cd /home/pi/sipp cd /home/pi/sipp
./sipp -sn uac_pcap 192.168.198.2 -bg -l 40 ./sipp -sn uac_pcap {{ hostvars[groups['sipserver'][0]].ansible_host }} -bg -l 40
fi fi

View File

@@ -33,7 +33,7 @@
tags: sipp tags: sipp
- name: copy scripts - name: copy scripts
when: sipp_move_directory is changed when: sipp_move_directory is changed
copy: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: pi owner: pi
@@ -45,7 +45,7 @@
- { src: "{{ role_path }}/files/stopclient.sh", dest: "/home/pi/sipp/stopclient.sh" } - { src: "{{ role_path }}/files/stopclient.sh", dest: "/home/pi/sipp/stopclient.sh" }
tags: sipp tags: sipp
- name: copy scripts2 - name: copy scripts2
copy: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: pi owner: pi

View File

@@ -13,6 +13,6 @@ if pgrep -f test_file >/dev/null
then then
exit 0 exit 0
else else
smbclient //192.168.88.230/share -c "get $file" -A ~/.credentials smbclient //{{ hostvars[groups['samba-server'][0]].ansible_host }}/share -c "get $file" -A ~/.credentials
fi fi

View File

@@ -8,7 +8,7 @@
job: "/usr/bin/perl -e 'sleep int rand 3500' && /home/pi/scripts/smb-session.sh" job: "/usr/bin/perl -e 'sleep int rand 3500' && /home/pi/scripts/smb-session.sh"
tags: smbtraff_cron tags: smbtraff_cron
- name: copy smb-session.sh to scripts directory - name: copy smb-session.sh to scripts directory
copy: template:
src: "{{ role_path }}/files/smb-session.sh" src: "{{ role_path }}/files/smb-session.sh"
dest: /home/pi/scripts/smb-session.sh dest: /home/pi/scripts/smb-session.sh
owner: pi owner: pi