- change /etc/hosts to meet proxmox requirements - add proxmox node role - add init, params, repo, install, clusterjoin classes
22 lines
462 B
Ruby
22 lines
462 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'facter'
|
|
|
|
Facter.add('pve_cluster_member') do
|
|
confine enc_role: 'roles::infra::proxmox::node'
|
|
setcode do
|
|
if Facter::Util::Resolution.which('pvesh')
|
|
cluster_status = `pvesh get /cluster/status --output-format json`
|
|
if cluster_status.empty?
|
|
false
|
|
else
|
|
require 'json'
|
|
status = JSON.parse(cluster_status)
|
|
!status.empty?
|
|
end
|
|
else
|
|
false
|
|
end
|
|
end
|
|
end
|