mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-22 21:14:50 +07:00
feat(metal): add dev VM for local development or evaluation
This commit is contained in:
parent
14ab5b24b6
commit
3d73d9efd9
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.vagrant/
|
||||
.venv/
|
||||
book/
|
||||
build/
|
||||
|
@ -4,18 +4,24 @@ default: boot cluster
|
||||
|
||||
boot:
|
||||
ansible-playbook \
|
||||
--inventory hosts.yml \
|
||||
--inventory inventories/prod.yml \
|
||||
main.yml
|
||||
|
||||
cluster:
|
||||
ansible-playbook \
|
||||
--inventory hosts.yml \
|
||||
--inventory inventories/prod.yml \
|
||||
cluster.yml
|
||||
|
||||
shutdown:
|
||||
ansible-playbook \
|
||||
--inventory hosts.yml \
|
||||
--inventory inventories/prod.yml \
|
||||
shutdown.yml
|
||||
|
||||
lint:
|
||||
ansible-lint --project-dir .
|
||||
|
||||
dev:
|
||||
vagrant up
|
||||
ansible-playbook \
|
||||
--inventory inventories/dev.yml \
|
||||
cluster.yml
|
||||
|
20
metal/Vagrantfile
vendored
Normal file
20
metal/Vagrantfile
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "rockylinux/8"
|
||||
|
||||
config.vm.define "test" do |test|
|
||||
test.vm.network "private_network", ip: "192.168.56.101"
|
||||
test.vm.hostname = "dev0"
|
||||
end
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.cpus = 4
|
||||
vb.memory = "8192"
|
||||
end
|
||||
|
||||
config.vm.provision "file", source: "~/.ssh/id_ed25519.pub", destination: "/tmp/id_ed25519.pub"
|
||||
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
mkdir /root/.ssh
|
||||
cat /tmp/id_ed25519.pub >> /root/.ssh/authorized_keys
|
||||
SHELL
|
||||
end
|
@ -1,3 +1,6 @@
|
||||
ansible_user: root
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
|
||||
|
||||
disk: "sda"
|
||||
dns_server: "8.8.8.8"
|
||||
network_interface: "eno1"
|
||||
|
5
metal/inventories/dev.yml
Normal file
5
metal/inventories/dev.yml
Normal file
@ -0,0 +1,5 @@
|
||||
metal:
|
||||
children:
|
||||
masters:
|
||||
hosts:
|
||||
dev0: {ansible_host: 192.168.56.101}
|
@ -8,6 +8,3 @@ metal:
|
||||
workers:
|
||||
hosts:
|
||||
metal3: {ansible_host: 192.168.1.113, mac: '00:23:24:d1:f5:69'}
|
||||
vars:
|
||||
ansible_user: root
|
||||
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
|
Loading…
Reference in New Issue
Block a user