Part of a component¶
Bouwblok Postgresql
## Introduction¶
Om PostgreSQL te installeren wordt gebruik gemaakt van Ansible.
For developing playbooks and roles, it's handy to use a local environment.
dit kan middels Virtuele machines op eigen laptop.
VirtualBox is a popular tool for running virtual machines (VMs).
Vagrant is a tool that provides a command-line interface (CLI) for interacting with VirtualBox and virtual machines (VMs).
```markdown¶
Requirements and Dependencies
For using Vagrant and VirtualBox, these programs must first be installed on a local laptop.
Om Ansible playbooks te runnen is Ansible nodig.
So:
- Ansible
- VirtualBox
- Vagrant
\- Git
## Uitvoering
To roll out a few VMs using Vagrant, a `Vagrantfile` is needed.
Logging into these VMs using SSH keys requires an SSH key pair.
Create this and then place it next to the Vagrantfile in the same directory:
create directory: `mkdir ~/Virtualmachines`
create a key pair:
```shell
ssh-keygen -t rsa -b <size> -f ~/Virtualmachines/id_rsa
maak Vagrantfile aan met onderstaande vullingĀ ( deze maakt 7 VM's aan, pas eventueel aan naar behoefte ):
```ruby
Vagrant.configure("2") do |config|
Base VM OS configuration.¶
v.memory = 2048
vcpus = 4
end
Define three VMs with static private IP addresses.¶
boxes = [
{ :name => "server1.example.com", :ip => "192.168.56.11" },
{ :name => "server2.example.com", :ip => "192.168.56.12" },
]
end
Allocate resources for each of the virtual machines.¶
chmod 700 /home/vagrant/.ssh
chmod -R 600 /home/vagrant/.ssh/config
, privileged: false
end
end
end
then run the following command: