-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create test scenarios with pgbackrest local and remote, using vagrant
- Loading branch information
Showing
34 changed files
with
909 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
pgbackrest.conf | ||
/test/.vagrant/ | ||
/test/.vagrant/ | ||
/packaging/.vagrant/ | ||
*.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
all: clean_before create_vm clean_after | ||
|
||
clean_before: | ||
vagrant destroy -f | ||
|
||
create_vm: | ||
vagrant up | ||
|
||
clean_after: | ||
vagrant destroy -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
vm_prefix = 'c_pgbr_c7' | ||
|
||
Vagrant.configure(2) do |config| | ||
config.vm.box = 'centos/7' | ||
|
||
# hardware and host settings | ||
config.vm.provider 'libvirt' do |lv| | ||
lv.cpus = 1 | ||
lv.memory = 512 | ||
lv.default_prefix = vm_prefix | ||
end | ||
|
||
# don't mind about insecure ssh key | ||
config.ssh.insert_key = false | ||
|
||
# don't share the default vagrant folder | ||
config.vm.synced_folder ".", "/vagrant", disabled: true | ||
|
||
# mount check_pgbackrest path for testing | ||
config.vm.synced_folder "..", "/check_pgbackrest", nfs_udp: false | ||
|
||
# set node name | ||
config.vm.define "build-srv" do |node| | ||
node.vm.hostname = 'build-rpm-check-pgbackrest' | ||
end | ||
|
||
# build check_pgbackrest rpm | ||
config.vm.provision 'check_pgbackrest', type: 'shell', path: 'provision/check_pgbackrest.bash' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
# build rpm and install check_pgbackrest | ||
yum install --nogpgcheck --quiet -y -e 0 epel-release | ||
yum install --nogpgcheck --quiet -y -e 0 rpmdevtools | ||
rpmdev-setuptree | ||
spectool -R -g /check_pgbackrest/check_pgbackrest.spec | ||
rpmbuild -ba /check_pgbackrest/check_pgbackrest.spec | ||
ls -lr ~/rpmbuild/RPMS/noarch/* | ||
yum install --nogpgcheck --quiet -y -e 0 ~/rpmbuild/RPMS/noarch/*.rpm | ||
cp -rf ~/rpmbuild/RPMS/noarch/*.rpm /check_pgbackrest/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
all: create_vm pgbackrest_local check_pgbackrest | ||
s1: clean create_vm pgbackrest_local | ||
s2: clean create_vm pgbackrest_remote | ||
|
||
create_vm: | ||
vagrant up | ||
|
||
pgbackrest_local: | ||
vagrant up --provision-with=pgbackrest_local | ||
vagrant up --provision-with=icinga2_local | ||
|
||
check_pgbackrest: | ||
vagrant up --provision-with=check_pgbackrest | ||
pgbackrest_remote: | ||
vagrant up --provision-with=pgbackrest_remote_primary | ||
vagrant up --provision-with=pgbackrest_remote_standby | ||
vagrant up --provision-with=icinga2_remote | ||
|
||
clean: | ||
vagrant destroy -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.