Add Vagrantfile for development
Signed-off-by: Mattia Verga <mattia.verga@proton.me>
This commit is contained in:
parent
d580f4b498
commit
0722694344
4 changed files with 93 additions and 1 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -25,4 +25,7 @@ toddlers.toml
|
||||||
tests/msg.json
|
tests/msg.json
|
||||||
|
|
||||||
# Python virtualenv
|
# Python virtualenv
|
||||||
.venv/
|
.venv/
|
||||||
|
|
||||||
|
# Vagrant related
|
||||||
|
.vagrant/
|
||||||
|
|
33
Vagrantfile
vendored
Normal file
33
Vagrantfile
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
VAGRANTFILE_API_VERSION = "2"
|
||||||
|
|
||||||
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
|
config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/36/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-36-1.5.x86_64.vagrant-libvirt.box"
|
||||||
|
config.vm.box = "f36-cloud-libvirt"
|
||||||
|
|
||||||
|
# Create the toddlers dev box
|
||||||
|
config.vm.define "toddlers" do |toddlers|
|
||||||
|
toddlers.vm.host_name = "toddlers-dev.example.com"
|
||||||
|
|
||||||
|
toddlers.vm.provider :libvirt do |domain|
|
||||||
|
# Season to taste
|
||||||
|
domain.cpus = Etc.nprocessors
|
||||||
|
domain.cpu_mode = "host-passthrough"
|
||||||
|
domain.graphics_type = "spice"
|
||||||
|
# The unit tests use a lot of RAM.
|
||||||
|
domain.memory = 2048
|
||||||
|
domain.video_type = "qxl"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
config.vm.synced_folder ".", "/home/vagrant/toddlers", type: "sshfs"
|
||||||
|
|
||||||
|
# bootstrap and run with ansible
|
||||||
|
config.vm.provision "ansible" do |ansible|
|
||||||
|
ansible.playbook = "ansible/playbook.yml"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
8
ansible/playbook.yml
Normal file
8
ansible/playbook.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
- hosts: toddlers
|
||||||
|
become: true
|
||||||
|
become_method: sudo
|
||||||
|
vars:
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
roles:
|
||||||
|
- toddlers
|
48
ansible/roles/toddlers/tasks/main.yml
Normal file
48
ansible/roles/toddlers/tasks/main.yml
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
---
|
||||||
|
- name: Upgrade all packages
|
||||||
|
dnf:
|
||||||
|
name: "*"
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
dnf:
|
||||||
|
name:
|
||||||
|
- fedora-messaging
|
||||||
|
- python3-arrow
|
||||||
|
- python3-beanbag
|
||||||
|
- python3-beautifulsoup4
|
||||||
|
- python3-bugzilla
|
||||||
|
- python3-defusedxml
|
||||||
|
- python3-fasjson-client
|
||||||
|
- python3-fedora
|
||||||
|
- python3-GitPython
|
||||||
|
- python3-gobject
|
||||||
|
- python3-pagure-messages
|
||||||
|
- python3-pdc-client
|
||||||
|
- python3-requests
|
||||||
|
- python3-koji
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Install tests dependencies
|
||||||
|
dnf:
|
||||||
|
name:
|
||||||
|
- cairo-devel
|
||||||
|
- cairo-gobject-devel
|
||||||
|
- gobject-introspection-devel
|
||||||
|
- krb5-devel
|
||||||
|
- libmodulemd1
|
||||||
|
- python3.10-devel
|
||||||
|
- python3-tox
|
||||||
|
state: present
|
||||||
|
|
||||||
|
# These aren't available from Koji
|
||||||
|
- name: Install dependencies from PIP
|
||||||
|
pip:
|
||||||
|
name:
|
||||||
|
- pgi
|
||||||
|
|
||||||
|
- name: Create the config file
|
||||||
|
shell: sed -e "s/[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/$(uuidgen)/g" toddlers.toml.example > toddlers.toml
|
||||||
|
args:
|
||||||
|
chdir: /home/vagrant/toddlers/
|
||||||
|
creates: /home/vagrant/toddlers/toddlers.toml
|
Loading…
Add table
Add a link
Reference in a new issue