-
Notifications
You must be signed in to change notification settings - Fork 25
/
playbook.yml
28 lines (25 loc) · 868 Bytes
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
- hosts: all
become: yes
tasks:
- name: Install Requirements
apt: name={{ item }} state=present
with_items:
- openjdk-8-jdk
- maven
- tmux
- htop
- name: Compile source code.
command: "mvn package"
args:
creates: "/vagrant/node/target/node-1.0.jar"
chdir: "/vagrant/"
when: "'rtu' in ansible_hostname or 'hmi' in ansible_hostname"
- name: Startup RTU
shell: "tmux new -d java -jar /vagrant/node/target/node-1.0.jar && tmux send script SPACE /vagrant/scripts/rtu.cmd ENTER"
become_user: vagrant
when: "'rtu' in ansible_hostname"
- name: Startup HMI
shell: "tmux new -d java -jar /vagrant/node/target/node-1.0.jar && tmux send script SPACE /vagrant/scripts/hmi.cmd ENTER"
become_user: vagrant
when: "'hmi' in ansible_hostname"