-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
306 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ Vagrantfile | |
*.retry | ||
*.iml | ||
*.idea | ||
vagrant_image/packer_cache/ | ||
vagrant_image/vagrant.box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
--- | ||
- hosts: all | ||
become: yes | ||
tasks: | ||
- name: Configure for packaging | ||
include_role: | ||
name: vagrant-box | ||
when: "'buildImage' in ansible_hostname" | ||
tasks: | ||
- name: Install Requirements | ||
apt: name={{ item }} state=present | ||
with_items: | ||
- openjdk-8-jdk | ||
- maven | ||
- tmux | ||
- htop | ||
|
||
- name: Setup Environmnet for TestBed | ||
include_role: | ||
name: node | ||
when: "'buildImage' in ansible_hostname" | ||
- 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 cat /vagrant/scripts/rtu.cmd | java -jar /vagrant/node/target/node-1.0.jar" | ||
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 cat /vagrant/scripts/hmi.cmd | java -jar /vagrant/node/target/node-1.0.jar" | ||
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" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ hmi-interval 1000 | |
remote-hosts 127.0.0.1 | ||
show | ||
run | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
choose-mirror-bin mirror/http/proxy string | ||
d-i base-installer/kernel/override-image string linux-server | ||
d-i clock-setup/utc boolean true | ||
d-i clock-setup/utc-auto boolean true | ||
d-i finish-install/reboot_in_progress note | ||
d-i grub-installer/only_debian boolean true | ||
d-i grub-installer/with_other_os boolean true | ||
d-i partman-auto/disk string /dev/sda | ||
d-i partman-auto-lvm/guided_size string max | ||
d-i partman-auto/choose_recipe select atomic | ||
d-i partman-auto/method string lvm | ||
d-i partman-lvm/confirm boolean true | ||
d-i partman-lvm/confirm boolean true | ||
d-i partman-lvm/confirm_nooverwrite boolean true | ||
d-i partman-lvm/device_remove_lvm boolean true | ||
d-i partman/choose_partition select finish | ||
d-i partman/confirm boolean true | ||
d-i partman/confirm_nooverwrite boolean true | ||
d-i partman/confirm_write_new_label boolean true | ||
d-i pkgsel/include string openssh-server | ||
d-i pkgsel/install-language-support boolean false | ||
d-i pkgsel/update-policy select none | ||
d-i pkgsel/upgrade select full-upgrade | ||
d-i time/zone string UTC | ||
tasksel tasksel/first multiselect standard, ubuntu-server | ||
|
||
d-i console-setup/ask_detect boolean false | ||
d-i keyboard-configuration/layoutcode string gb | ||
d-i keyboard-configuration/modelcode string pc105 | ||
d-i debian-installer/locale string en_GB | ||
|
||
# Create vagrant user account. | ||
d-i passwd/user-fullname string vagrant | ||
d-i passwd/username string vagrant | ||
d-i passwd/user-password password vagrant | ||
d-i passwd/user-password-again password vagrant | ||
d-i user-setup/allow-password-weak boolean true | ||
d-i user-setup/encrypt-home boolean false | ||
d-i passwd/user-default-groups vagrant sudo | ||
d-i passwd/user-uid string 900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash -eux | ||
|
||
# Install Ansible repository. | ||
apt -y update && apt-get -y upgrade | ||
apt -y install ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash -eux | ||
|
||
# Apt cleanup. | ||
apt autoremove | ||
apt update | ||
|
||
# Delete unneeded files. | ||
rm -f /home/vagrant/*.sh | ||
|
||
# Zero out the rest of the free space using dd, then delete the written file. | ||
dd if=/dev/zero of=/EMPTY bs=1M | ||
rm -f /EMPTY | ||
|
||
# Add `sync` so Packer doesn't quit too early, before the large file is deleted. | ||
sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash -eux | ||
|
||
# Add vagrant user to sudoers. | ||
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | ||
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers | ||
|
||
# Disable daily apt unattended updates. | ||
echo 'APT::Periodic::Enable "0";' >> /etc/apt/apt.conf.d/10periodic |
Oops, something went wrong.