Skip to content

Commit

Permalink
Ansible Installation script is now fine
Browse files Browse the repository at this point in the history
+ Ansible isntallation script is now fine
+ added jars to support compilation and execution
+ Seems all is OK.
  • Loading branch information
moncho-mendez committed Nov 22, 2018
1 parent 4290b06 commit 5a10e21
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build.xml
nbproject/*


FilterTLK\.retry
Binary file added AbsoluteLayout.jar
Binary file not shown.
11 changes: 0 additions & 11 deletions FilterInstaller.yml

This file was deleted.

91 changes: 91 additions & 0 deletions FilterTLK.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
#Note: This playbook only works in Ubuntu Systems
- hosts: dest
vars:
dest_dir: "/opt/filter.tlk/" #Change the installation directory

tasks:
- name: ensure {{item}} is in the latest version
apt:
name: "{{item}}"
state: latest
with_items: [ "wireshark", "libndpi-bin", "lua5.2", "default-jdk", "tcpdump", "dialog", "iproute2" ]
when: ansible_distribution == 'Ubuntu'

- name: copy ndpiReader to the Wireshark's extcap
copy:
src: ndpiReader
dest: /usr/lib/x86_64-linux-gnu/wireshark/extcap/
when: ansible_distribution == 'Ubuntu'

- name: copy ndpi.lua to the Wireshark's plugins
copy:
src: ndpi.lua
dest: /usr/lib/x86_64-linux-gnu/wireshark/plugins/
when: ansible_distribution == 'Ubuntu'

- name: Remove previous installation
file:
path: "{{ dest_dir }}"
state: absent

- name: Create directory for compiling source
file:
path: /tmp/src/dest
state: directory

- name: install additional tools
copy:
src: "{{ item }}"
dest: "/tmp/src"
with_items:
- beansbinding-1.2.1.jar
- AbsoluteLayout.jar

- name: Synchronize source
synchronize:
src: src
dest: /tmp/src
mode: push

- name: compile src
shell: javac -classpath ../dest:../AbsoluteLayout.jar:../beansbinding-1.2.1.jar -d ../dest es/uvigo/esei/filter/*.java
args:
chdir: /tmp/src/src

- name: make jar file
shell: |
echo Main-Class: es.uvigo.esei.filter.Main > ../mf.txt
jar xf ../beansbinding-1.2.1.jar
jar xf ../AbsoluteLayout.jar
mkdir -p es/uvigo/esei/images
cp ../src/es/uvigo/esei/images/* es/uvigo/esei/images/
jar cfm ../BDAT.jar ../mf.txt *
args:
chdir: /tmp/src/dest

- name: Create installation destination dir
file:
path: "{{ dest_dir }}/bin"
state: directory

- name: install BDAT
shell: mv /tmp/src/BDAT.jar {{ dest_dir }}/bin

- name: install additional tools
copy:
src: "{{ item }}"
dest: "{{ dest_dir }}/bin"
with_items: ['IPTRB.sh', 'BTT.lua']

- name: clean compilation dir
file:
path: "/tmp/src"
state: absent

- name: Print information
debug:
msg: |
Filter.tlk sucessfully installed in {{ dest_dir }}.
Tools have been included in {{ dest_dir }}/bin/
To launch BTT use wireshark -X lua_script:{{ dest_dir }}/bin/BTT.lua
2 changes: 2 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[defaults]
inventory = ./hosts
Binary file added beansbinding-1.2.1.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[dest]
localhost ansible_connection=local
Binary file added org-jdesktop-beansbinding.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/es/uvigo/esei/filter/main.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

/**
*
* @author bruno
* @author Bruno
*/
public class main {
public class Main {

public static void main(String[] args){
/*Make the call to MenuFrame, which opens the main menu.*/
Expand Down
Binary file removed src/es/uvigo/esei/images/índice.jpg
Binary file not shown.
Binary file removed src/es/uvigo/esei/images/índice_1.jpg
Binary file not shown.

0 comments on commit 5a10e21

Please sign in to comment.