|
2 năm trước cách đây | |
---|---|---|
.. | ||
provisioning | 2 năm trước cách đây | |
README.md | 2 năm trước cách đây | |
Vagrantfile | 2 năm trước cách đây |
sudo kvm-ok
sudo apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager
sudo apt install virtualbox
Or install Virtualbox from https://www.virtualbox.org/wiki/Downloads
sudo apt install ansible
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
sudo apt update && sudo apt install vagrant
vagrant plugin install vagrant-hostmanager
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.crypto
ansible-galaxy collection install community.general
ansible-galaxy collection install community.mysql
vagrant up
In case of "'/var/run/libvirt/libvirt-sock': Permission denied", try to login/logout or restart the machine
Once all VMs are up (see 'Deploy'), you can lauch Ansible without Vagrant. Examples:
ansible -v -i '192.168.56.41,' --key-file .vagrant/machines/lb/virtualbox/private_key -u vagrant -b -m setup all
ansible-playbook -v -i provisioning/ansible/hosts -u vagrant -b provisioning/ansible/playbook.yml
In your /etc/hosts
file, add a line to match the dev nextcloud domain (defined in your Vagrantfile), eg "nextcloud.test", to the choosen IP, eg "192.168.56.51".
Open a browser with "https://nextcloud.test"
Done with:
OK
TODO: add a switch to choose mod_php or php-FPM for Apache
HOSTS = [
{ :hostname => "db1", :ip => NETWORK+"11", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_servers" },
{ :hostname => "web.test", :ip => NETWORK+"41", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "web_servers", :ipdb => NETWORK+"20", :redis_vip => NETWORK+"40", :priority => 101 },
{ :hostname => "lb.test", :ip => NETWORK+"51", :ram => 1024, :cpu => 1, :box => "ubuntu/focal64", :group => "lbal_servers", :state => "MASTER", :priority => 101 },
]
OK
TODO: install KeepAlived in DB nodes
HOSTS = [
{ :hostname => "db1", :ip => NETWORK+"11", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_servers" },
{ :hostname => "db2", :ip => NETWORK+"12", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_servers" },
{ :hostname => "db3", :ip => NETWORK+"13", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_servers" },
{ :hostname => "web.test", :ip => NETWORK+"41", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "web_servers", :ipdb => NETWORK+"20", :redis_vip => NETWORK+"40", :priority => 101 },
{ :hostname => "lb.test", :ip => NETWORK+"51", :ram => 1024, :cpu => 1, :box => "ubuntu/focal64", :group => "lbal_servers", :state => "MASTER", :priority => 101 },
]
OK
HOSTS = [
{ :hostname => "db1", :ip => NETWORK+"11", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_servers", },
{ :hostname => "db2", :ip => NETWORK+"12", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_servers", },
{ :hostname => "db3", :ip => NETWORK+"13", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_servers", },
{ :hostname => "lbsql1", :ip => NETWORK+"19", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_lbal_servers", :state => "MASTER", :priority => 101, :vip => NETWORK+"20" },
{ :hostname => "lbsql2", :ip => NETWORK+"18", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_lbal_servers", :state => "BACKUP", :priority => 100, :vip => NETWORK+"20" },
{ :hostname => "web.test", :ip => NETWORK+"41", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "web_servers", :ipdb => NETWORK+"20", :redis_vip => NETWORK+"40", :priority => 101 },
{ :hostname => "lb.test", :ip => NETWORK+"51", :ram => 1024, :cpu => 1, :box => "ubuntu/focal64", :group => "lbal_servers", :state => "MASTER", :priority => 101 },
]
TODO
Done with:
HOSTS = [
{ :hostname => "db1", :ip => NETWORK+"11", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "db_servers", },
{ :hostname => "gl1", :ip => NETWORK+"31", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "gluster_servers" },
{ :hostname => "gl2", :ip => NETWORK+"32", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "gluster_servers" },
{ :hostname => "web.test", :ip => NETWORK+"41", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "web_servers", :ipdb => NETWORK+"20", :redis_vip => NETWORK+"40", :priority => 101 },
{ :hostname => "web2.test", :ip => NETWORK+"42", :ram => 1024, :cpu => 1, :box => "centos/7", :group => "web_servers", :ipdb => NETWORK+"20", :redis_vip => NETWORK+"40", :priority => 100 },
{ :hostname => "lb.test", :ip => NETWORK+"51", :ram => 1024, :cpu => 1, :box => "ubuntu/focal64", :group => "lbal_servers", :state => "MASTER", :priority => 101 },
{ :hostname => "lb2.test", :ip => NETWORK+"52", :ram => 512, :cpu => 1, :box => "ubuntu/focal64", :group => "lbal_servers", :state => "BACKUP", :priority => 100 },
]
TODO
HOSTS = [
]