mirror of
https://github.com/samsapti/bachelor-project.git
synced 2024-11-22 04:47:53 +00:00
Add Vagrantfile and test in Vagrant
This commit is contained in:
parent
a2c3219ed0
commit
9384176bf2
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
/ansible/inventory
|
/ansible/inventory
|
||||||
|
/ansible/.vagrant/
|
||||||
|
|
27
ansible/Vagrantfile
vendored
Normal file
27
ansible/Vagrantfile
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
Vagrant.require_version ">= 2.0.0"
|
||||||
|
N = 2
|
||||||
|
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
(0..N).each do |player_id|
|
||||||
|
vm_name = "mpc-player-#{player_id}"
|
||||||
|
|
||||||
|
config.vm.define vm_name do |player|
|
||||||
|
player.vm.box = "ubuntu/jammy64"
|
||||||
|
player.vm.hostname = vm_name
|
||||||
|
|
||||||
|
player.vm.network :private_network, ip: "192.168.56.#{20 + player_id}"
|
||||||
|
player.vm.provider :virtualbox do |vb|
|
||||||
|
vb.cpus = 4
|
||||||
|
vb.memory = 8192
|
||||||
|
end
|
||||||
|
|
||||||
|
if player_id == N
|
||||||
|
player.vm.provision :ansible do |ansible|
|
||||||
|
ansible.limit = "all"
|
||||||
|
ansible.playbook = "playbook.yml"
|
||||||
|
ansible.ask_vault_pass = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -9,9 +9,10 @@
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ username }}"
|
name: "{{ username }}"
|
||||||
password: "{{ secrets.user_password | ansible.builtin.password_hash('sha512') }}"
|
password: "{{ secrets.user_password | ansible.builtin.password_hash('sha512') }}"
|
||||||
update_password: on_create
|
shell: /bin/bash
|
||||||
groups:
|
groups:
|
||||||
- sudo
|
- sudo
|
||||||
|
update_password: on_create
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Add public SSH key to user {{ username }}
|
- name: Add public SSH key to user {{ username }}
|
||||||
|
|
|
@ -3,10 +3,12 @@
|
||||||
- name: Install dependencies via apt
|
- name: Install dependencies via apt
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ pkgs }}"
|
name: "{{ pkgs }}"
|
||||||
|
update_cache: true
|
||||||
state: present
|
state: present
|
||||||
become_user: root
|
become_user: root
|
||||||
vars:
|
vars:
|
||||||
pkgs:
|
pkgs:
|
||||||
|
- acl
|
||||||
- automake
|
- automake
|
||||||
- build-essential
|
- build-essential
|
||||||
- clang
|
- clang
|
||||||
|
@ -46,4 +48,4 @@
|
||||||
- boost
|
- boost
|
||||||
- libote
|
- libote
|
||||||
- mpir
|
- mpir
|
||||||
- all
|
- semi-party.x
|
||||||
|
|
Loading…
Reference in a new issue