refacter: renamed facts to libs

This commit is contained in:
2024-02-17 23:03:54 +11:00
parent e10bed689c
commit 1030ba460e
16 changed files with 0 additions and 0 deletions
@@ -0,0 +1,16 @@
# frozen_string_literal: true
# check if the mariadb server exists
# check if the mariadb_datapath fact exists, else set /var/lib/mysql as the datapath
# check if the galera grastate.dat file exists, identifying if galera is boostrapped
require 'facter'
if system('systemctl is-active --quiet mariadb')
Facter.add('mariadb_galera_active') do
setcode do
mariadb_datapath = Facter.value(:mariadb_datapath) || '/var/lib/mysql'
File.exist?("#{mariadb_datapath}/grastate.dat")
end
end
end