Vagrant: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Links) |
|||
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
= Links = | = Links = | ||
* https://app.vagrantup.com/bento/boxes/debian-11 | * https://app.vagrantup.com/bento/boxes/debian-11 | ||
= Beispiel = | |||
* Vagrantfile | |||
* HostOnly-Netzwerk 192.168.150.0/24 ist eingerichtet | |||
<pre> | |||
NETWORK_PREFIX = "192.168.150" | |||
Vagrant.configure("2") do |config| | |||
config.vm.define "ansible" do |ansible| | |||
ansible.vm.box = "bento/debian-11" | |||
ansible.vm.hostname = "ansible" | |||
ansible.vm.network :private_network, ip: "#{NETWORK_PREFIX}.100" | |||
end | |||
end | |||
</pre> | |||
<syntaxhighlight lang="bash"> | |||
sudo vagrant up | |||
vagrant ssh ansible | |||
vagrant global-status | |||
vagrant box { list | update } | |||
vagrant { up | halt reload | destroy } [<name>] | |||
vagrant snapshot list | |||
vagrant snapshot { push | pop } [<name>] | |||
</syntaxhighlight> | |||
= Installation = | = Installation = | ||
* Virtualbox muss installiert sein, 6.1 ist OK, 7.0 (noch) nicht | * Virtualbox muss installiert sein, 6.1 ist OK, 7.0 (noch) nicht | ||
* Nur Hostsystem benötigt Ansible, Clients nur Python und SSH | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg | wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg |
Aktuelle Version vom 30. Oktober 2022, 18:13 Uhr
Links[Bearbeiten]
Beispiel[Bearbeiten]
- Vagrantfile
- HostOnly-Netzwerk 192.168.150.0/24 ist eingerichtet
NETWORK_PREFIX = "192.168.150" Vagrant.configure("2") do |config| config.vm.define "ansible" do |ansible| ansible.vm.box = "bento/debian-11" ansible.vm.hostname = "ansible" ansible.vm.network :private_network, ip: "#{NETWORK_PREFIX}.100" end end
sudo vagrant up
vagrant ssh ansible
vagrant global-status
vagrant box { list | update }
vagrant { up | halt reload | destroy } [<name>]
vagrant snapshot list
vagrant snapshot { push | pop } [<name>]
Installation[Bearbeiten]
- Virtualbox muss installiert sein, 6.1 ist OK, 7.0 (noch) nicht
- Nur Hostsystem benötigt Ansible, Clients nur Python und SSH
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
apt update && sudo apt install vagrant
echo "* 0.0.0.0/0 ::/0" >/etc/vbox/networks.conf