From f287f515d89c1cf99dfdb0358641941ec2a9b7aa Mon Sep 17 00:00:00 2001 From: Crag Wolfe Date: Wed, 3 Dec 2014 17:42:32 -0500 Subject: [PATCH 1/4] update pacemaker repo location --- Puppetfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Puppetfile b/Puppetfile index 2573c34cc..e1d0a037d 100644 --- a/Puppetfile +++ b/Puppetfile @@ -112,7 +112,7 @@ mod 'openstacklib', mod 'pacemaker', :commit => '0ed9ee8a29c0f27e86727d415b39d2715332df7d', - :git => 'https://github.com/radez/puppet-pacemaker.git' + :git => 'https://github.com/redhat-openstack/puppet-pacemaker.git' mod 'puppet', :commit => 'bd467cae15eba9ca44274034d2593b0eaf30518d', From 2eea50f93cbf053837e80a6deb51b4e88a64bced Mon Sep 17 00:00:00 2001 From: Crag Wolfe Date: Wed, 3 Dec 2014 17:45:09 -0500 Subject: [PATCH 2/4] update galera repo location --- Puppetfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Puppetfile b/Puppetfile index e1d0a037d..a3e122d09 100644 --- a/Puppetfile +++ b/Puppetfile @@ -28,7 +28,7 @@ mod 'firewall', mod 'galera', :commit => 'f7d4110886b643eb63dc5c347a0e8a06b09642e7', - :git => 'https://github.com/rohara/puppet-galera.git' + :git => 'https://github.com/redhat-openstack/puppet-galera.git' mod 'glance', :commit => '24d5c3425f6016e9eb6447a4041a7419eada3d31', From 641576b43864e4267b9aa201a4c0d9afa916478f Mon Sep 17 00:00:00 2001 From: Crag Wolfe Date: Wed, 3 Dec 2014 17:50:43 -0500 Subject: [PATCH 3/4] Automatic update This module update commit was generated by Bade. For more info please check https://github.com/paramite/bade This commit is setting modules to following state: galera - old commit: f7d4110886b643eb63dc5c347a0e8a06b09642e7 - new commit: 061799ec2dbf1527d2bc556cac7c4d85fea106cc --- Puppetfile | 2 +- galera/.fixtures.yml | 4 +- galera/.gitignore | 3 +- galera/Gemfile | 12 +-- galera/Rakefile | 27 +++++- galera/manifests/monitor.pp | 52 ++++++++--- galera/manifests/server.pp | 104 +++++++++++++++------ galera/spec/classes/galera_monitor_spec.rb | 84 +++++++++++++---- galera/spec/classes/galera_server_spec.rb | 53 +++++++++-- 9 files changed, 258 insertions(+), 83 deletions(-) diff --git a/Puppetfile b/Puppetfile index a3e122d09..9de660ea8 100644 --- a/Puppetfile +++ b/Puppetfile @@ -27,7 +27,7 @@ mod 'firewall', :git => 'https://github.com/puppetlabs/puppetlabs-firewall.git' mod 'galera', - :commit => 'f7d4110886b643eb63dc5c347a0e8a06b09642e7', + :commit => '061799ec2dbf1527d2bc556cac7c4d85fea106cc', :git => 'https://github.com/redhat-openstack/puppet-galera.git' mod 'glance', diff --git a/galera/.fixtures.yml b/galera/.fixtures.yml index 67f800fa3..989d203c2 100644 --- a/galera/.fixtures.yml +++ b/galera/.fixtures.yml @@ -1,7 +1,7 @@ fixtures: repositories: "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib" - "xinetd": "git://github.com/packstack/puppetlabs-xinetd" - "mysql": "git://github.com/packstack/puppetlabs-mysql" + "xinetd": "git://github.com/puppetlabs/puppetlabs-xinetd" + "mysql": "git://github.com/puppetlabs/puppetlabs-mysql" symlinks: "galera": "#{source_dir}" diff --git a/galera/.gitignore b/galera/.gitignore index 05823c3ae..bb757b24b 100644 --- a/galera/.gitignore +++ b/galera/.gitignore @@ -1,5 +1,6 @@ Gemfile.lock .vagrant -vendor +vendor/ +.bundle/ spec/fixtures/modules spec/fixtures/manifests/site.pp diff --git a/galera/Gemfile b/galera/Gemfile index fd321c0f3..95232d551 100644 --- a/galera/Gemfile +++ b/galera/Gemfile @@ -1,14 +1,12 @@ source 'https://rubygems.org' group :development, :test do - gem 'rake', :require => false - gem 'rspec-puppet', :require => false gem 'puppetlabs_spec_helper', :require => false - gem 'rspec-system', :require => false - gem 'rspec-system-puppet', :require => false - gem 'rspec-system-serverspec', :require => false - gem 'serverspec', :require => false - gem 'puppet-lint', :require => false + gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git' + gem 'puppet-lint', :git => 'https://github.com/rodjek/puppet-lint.git' + gem 'puppet-lint-param-docs', '1.1.0' + gem 'puppet-syntax' + gem 'rake', :require => false end if puppetversion = ENV['PUPPET_GEM_VERSION'] diff --git a/galera/Rakefile b/galera/Rakefile index bb60173e5..c3bb5ac20 100644 --- a/galera/Rakefile +++ b/galera/Rakefile @@ -1,2 +1,27 @@ require 'puppetlabs_spec_helper/rake_tasks' -require 'rspec-system/rake_task' +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' + +exclude_paths = [ + "pkg/**/*", + "vendor/**/*", + "spec/**/*", +] + +PuppetSyntax.exclude_paths = exclude_paths + +Rake::Task[:lint].clear +PuppetLint::RakeTask.new :lint do |config| + config.ignore_paths = exclude_paths + config.log_format = '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}' + config.disable_checks = [ "class_inherits_from_params_class", "80chars" ] + config.fail_on_warnings = true + config.relative = true +end + +desc "Run syntax, lint, and spec tests." +task :test => [ + :syntax, + :lint, + :spec, +] diff --git a/galera/manifests/monitor.pp b/galera/manifests/monitor.pp index d58c986fd..ec038697a 100644 --- a/galera/manifests/monitor.pp +++ b/galera/manifests/monitor.pp @@ -1,19 +1,43 @@ -# Class galera::monitor +# == Class: galera::monitor # -# Parameters: -# [*mysql_username*] - Username of the service account used for the clustercheck script. -# [*mysql_password*] - Password of the service account used for the clustercheck script. -# [*mysql_host*] - Hostname/IP address of mysql server to monitor. Defaults to 127.0.0.1. -# [*mysql_port] - Port used by mysql service. Defaults to 3306. -# [*monitor_port*] - Port used by galera monitor service. Defaults to 9200. -# [*monitor_script*] - Full path to monitor script. Defaults to '/usr/bin/clustercheck'. -# [*enabled*] - Enable/Disable galera monitor xinetd::service. Defaults to true. +# === Parameters: # -# Actions: +# [*mysql_username*] +# Username of the service account used for the clustercheck script. # -# Requires: +# [*mysql_password*] +# Password of the service account used for the clustercheck script. +# +# [*mysql_host*] +# Hostname/IP address of mysql server to monitor. +# Defaults to 127.0.0.1. +# +# [*mysql_port*] +# Port used by mysql service. +# Defaults to 3306. +# +# [*monitor_port*] +# Port used by galera monitor service. +# Defaults to 9200. +# +# [*monitor_script*] +# Full path to monitor script.\ +# Defaults to '/usr/bin/clustercheck'. +# +# [*enabled*] +# Enable/Disable galera monitor xinetd::service. +# Defaults to true. +# +# [*create_mysql_user*] +# Whether to create mysql user or not. +# Defaults to false. +# +# === Actions: +# +# === Requires: +# +# === Sample usage: # -# Sample usage: # class { 'galera::monitor': # mysql_username => 'mon_user', # mysql_password => 'mon_pass' @@ -38,7 +62,7 @@ file { '/etc/sysconfig/clustercheck': mode => '0640', - content => template("galera/clustercheck.erb"), + content => template('galera/clustercheck.erb'), owner => 'root', group => 'root', } @@ -58,7 +82,7 @@ if $create_mysql_user { mysql_user { "${mysql_username}@${mysql_host}": - ensure => present, + ensure => present, password_hash => mysql_password($mysql_password), require => [File['/root/.my.cnf'],Service['galera']], } diff --git a/galera/manifests/server.pp b/galera/manifests/server.pp index 4474e9431..ca20bbede 100644 --- a/galera/manifests/server.pp +++ b/galera/manifests/server.pp @@ -1,34 +1,77 @@ -# Class: galera::server +# == Class: galera::server # # manages the installation of the galera server. # manages the package, service, galera.cnf # -# Parameters: -# [*msyql_server_hash*] - Hash of mysql server parameters. -# [*bootstrap*] - Defaults to false, boolean to set cluster boostrap. -# [*package_name*] - The name of the galera package. -# [*package_ensure*] - Ensure state for package. Can be specified as version. -# [*service_name*] - The name of the galera service. -# [*service_enable*] - Defaults to true, boolean to set service enable. -# [*service_ensure*] - Defaults to running, needed to set root password. -# [*service_provider*] - What service provider to use. -# [*wsrep_bind_address*] - Address to bind galera service. -# [*wsrep_node_address*] - Address of local galera node. -# [*wsrep_provider*] - Full path to wsrep provider library or 'none'. -# [*wsrep_cluster_name*] - Logical cluster name. Should be the same for all nodes. -# [*wsrep_cluster_members*] - List of cluster members, IP addresses or hostnames. -# [*wsrep_sst_method*] - State snapshot transfer method. -# [*wsrep_sst_username*] - Username used by the wsrep_sst_auth authentication string. -# [*wsrep_sst_password*] - Password used by the wsrep_sst_auth authentication string. -# [*wsrep_ssl*] - Boolean to disable SSL even if certificate and key are configured. -# [*wsrep_ssl_key*] - Private key for the certificate above, unencrypted, in PEM format. -# [*wsrep_ssl_cert*] - Certificate file in PEM format. -# -# Actions: -# -# Requires: -# -# Sample Usage: +# === Parameters: +# +# [*mysql_server_hash*] +# Hash of mysql server parameters. +# +# [*bootstrap*] +# Defaults to false, boolean to set cluster boostrap. +# +# [*package_name*] +# The name of the galera package. +# +# [*package_ensure*] +# Ensure state for package. Can be specified as version. +# +# [*service_name*] +# The name of the galera service. +# +# [*service_enable*] +# Defaults to true, boolean to set service enable. +# +# [*service_ensure*] +# Defaults to running, needed to set root password. +# +# [*service_provider*] +# What service provider to use. +# +# [*wsrep_bind_address*] +# Address to bind galera service. +# +# [*wsrep_node_address*] +# Address of local galera node. +# +# [*wsrep_provider*] +# Full path to wsrep provider library or 'none'. +# +# [*wsrep_cluster_name*] +# Logical cluster name. be the same for all nodes. +# +# [*wsrep_cluster_members*] +# List of cluster members, IP addresses or hostnames. +# +# [*wsrep_sst_method*] +# State snapshot transfer method. +# +# [*wsrep_sst_username*] +# Username used by the wsrep_sst_auth authentication string. +# +# [*wsrep_sst_password*] +# Password used by the wsrep_sst_auth authentication string. +# +# [*wsrep_ssl*] +# Boolean to disable SSL even if certificate and key are configured. +# +# [*wsrep_ssl_key*] +# Private key for the certificate above, unencrypted, in PEM format. +# +# [*wsrep_ssl_cert*] +# Certificate file in PEM format. +# +# [*debug*] +# +# [*manage_service*] +# State of the service. +# +# === Actions: +# +# === Requires: +# +# === Sample Usage: # class { 'galera::server': # config_hash => { # bind_address => '0.0.0.0', @@ -85,10 +128,9 @@ if $manage_service { service { 'galera': - name => $service_name, - name => 'mysqld', # short-term hack to see if it works - enable => $service_enable, - ensure => $service_ensure, + ensure => $service_ensure, + name => $service_name, + enable => $service_enable, } } } diff --git a/galera/spec/classes/galera_monitor_spec.rb b/galera/spec/classes/galera_monitor_spec.rb index 47e5a1d36..3bdf322fb 100644 --- a/galera/spec/classes/galera_monitor_spec.rb +++ b/galera/spec/classes/galera_monitor_spec.rb @@ -1,29 +1,81 @@ require 'spec_helper' describe 'galera::monitor' do + let :facts do { :osfamily => 'RedHat' } end - let :pre_condition do - "include 'galera::server'" - end + let :params do { - :monitor_username => 'monitor_user', - :monitor_password => 'monitor_pass', - :monitor_hostname => '127.0.0.1', - :mysql_port => '3306', - :mysql_path => '/usr/bin/mysql', - :script_dir => '/usr/local/bin', - :enabled => true + :mysql_username => 'monitor_user', + :mysql_password => 'monitor_pass', + :mysql_host => '127.0.0.1', + :mysql_port => '3306', + :monitor_port => '9200', + :monitor_script => '/usr/bin/clustercheck', + :enabled => true, + :create_mysql_user => false, } end - it { should contain_service('xinetd').with( - :ensure => 'running', - :enable => 'true' - )} + context 'with galera-monitor xinetd service' do + context 'with enabled parameter to true' do + it 'Configures galera-monitor xinetd service' do + should contain_xinetd__service('galera-monitor').with( + :disable => 'no', + :port => '9200', + :server => '/usr/bin/clustercheck', + :flags => 'REUSE', + :per_source => 'UNLIMITED', + :service_type => 'UNLISTED', + :log_on_success => '', + :log_on_success_operator => '=', + :log_on_failure => 'HOST', + :log_on_failure_operator => '=', + ) + end + end + + context 'with enabled parameter to false' do + let(:params) { {:enabled => false } } + it 'Configures galera-monitor xinetd service' do + should contain_xinetd__service('galera-monitor').with( + :disable => 'yes', + :port => '9200', + :server => '/usr/bin/clustercheck', + :flags => 'REUSE', + :per_source => 'UNLIMITED', + :service_type => 'UNLISTED', + :log_on_success => '', + :log_on_success_operator => '=', + :log_on_failure => 'HOST', + :log_on_failure_operator => '=', + ) + end + end + end + + it 'Configures clustercheck configuration file' do + should contain_file('/etc/sysconfig/clustercheck').with( + :mode => '0640', + :owner => 'root', + :group => 'root', + ) + end - it { should contain_file('/usr/local/bin/galera_chk')} - it { should contain_database_user("monitor_user@127.0.0.1")} + context 'with create_mysql_user parameter' do + let(:params) { {:create_mysql_user => false} } + context 'create_mysql_user to false' do + it 'Should not contain mysql_user resource' do + should_not contain_mysql_user() + end + end + let(:params) { {:create_mysql_user => true} } + context 'create_mysql_user to true' do + it 'Should contain mysql_user resource' do + should contain_mysql_user("monitor_user@127.0.0.1") + end + end + end end diff --git a/galera/spec/classes/galera_server_spec.rb b/galera/spec/classes/galera_server_spec.rb index 6abff142b..41654f19a 100644 --- a/galera/spec/classes/galera_server_spec.rb +++ b/galera/spec/classes/galera_server_spec.rb @@ -1,27 +1,60 @@ require 'spec_helper' -describe 'galera::server' do + +describe 'galera::server', :type => :class do + let :facts do { :osfamily => 'RedHat' } end + let :params do { - :package_name => 'mariadb-galera-server', - :package_ensure => 'present', + :bootstrap => false, + :debug => false, :service_name => 'mariadb', - :service_enable => false, + :service_enable => true, :service_ensure => 'running', + :manage_service => false, :wsrep_bind_address => '0.0.0.0', + :wsrep_node_address => 'undef', :wsrep_provider => '/usr/lib64/galera/libgalera_smm.so', :wsrep_cluster_name => 'galera_cluster', - :wsrep_cluster_address => 'gcomm://', + :wsrep_cluster_members => ['127.0.0.1'], :wsrep_sst_method => 'rsync', - :wsrep_sst_username => 'wsrep_user', - :wsrep_sst_password => 'wsrep_pass', + :wsrep_sst_username => 'root', + :wsrep_sst_password => 'undef', + :wsrep_ssl => false, + :wsrep_ssl_key => 'undef', + :wsrep_ssl_cert => 'undef', } end - it { should contain_package('galera')} - it { should contain_file('/etc/my.cnf.d/galera.cnf')} - it { should contain_service('galera')} + it { should contain_class('mysql::server') } + context 'Configures /etc/my.cnf.d/galera.cnf' do + it { should contain_file('/etc/my.cnf.d/galera.cnf').with( + 'ensure' => 'present', + 'mode' => '0644', + 'owner' => 'root', + 'group' => 'root', + 'notify' => 'Service[mariadb]' + ) + } + end + + context 'with manage_service to false' do + it "Doesn't configure galera service" do + should_not contain_service('galera') + end + end + + context 'with manage_service to true' do + let(:params) { {:manage_service => true} } + it "Configures galera service" do + should contain_service('galera').with( + 'ensure' => 'running', + 'name' => 'mariadb', + 'enable' => 'true', + ) + end + end end From a827f0511c54b5d9772b9bc6f3eda80d9a850881 Mon Sep 17 00:00:00 2001 From: Crag Wolfe Date: Thu, 4 Dec 2014 05:44:17 -0500 Subject: [PATCH 4/4] Automatic update This module update commit was generated by Bade. For more info please check https://github.com/paramite/bade This commit is setting modules to following state: pacemaker - old commit: 0ed9ee8a29c0f27e86727d415b39d2715332df7d - new commit: 52acfd9c31e0801cedf970929851d4bece5cf79b --- Puppetfile | 2 +- pacemaker/agent_generator/agent_generator.rb | 137 +++++++++++++++ .../agent_generator/generate_manifests.sh | 17 ++ .../agent_generator/src_xml/fence_apc.xml | 142 ++++++++++++++++ .../src_xml/fence_apc_snmp.xml | 151 +++++++++++++++++ .../src_xml/fence_bladecenter.xml | 142 ++++++++++++++++ .../agent_generator/src_xml/fence_brocade.xml | 136 +++++++++++++++ .../src_xml/fence_cisco_mds.xml | 150 +++++++++++++++++ .../src_xml/fence_cisco_ucs.xml | 142 ++++++++++++++++ .../agent_generator/src_xml/fence_drac5.xml | 142 ++++++++++++++++ .../src_xml/fence_eaton_snmp.xml | 151 +++++++++++++++++ .../agent_generator/src_xml/fence_eps.xml | 123 ++++++++++++++ .../agent_generator/src_xml/fence_hpblade.xml | 142 ++++++++++++++++ .../src_xml/fence_ibmblade.xml | 151 +++++++++++++++++ .../agent_generator/src_xml/fence_idrac.xml | 94 +++++++++++ .../agent_generator/src_xml/fence_ifmib.xml | 152 +++++++++++++++++ .../agent_generator/src_xml/fence_ilo.xml | 132 +++++++++++++++ .../agent_generator/src_xml/fence_ilo2.xml | 132 +++++++++++++++ .../agent_generator/src_xml/fence_ilo3.xml | 94 +++++++++++ .../agent_generator/src_xml/fence_ilo4.xml | 94 +++++++++++ .../agent_generator/src_xml/fence_ilo_mp.xml | 127 ++++++++++++++ .../agent_generator/src_xml/fence_imm.xml | 94 +++++++++++ .../src_xml/fence_intelmodular.xml | 153 +++++++++++++++++ .../agent_generator/src_xml/fence_ipdu.xml | 151 +++++++++++++++++ .../agent_generator/src_xml/fence_ipmilan.xml | 94 +++++++++++ .../agent_generator/src_xml/fence_kdump.xml | 51 ++++++ .../agent_generator/src_xml/fence_rhevm.xml | 137 +++++++++++++++ .../agent_generator/src_xml/fence_rsb.xml | 126 ++++++++++++++ .../agent_generator/src_xml/fence_scsi.xml | 48 ++++++ .../agent_generator/src_xml/fence_virt.xml | 66 ++++++++ .../src_xml/fence_vmware_soap.xml | 139 +++++++++++++++ .../agent_generator/src_xml/fence_wti.xml | 137 +++++++++++++++ pacemaker/agent_generator/update_sources.sh | 26 +++ pacemaker/agent_generator/variables.sh | 35 ++++ pacemaker/manifests/constraint/base.pp | 24 ++- pacemaker/manifests/corosync.pp | 10 +- pacemaker/manifests/resource/route.pp | 2 +- pacemaker/manifests/stonith.pp | 10 +- pacemaker/manifests/stonith/fence_apc.pp | 148 ++++++++++++++++ pacemaker/manifests/stonith/fence_apc_snmp.pp | 158 ++++++++++++++++++ .../manifests/stonith/fence_bladecenter.pp | 148 ++++++++++++++++ pacemaker/manifests/stonith/fence_brocade.pp | 143 ++++++++++++++++ .../manifests/stonith/fence_cisco_mds.pp | 158 ++++++++++++++++++ .../manifests/stonith/fence_cisco_ucs.pp | 148 ++++++++++++++++ pacemaker/manifests/stonith/fence_drac5.pp | 148 ++++++++++++++++ .../manifests/stonith/fence_eaton_snmp.pp | 158 ++++++++++++++++++ pacemaker/manifests/stonith/fence_eps.pp | 128 ++++++++++++++ pacemaker/manifests/stonith/fence_hpblade.pp | 148 ++++++++++++++++ pacemaker/manifests/stonith/fence_ibmblade.pp | 158 ++++++++++++++++++ pacemaker/manifests/stonith/fence_idrac.pp | 103 ++++++++++++ pacemaker/manifests/stonith/fence_ifmib.pp | 158 ++++++++++++++++++ pacemaker/manifests/stonith/fence_ilo.pp | 138 +++++++++++++++ pacemaker/manifests/stonith/fence_ilo2.pp | 138 +++++++++++++++ pacemaker/manifests/stonith/fence_ilo3.pp | 103 ++++++++++++ pacemaker/manifests/stonith/fence_ilo4.pp | 103 ++++++++++++ pacemaker/manifests/stonith/fence_ilo_mp.pp | 133 +++++++++++++++ pacemaker/manifests/stonith/fence_imm.pp | 103 ++++++++++++ .../manifests/stonith/fence_intelmodular.pp | 158 ++++++++++++++++++ pacemaker/manifests/stonith/fence_ipdu.pp | 158 ++++++++++++++++++ pacemaker/manifests/stonith/fence_ipmilan.pp | 103 ++++++++++++ pacemaker/manifests/stonith/fence_kdump.pp | 68 ++++++++ pacemaker/manifests/stonith/fence_rhevm.pp | 143 ++++++++++++++++ pacemaker/manifests/stonith/fence_rsb.pp | 133 +++++++++++++++ pacemaker/manifests/stonith/fence_scsi.pp | 68 ++++++++ pacemaker/manifests/stonith/fence_virt.pp | 83 +++++++++ .../manifests/stonith/fence_vmware_soap.pp | 143 ++++++++++++++++ pacemaker/manifests/stonith/fence_wti.pp | 143 ++++++++++++++++ 67 files changed, 7662 insertions(+), 16 deletions(-) create mode 100755 pacemaker/agent_generator/agent_generator.rb create mode 100755 pacemaker/agent_generator/generate_manifests.sh create mode 100644 pacemaker/agent_generator/src_xml/fence_apc.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_apc_snmp.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_bladecenter.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_brocade.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_cisco_mds.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_cisco_ucs.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_drac5.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_eaton_snmp.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_eps.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_hpblade.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ibmblade.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_idrac.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ifmib.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ilo.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ilo2.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ilo3.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ilo4.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ilo_mp.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_imm.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_intelmodular.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ipdu.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_ipmilan.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_kdump.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_rhevm.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_rsb.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_scsi.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_virt.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_vmware_soap.xml create mode 100644 pacemaker/agent_generator/src_xml/fence_wti.xml create mode 100755 pacemaker/agent_generator/update_sources.sh create mode 100644 pacemaker/agent_generator/variables.sh create mode 100644 pacemaker/manifests/stonith/fence_apc.pp create mode 100644 pacemaker/manifests/stonith/fence_apc_snmp.pp create mode 100644 pacemaker/manifests/stonith/fence_bladecenter.pp create mode 100644 pacemaker/manifests/stonith/fence_brocade.pp create mode 100644 pacemaker/manifests/stonith/fence_cisco_mds.pp create mode 100644 pacemaker/manifests/stonith/fence_cisco_ucs.pp create mode 100644 pacemaker/manifests/stonith/fence_drac5.pp create mode 100644 pacemaker/manifests/stonith/fence_eaton_snmp.pp create mode 100644 pacemaker/manifests/stonith/fence_eps.pp create mode 100644 pacemaker/manifests/stonith/fence_hpblade.pp create mode 100644 pacemaker/manifests/stonith/fence_ibmblade.pp create mode 100644 pacemaker/manifests/stonith/fence_idrac.pp create mode 100644 pacemaker/manifests/stonith/fence_ifmib.pp create mode 100644 pacemaker/manifests/stonith/fence_ilo.pp create mode 100644 pacemaker/manifests/stonith/fence_ilo2.pp create mode 100644 pacemaker/manifests/stonith/fence_ilo3.pp create mode 100644 pacemaker/manifests/stonith/fence_ilo4.pp create mode 100644 pacemaker/manifests/stonith/fence_ilo_mp.pp create mode 100644 pacemaker/manifests/stonith/fence_imm.pp create mode 100644 pacemaker/manifests/stonith/fence_intelmodular.pp create mode 100644 pacemaker/manifests/stonith/fence_ipdu.pp create mode 100644 pacemaker/manifests/stonith/fence_ipmilan.pp create mode 100644 pacemaker/manifests/stonith/fence_kdump.pp create mode 100644 pacemaker/manifests/stonith/fence_rhevm.pp create mode 100644 pacemaker/manifests/stonith/fence_rsb.pp create mode 100644 pacemaker/manifests/stonith/fence_scsi.pp create mode 100644 pacemaker/manifests/stonith/fence_virt.pp create mode 100644 pacemaker/manifests/stonith/fence_vmware_soap.pp create mode 100644 pacemaker/manifests/stonith/fence_wti.pp diff --git a/Puppetfile b/Puppetfile index 9de660ea8..d51a4d76e 100644 --- a/Puppetfile +++ b/Puppetfile @@ -111,7 +111,7 @@ mod 'openstacklib', :git => 'https://github.com/stackforge/puppet-openstacklib.git' mod 'pacemaker', - :commit => '0ed9ee8a29c0f27e86727d415b39d2715332df7d', + :commit => '52acfd9c31e0801cedf970929851d4bece5cf79b', :git => 'https://github.com/redhat-openstack/puppet-pacemaker.git' mod 'puppet', diff --git a/pacemaker/agent_generator/agent_generator.rb b/pacemaker/agent_generator/agent_generator.rb new file mode 100755 index 000000000..96196263f --- /dev/null +++ b/pacemaker/agent_generator/agent_generator.rb @@ -0,0 +1,137 @@ +#!/usr/bin/ruby + +# Usage: +# +# * install a fence agent package e.g. fence-agents-ilo2 +# * fence_ilo2 -o metadata > ilo.xml +# * fence-generator.rb ilo.xml fence_ilo2 fence-agents-ilo2 +# [ XML metadata, name of the class, name of the package for dependency check ] + + +require 'rexml/document' + +class FencingMetadataParser + def initialize(filename, agentName, packageName) + @agentName = agentName + @packageName = packageName + file = File.new(filename) + @doc = REXML::Document.new file + end + + def getPackageName() + return @packageName + end + + def getAgentName() + return @agentName + end + + def getParameters() + ## result have to be array as order should be preserved + params = Array.new + + @doc.elements.each("resource-agent/parameters/parameter") { |p| + param = Hash.new + param["name"] = REXML::XPath.match(p, "string(./@name)")[0] + param["type"] = REXML::XPath.match(p, "string(./content/@type)")[0] + ## if 'default' is list then we can not enter it as parameter !! + ## this is problem only for 'cmd_prompt' + param["default"] = REXML::XPath.match(p, "string(./content/@default)")[0] + + ## remove parameters that are not usable during automatic execution + if not ["help", "version", "action"].include?(param["name"]) + params.push(param) + end + } + return params + end +end + +class ManifestGenerator + def initialize(parser) + @parser = parser + end + + def generate + puts <<-eos +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::#{@parser.getAgentName} ( +#{getManifestParameters} +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::#{@parser.getAgentName}": + command => "/usr/sbin/pcs stonith delete stonith-#{@parser.getAgentName}-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-#{@parser.getAgentName}-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + #{getVariableValues} + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "#{@parser.getPackageName}": ensure => installed, + } -> exec { + "Creating stonith::#{@parser.getAgentName}": + command => "/usr/sbin/pcs stonith create stonith-#{@parser.getAgentName}-${real_address} #{@parser.getAgentName} pcmk_host_list=\\"${pcmk_host_value_chunk}\\" #{getChunks} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-#{@parser.getAgentName}-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::#{@parser.getAgentName} ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-#{@parser.getAgentName}-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} +eos + end + + def getManifestParameters + text = "" + @parser.getParameters.each { |p| + text += "\t$#{p['name']} = undef,\n" + } + + text += "\n" + text += "\t$interval = \"60s\",\n" + text += "\t$ensure = present,\n" + text += "\t$pcmk_host_value = undef,\n" + + return text + end + + def getVariableValues + text = "" + @parser.getParameters.each { |p| + text += "\t$#{p['name']}_chunk = $#{p['name']} ? {\n" + text += "\t\tundef => \"\",\n" + text += "\t\tdefault => \"#{p['name']}=\\\"${#{p['name']}}\\\"\",\n" + text += "\t}\n" + } + + return text + end + + def getChunks + text = "" + @parser.getParameters.each { |p| + text += "${#{p['name']}_chunk} " + } + return text + end +end + +if ARGV.length != 3 then + puts "You have to enter three arguments: path to metadata, name of fence agent and fence agent package" + exit 1 +end + +metadata, agentName, packageName = ARGV +# e.g. parser = FencingMetadataParser.new("ilo.xml", "fence_ilo", "fence-agents-ilo2") +parser = FencingMetadataParser.new(metadata, agentName, packageName) +ManifestGenerator.new(parser).generate diff --git a/pacemaker/agent_generator/generate_manifests.sh b/pacemaker/agent_generator/generate_manifests.sh new file mode 100755 index 000000000..7db5afca7 --- /dev/null +++ b/pacemaker/agent_generator/generate_manifests.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# This scripts generates fence agent manifests from their XML +# descriptions + +set -exuo pipefail + +generator_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +source "$generator_dir/variables.sh" + +for cmd_pkg in "${cmd_pkg_map[@]}"; do + cmd=${cmd_pkg%%:*} + pkg=${cmd_pkg#*:} + + "$generator_dir/agent_generator.rb" "$generator_dir/src_xml/$cmd.xml" $cmd $pkg > "$generator_dir/../manifests/stonith/$cmd.pp" +done diff --git a/pacemaker/agent_generator/src_xml/fence_apc.xml b/pacemaker/agent_generator/src_xml/fence_apc.xml new file mode 100644 index 000000000..74830c522 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_apc.xml @@ -0,0 +1,142 @@ + + +fence_apc is an I/O Fencing agent which can be used with the APC network power switch. It logs into device via telnet/ssh and reboots a specified outlet. Lengthy telnet/ssh connections should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions. +http://www.apc.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Force Python regex for command prompt + + + + + SSH connection + + + + + Physical plug number, name of virtual machine or UUID + + + + + Physical switch number on device + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Identity file for ssh + + + + + SSH options to use + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_apc_snmp.xml b/pacemaker/agent_generator/src_xml/fence_apc_snmp.xml new file mode 100644 index 000000000..87f21d306 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_apc_snmp.xml @@ -0,0 +1,151 @@ + + +fence_apc_snmp is an I/O Fencing agent which can be used with the APC network power switch. It logs into a device via SNMP and reboots a specified outlet. It supports SNMP v1 and v3 with all combinations of authenticity/privacy settings. +http://www.apc.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Physical plug number, name of virtual machine or UUID + + + + + Specifies SNMP version to use (1,2c,3) + + + + + Set the community string + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Set authentication protocol (MD5|SHA) + + + + + Set security level (noAuthNoPriv|authNoPriv|authPriv) + + + + + Set privacy protocol (DES|AES) + + + + + Set privacy protocol password + + + + + Script to run to retrieve privacy password + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_bladecenter.xml b/pacemaker/agent_generator/src_xml/fence_bladecenter.xml new file mode 100644 index 000000000..b1b94951a --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_bladecenter.xml @@ -0,0 +1,142 @@ + + +fence_bladecenter is an I/O Fencing agent which can be used with IBM Bladecenters with recent enough firmware that includes telnet support. It logs into a Brocade chasis via telnet or ssh and uses the command line interface to power on and off blades. +http://www.ibm.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Force Python regex for command prompt + + + + + SSH connection + + + + + Physical plug number, name of virtual machine or UUID + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Identity file for ssh + + + + + SSH options to use + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Missing port returns OFF instead of failure + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_brocade.xml b/pacemaker/agent_generator/src_xml/fence_brocade.xml new file mode 100644 index 000000000..140dda5f4 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_brocade.xml @@ -0,0 +1,136 @@ + + +fence_brocade is an I/O Fencing agent which can be used with Brocade FC switches. It logs into a Brocade switch via telnet and disables a specified port. Disabling the port which a machine is connected to effectively fences that machine. Lengthy telnet connections to the switch should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions. After a fence operation has taken place the fenced machine can no longer connect to the Brocade FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Brocade FC switch needs to be enabled. This can be done by running fence_brocade and specifying the enable action +http://www.brocade.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Force Python regex for command prompt + + + + + SSH connection + + + + + Physical plug number, name of virtual machine or UUID + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Identity file for ssh + + + + + SSH options to use + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_cisco_mds.xml b/pacemaker/agent_generator/src_xml/fence_cisco_mds.xml new file mode 100644 index 000000000..d444b604a --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_cisco_mds.xml @@ -0,0 +1,150 @@ + + +fence_cisco_mds is an I/O Fencing agent which can be used with any Cisco MDS 9000 series with SNMP enabled device. +http://www.cisco.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Physical plug number, name of virtual machine or UUID + + + + + Specifies SNMP version to use (1,2c,3) + + + + + Set the community string + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Set authentication protocol (MD5|SHA) + + + + + Set security level (noAuthNoPriv|authNoPriv|authPriv) + + + + + Set privacy protocol (DES|AES) + + + + + Set privacy protocol password + + + + + Script to run to retrieve privacy password + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_cisco_ucs.xml b/pacemaker/agent_generator/src_xml/fence_cisco_ucs.xml new file mode 100644 index 000000000..bbaacc8a0 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_cisco_ucs.xml @@ -0,0 +1,142 @@ + + +fence_cisco_ucs is an I/O Fencing agent which can be used with Cisco UCS to fence machines. +http://www.cisco.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + SSL connection + + + + + Disable TLS negotiation + + + + + Physical plug number, name of virtual machine or UUID + + + + + Additional path needed to access suborganization + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + SSL connection with verifying fence device's certificate + + + + + SSL connection without verifying fence device's certificate + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_drac5.xml b/pacemaker/agent_generator/src_xml/fence_drac5.xml new file mode 100644 index 000000000..35e00e0c0 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_drac5.xml @@ -0,0 +1,142 @@ + + +fence_drac5 is an I/O Fencing agent which can be used with the Dell Remote Access Card v5 or CMC (DRAC). This device provides remote access to controlling power to a server. It logs into the DRAC through the telnet/ssh interface of the card. By default, the telnet interface is not enabled. +http://www.dell.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Force Python regex for command prompt + + + + + SSH connection + + + + + Force DRAC version to use + + + + + Physical plug number, name of virtual machine or UUID + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Identity file for ssh + + + + + SSH options to use + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_eaton_snmp.xml b/pacemaker/agent_generator/src_xml/fence_eaton_snmp.xml new file mode 100644 index 000000000..a70525767 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_eaton_snmp.xml @@ -0,0 +1,151 @@ + + +fence_eaton_snmp is an I/O Fencing agent which can be used with the Eaton network power switch. It logs into a device via SNMP and reboots a specified outlet. It supports SNMP v1 and v3 with all combinations of authenticity/privacy settings. +http://powerquality.eaton.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Physical plug number, name of virtual machine or UUID + + + + + Specifies SNMP version to use (1,2c,3) + + + + + Set the community string + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Set authentication protocol (MD5|SHA) + + + + + Set security level (noAuthNoPriv|authNoPriv|authPriv) + + + + + Set privacy protocol (DES|AES) + + + + + Set privacy protocol password + + + + + Script to run to retrieve privacy password + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_eps.xml b/pacemaker/agent_generator/src_xml/fence_eps.xml new file mode 100644 index 000000000..f7a9c8984 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_eps.xml @@ -0,0 +1,123 @@ + + +fence_eps is an I/O Fencing agent which can be used with the ePowerSwitch 8M+ power switch to fence connected machines. Fence agent works ONLY on 8M+ device, because this is only one, which has support for hidden page feature. +.TP +Agent basically works by connecting to hidden page and pass appropriate arguments to GET request. This means, that hidden page feature must be enabled and properly configured. +http://www.epowerswitch.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Physical plug number, name of virtual machine or UUID + + + + + Name of hidden page + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_hpblade.xml b/pacemaker/agent_generator/src_xml/fence_hpblade.xml new file mode 100644 index 000000000..5e20fba3b --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_hpblade.xml @@ -0,0 +1,142 @@ + + +fence_hpblade is an I/O Fencing agent which can be used with HP BladeSystem. It logs into an enclosure via telnet or ssh and uses the command line interface to power on and off blades. +http://www.hp.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Force Python regex for command prompt + + + + + SSH connection + + + + + Physical plug number, name of virtual machine or UUID + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Identity file for ssh + + + + + SSH options to use + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Missing port returns OFF instead of failure + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ibmblade.xml b/pacemaker/agent_generator/src_xml/fence_ibmblade.xml new file mode 100644 index 000000000..d711a0eeb --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ibmblade.xml @@ -0,0 +1,151 @@ + + +fence_ibmblade is an I/O Fencing agent which can be used with IBM BladeCenter chassis. It issues SNMP Set request to BladeCenter chassis, rebooting, powering up or down the specified Blade Server. +http://www.ibm.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Physical plug number, name of virtual machine or UUID + + + + + Specifies SNMP version to use (1,2c,3) + + + + + Set the community string + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Set authentication protocol (MD5|SHA) + + + + + Set security level (noAuthNoPriv|authNoPriv|authPriv) + + + + + Set privacy protocol (DES|AES) + + + + + Set privacy protocol password + + + + + Script to run to retrieve privacy password + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_idrac.xml b/pacemaker/agent_generator/src_xml/fence_idrac.xml new file mode 100644 index 000000000..4faead68b --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_idrac.xml @@ -0,0 +1,94 @@ + + + + + + + +fence_ipmilan is an I/O Fencing agent which can be used with machines controlled by IPMI. This agent calls support software using ipmitool (http://ipmitool.sf.net/). + +To use fence_ipmilan with HP iLO 3 or HP iLO 4 you have to enable lanplus option (lanplus / -P) and increase wait after operation to 4 seconds (power_wait=4 / -T 4) +http://www.intel.com + + + + + IPMI Lan Auth type (md5, password, or none) + + + + + IPMI Lan IP to talk to + + + + + Password (if required) to control power on IPMI device + + + + + Script to retrieve password (if required) + + + + + Use Lanplus to improve security of connection + + + + + Username/Login (if required) to control power on IPMI device + + + + + Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata + + + + + Timeout (sec) for IPMI operation + + + + + Ciphersuite to use (same as ipmitool -C parameter) + + + + + Method to fence (onoff or cycle) + + + + + Wait X seconds after on/off operation + + + + + Wait X seconds before fencing is started + + + + + Privilege level on IPMI device + + + + + Verbose mode + + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ifmib.xml b/pacemaker/agent_generator/src_xml/fence_ifmib.xml new file mode 100644 index 000000000..f4da8ba4a --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ifmib.xml @@ -0,0 +1,152 @@ + + +fence_ifmib is an I/O Fencing agent which can be used with any SNMP IF-MIB capable device. +.P +It was written with managed ethernet switches in mind, in order to fence iSCSI SAN connections. However, there are many devices that support the IF-MIB interface. The agent uses IF-MIB::ifAdminStatus to control the state of an interface. +http://www.ietf.org/wg/concluded/ifmib.html + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Physical plug number, name of virtual machine or UUID + + + + + Specifies SNMP version to use (1,2c,3) + + + + + Set the community string + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Set authentication protocol (MD5|SHA) + + + + + Set security level (noAuthNoPriv|authNoPriv|authPriv) + + + + + Set privacy protocol (DES|AES) + + + + + Set privacy protocol password + + + + + Script to run to retrieve privacy password + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ilo.xml b/pacemaker/agent_generator/src_xml/fence_ilo.xml new file mode 100644 index 000000000..ac72e393f --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ilo.xml @@ -0,0 +1,132 @@ + + + +fence_ilo is an I/O Fencing agent used for HP servers with the Integrated Light Out (iLO) PCI card.The agent opens an SSL connection to the iLO card. Once the SSL connection is established, the agent is able to communicate with the iLO card through an XML stream. +http://www.hp.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + SSL connection + + + + + Disable TLS negotiation + + + + + Force ribcl version to use + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + SSL connection with verifying fence device's certificate + + + + + SSL connection without verifying fence device's certificate + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ilo2.xml b/pacemaker/agent_generator/src_xml/fence_ilo2.xml new file mode 100644 index 000000000..fbeee8092 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ilo2.xml @@ -0,0 +1,132 @@ + + + +fence_ilo is an I/O Fencing agent used for HP servers with the Integrated Light Out (iLO) PCI card.The agent opens an SSL connection to the iLO card. Once the SSL connection is established, the agent is able to communicate with the iLO card through an XML stream. +http://www.hp.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + SSL connection + + + + + Disable TLS negotiation + + + + + Force ribcl version to use + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + SSL connection with verifying fence device's certificate + + + + + SSL connection without verifying fence device's certificate + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ilo3.xml b/pacemaker/agent_generator/src_xml/fence_ilo3.xml new file mode 100644 index 000000000..89ad7d983 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ilo3.xml @@ -0,0 +1,94 @@ + + + + + + + +fence_ipmilan is an I/O Fencing agent which can be used with machines controlled by IPMI. This agent calls support software using ipmitool (http://ipmitool.sf.net/). + +To use fence_ipmilan with HP iLO 3 or HP iLO 4 you have to enable lanplus option (lanplus / -P) and increase wait after operation to 4 seconds (power_wait=4 / -T 4) +http://www.intel.com + + + + + IPMI Lan Auth type (md5, password, or none) + + + + + IPMI Lan IP to talk to + + + + + Password (if required) to control power on IPMI device + + + + + Script to retrieve password (if required) + + + + + Use Lanplus to improve security of connection + + + + + Username/Login (if required) to control power on IPMI device + + + + + Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata + + + + + Timeout (sec) for IPMI operation + + + + + Ciphersuite to use (same as ipmitool -C parameter) + + + + + Method to fence (onoff or cycle) + + + + + Wait X seconds after on/off operation + + + + + Wait X seconds before fencing is started + + + + + Privilege level on IPMI device + + + + + Verbose mode + + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ilo4.xml b/pacemaker/agent_generator/src_xml/fence_ilo4.xml new file mode 100644 index 000000000..ec767ce49 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ilo4.xml @@ -0,0 +1,94 @@ + + + + + + + +fence_ipmilan is an I/O Fencing agent which can be used with machines controlled by IPMI. This agent calls support software using ipmitool (http://ipmitool.sf.net/). + +To use fence_ipmilan with HP iLO 3 or HP iLO 4 you have to enable lanplus option (lanplus / -P) and increase wait after operation to 4 seconds (power_wait=4 / -T 4) +http://www.intel.com + + + + + IPMI Lan Auth type (md5, password, or none) + + + + + IPMI Lan IP to talk to + + + + + Password (if required) to control power on IPMI device + + + + + Script to retrieve password (if required) + + + + + Use Lanplus to improve security of connection + + + + + Username/Login (if required) to control power on IPMI device + + + + + Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata + + + + + Timeout (sec) for IPMI operation + + + + + Ciphersuite to use (same as ipmitool -C parameter) + + + + + Method to fence (onoff or cycle) + + + + + Wait X seconds after on/off operation + + + + + Wait X seconds before fencing is started + + + + + Privilege level on IPMI device + + + + + Verbose mode + + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ilo_mp.xml b/pacemaker/agent_generator/src_xml/fence_ilo_mp.xml new file mode 100644 index 000000000..121db8e16 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ilo_mp.xml @@ -0,0 +1,127 @@ + + + +http://www.hp.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + SSH connection + + + + + Force Python regex for command prompt + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Identity file for ssh + + + + + SSH options to use + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_imm.xml b/pacemaker/agent_generator/src_xml/fence_imm.xml new file mode 100644 index 000000000..6795729b1 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_imm.xml @@ -0,0 +1,94 @@ + + + + + + + +fence_ipmilan is an I/O Fencing agent which can be used with machines controlled by IPMI. This agent calls support software using ipmitool (http://ipmitool.sf.net/). + +To use fence_ipmilan with HP iLO 3 or HP iLO 4 you have to enable lanplus option (lanplus / -P) and increase wait after operation to 4 seconds (power_wait=4 / -T 4) +http://www.intel.com + + + + + IPMI Lan Auth type (md5, password, or none) + + + + + IPMI Lan IP to talk to + + + + + Password (if required) to control power on IPMI device + + + + + Script to retrieve password (if required) + + + + + Use Lanplus to improve security of connection + + + + + Username/Login (if required) to control power on IPMI device + + + + + Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata + + + + + Timeout (sec) for IPMI operation + + + + + Ciphersuite to use (same as ipmitool -C parameter) + + + + + Method to fence (onoff or cycle) + + + + + Wait X seconds after on/off operation + + + + + Wait X seconds before fencing is started + + + + + Privilege level on IPMI device + + + + + Verbose mode + + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_intelmodular.xml b/pacemaker/agent_generator/src_xml/fence_intelmodular.xml new file mode 100644 index 000000000..4dd74635d --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_intelmodular.xml @@ -0,0 +1,153 @@ + + +fence_intelmodular is an I/O Fencing agent which can be used with Intel Modular device (tested on Intel MFSYS25, should work with MFSYS35 as well). +.P +Note: Since firmware update version 2.7, SNMP v2 write support is removed, and replaced by SNMP v3 support. So agent now has default SNMP version 3. If you are using older firmware, please supply -d for command line and snmp_version option for your cluster.conf. +http://www.intel.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Physical plug number, name of virtual machine or UUID + + + + + Specifies SNMP version to use (1,2c,3) + + + + + Set the community string + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Set authentication protocol (MD5|SHA) + + + + + Set security level (noAuthNoPriv|authNoPriv|authPriv) + + + + + Set privacy protocol (DES|AES) + + + + + Set privacy protocol password + + + + + Script to run to retrieve privacy password + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ipdu.xml b/pacemaker/agent_generator/src_xml/fence_ipdu.xml new file mode 100644 index 000000000..f46e08b7e --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ipdu.xml @@ -0,0 +1,151 @@ + + +fence_ipdu is an I/O Fencing agent which can be used with the IBM iPDU network power switch. It logs into a device via SNMP and reboots a specified outlet. It supports SNMP v3 with all combinations of authenticity/privacy settings. +http://www.ibm.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Physical plug number, name of virtual machine or UUID + + + + + Specifies SNMP version to use (1,2c,3) + + + + + Set the community string + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Set authentication protocol (MD5|SHA) + + + + + Set security level (noAuthNoPriv|authNoPriv|authPriv) + + + + + Set privacy protocol (DES|AES) + + + + + Set privacy protocol password + + + + + Script to run to retrieve privacy password + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_ipmilan.xml b/pacemaker/agent_generator/src_xml/fence_ipmilan.xml new file mode 100644 index 000000000..5ad833524 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_ipmilan.xml @@ -0,0 +1,94 @@ + + + + + + + +fence_ipmilan is an I/O Fencing agent which can be used with machines controlled by IPMI. This agent calls support software using ipmitool (http://ipmitool.sf.net/). + +To use fence_ipmilan with HP iLO 3 or HP iLO 4 you have to enable lanplus option (lanplus / -P) and increase wait after operation to 4 seconds (power_wait=4 / -T 4) +http://www.intel.com + + + + + IPMI Lan Auth type (md5, password, or none) + + + + + IPMI Lan IP to talk to + + + + + Password (if required) to control power on IPMI device + + + + + Script to retrieve password (if required) + + + + + Use Lanplus to improve security of connection + + + + + Username/Login (if required) to control power on IPMI device + + + + + Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata + + + + + Timeout (sec) for IPMI operation + + + + + Ciphersuite to use (same as ipmitool -C parameter) + + + + + Method to fence (onoff or cycle) + + + + + Wait X seconds after on/off operation + + + + + Wait X seconds before fencing is started + + + + + Privilege level on IPMI device + + + + + Verbose mode + + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_kdump.xml b/pacemaker/agent_generator/src_xml/fence_kdump.xml new file mode 100644 index 000000000..c985cacfe --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_kdump.xml @@ -0,0 +1,51 @@ + + +The fence_kdump agent is intended to be used with with kdump service. +http://www.kernel.org/pub/linux/utils/kernel/kexec/ + + + + + Name or IP address of node to be fenced + + + + + Port number + + + + + Network family + + + + + Fencing action + + + + + Timeout in seconds + + + + + Print verbose output + + + + + Print version + + + + + Print usage + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_rhevm.xml b/pacemaker/agent_generator/src_xml/fence_rhevm.xml new file mode 100644 index 000000000..fe6e39e9c --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_rhevm.xml @@ -0,0 +1,137 @@ + + +fence_rhevm is an I/O Fencing agent which can be used with RHEV-M REST API to fence virtual machines. +http://www.redhat.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + SSL connection + + + + + Disable TLS negotiation + + + + + Physical plug number, name of virtual machine or UUID + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + SSL connection with verifying fence device's certificate + + + + + SSL connection without verifying fence device's certificate + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_rsb.xml b/pacemaker/agent_generator/src_xml/fence_rsb.xml new file mode 100644 index 000000000..72166dbe4 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_rsb.xml @@ -0,0 +1,126 @@ + + +fence_rsb is an I/O Fencing agent which can be used with the Fujitsu-Siemens RSB management interface. It logs into device via telnet/ssh and reboots a specified outlet. Lengthy telnet/ssh connections should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions. +http://www.fujitsu.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + SSH connection + + + + + Force Python regex for command prompt + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Identity file for ssh + + + + + SSH options to use + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_scsi.xml b/pacemaker/agent_generator/src_xml/fence_scsi.xml new file mode 100644 index 000000000..9be7db1cf --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_scsi.xml @@ -0,0 +1,48 @@ + + +fence_scsi +http://www.t10.org + + + + + Use APTPL flag for registrations + + + + + List of devices to be used for fencing action + + + + + File to write error/debug messages + + + + + Wait X seconds before fencing is started + + + + + Key value to be used for fencing action + + + + + Fencing action + + + + + Name of node + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_virt.xml b/pacemaker/agent_generator/src_xml/fence_virt.xml new file mode 100644 index 000000000..c712e939d --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_virt.xml @@ -0,0 +1,66 @@ + + +fence_virt is an I/O Fencing agent which can be used withvirtual machines. + + + + + Specify (stdin) or increment (command line) debug level + + + + + Serial device (default=/dev/ttyS1) + + + + + Serial Parameters (default=115200,8N1) + + + + + VM Channel IP address (default=10.0.2.179) + + + + + Multicast or VMChannel IP port (default=1229) + + + + + Virtual Machine (domain name) to fence + + + + + Fencing action (null, off, on, [reboot], status, list, monitor, metadata) + + + + + Fencing timeout (in seconds; default=30) + + + + + Fencing delay (in seconds; default=0) + + + + + Virtual Machine (domain name) to fence (deprecated; use port) + + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_vmware_soap.xml b/pacemaker/agent_generator/src_xml/fence_vmware_soap.xml new file mode 100644 index 000000000..95a22dc1e --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_vmware_soap.xml @@ -0,0 +1,139 @@ + + +fence_vmware_soap is an I/O Fencing agent which can be used with the virtual machines managed by VMWare products that have SOAP API v4.1+. +.P +Name of virtual machine (-n / port) has to be used in inventory path format (e.g. /datacenter/vm/Discovered virtual machine/myMachine). In the cases when name of yours VM is unique you can use it instead. Alternatively you can always use UUID to access virtual machine. +http://www.vmware.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + SSL connection + + + + + Disable TLS negotiation + + + + + Physical plug number, name of virtual machine or UUID + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + SSL connection with verifying fence device's certificate + + + + + SSL connection without verifying fence device's certificate + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/src_xml/fence_wti.xml b/pacemaker/agent_generator/src_xml/fence_wti.xml new file mode 100644 index 000000000..e83d5a440 --- /dev/null +++ b/pacemaker/agent_generator/src_xml/fence_wti.xml @@ -0,0 +1,137 @@ + + +fence_wti is an I/O Fencing agent which can be used with the WTI Network Power Switch (NPS). It logs into an NPS via telnet or ssh and boots a specified plug. Lengthy telnet connections to the NPS should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions. +http://www.wti.com + + + + + IP Address or Hostname + + + + + Login Name + + + + + Login password or passphrase + + + + + Force Python regex for command prompt + + + + + SSH connection + + + + + Physical plug number, name of virtual machine or UUID + + + + + TCP/UDP port to use for connection with device + + + + + Forces agent to use IPv4 addresses only + + + + + Forces agent to use IPv6 addresses only + + + + + Script to retrieve password + + + + + Identity file for ssh + + + + + SSH options to use + + + + + Fencing Action + + + + + Verbose mode + + + + + Write debug information to given file + + + + + Display version information and exit + + + + + Display help and exit + + + + + Separator for CSV created by operation list + + + + + Test X seconds for status change after ON/OFF + + + + + Wait X seconds for cmd prompt after issuing command + + + + + Wait X seconds for cmd prompt after login + + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds before fencing is started + + + + + Count of attempts to retry power on + + + + + + + + + + + + diff --git a/pacemaker/agent_generator/update_sources.sh b/pacemaker/agent_generator/update_sources.sh new file mode 100755 index 000000000..4b8d0a8a2 --- /dev/null +++ b/pacemaker/agent_generator/update_sources.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# This script updates fence agent descriptions (XML files in src_xml +# directory). Running this will install and update fence agent +# packages to the latest version. + +set -exuo pipefail + +generator_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +source "$generator_dir/variables.sh" + +all_pkgs='' +for cmd_pkg in "${cmd_pkg_map[@]}"; do + pkg=${cmd_pkg#*:} + all_pkgs+="$pkg " +done + +sudo yum -y install $all_pkgs +sudo yum -y update $all_pkgs + +for cmd_pkg in "${cmd_pkg_map[@]}"; do + cmd=${cmd_pkg%%:*} + + $cmd -o metadata > "$generator_dir/src_xml/$cmd.xml" +done diff --git a/pacemaker/agent_generator/variables.sh b/pacemaker/agent_generator/variables.sh new file mode 100644 index 000000000..a6e38a029 --- /dev/null +++ b/pacemaker/agent_generator/variables.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +cmd_pkg_map=( + "fence_apc:fence-agents-apc" + "fence_apc_snmp:fence-agents-apc-snmp" + "fence_bladecenter:fence-agents-bladecenter" + "fence_brocade:fence-agents-brocade" + "fence_cisco_mds:fence-agents-cisco-mds" + "fence_cisco_ucs:fence-agents-cisco-ucs" + "fence_drac5:fence-agents-drac5" + "fence_eaton_snmp:fence-agents-eaton-snmp" + "fence_eps:fence-agents-eps" + "fence_hpblade:fence-agents-hpblade" + "fence_ibmblade:fence-agents-ibmblade" + "fence_idrac:fence-agents-ipmilan" + "fence_ifmib:fence-agents-ifmib" + "fence_ilo:fence-agents-ilo2" + "fence_ilo2:fence-agents-ilo2" + "fence_ilo3:fence-agents-ipmilan" + "fence_ilo4:fence-agents-ipmilan" + "fence_ilo_mp:fence-agents-ilo-mp" + "fence_imm:fence-agents-ipmilan" + "fence_intelmodular:fence-agents-intelmodular" + "fence_ipdu:fence-agents-ipdu" + "fence_ipmilan:fence-agents-ipmilan" + "fence_kdump:fence-agents-kdump" + "fence_rhevm:fence-agents-rhevm" + "fence_rsb:fence-agents-rsb" + "fence_scsi:fence-agents-scsi" + "fence_virt:fence-virt" + "fence_vmware_soap:fence-agents-vmware-soap" + "fence_wti:fence-agents-wti" + # not generating fence_xvm for now, it would overwrite the existing one + # "fence_xvm:fence-virt" +) diff --git a/pacemaker/manifests/constraint/base.pp b/pacemaker/manifests/constraint/base.pp index f93e28d21..8b95bf0e0 100644 --- a/pacemaker/manifests/constraint/base.pp +++ b/pacemaker/manifests/constraint/base.pp @@ -1,11 +1,13 @@ define pacemaker::constraint::base ($constraint_type, $first_resource, - $second_resource=undef, - $first_action=undef, - $second_action=undef, - $location=undef, - $score=undef, - $ensure=present) { + $second_resource = undef, + $first_action = undef, + $second_action = undef, + $location = undef, + $score = undef, + $ensure = present, + $tries = 1, + $try_sleep = 10,) { validate_re($constraint_type, ['colocation', 'order', 'location']) @@ -27,12 +29,16 @@ command => "/usr/sbin/pcs constraint location remove ${name}", onlyif => "/usr/sbin/pcs constraint location show --full | grep ${name}", require => Exec["wait-for-settle"], + tries => $tries, + try_sleep => $try_sleep, } } else { exec { "Removing ${constraint_type} constraint ${name}": command => "/usr/sbin/pcs constraint ${constraint_type} remove ${first_resource} ${second_resource}", onlyif => "/usr/sbin/pcs constraint ${constraint_type} show | grep ${first_resource} | grep ${second_resource}", require => Exec["wait-for-settle"], + tries => $tries, + try_sleep => $try_sleep, } } } else { @@ -43,6 +49,8 @@ command => "/usr/sbin/pcs constraint colocation add ${first_resource} ${second_resource} ${score}", unless => "/usr/sbin/pcs constraint colocation show | grep ${first_resource} | grep ${second_resource} > /dev/null 2>&1", require => [Exec["wait-for-settle"],Package["pcs"]], + tries => $tries, + try_sleep => $try_sleep, } } 'order': { @@ -50,6 +58,8 @@ command => "/usr/sbin/pcs constraint order ${first_action} ${first_resource} then ${second_action} ${second_resource}", unless => "/usr/sbin/pcs constraint order show | grep ${first_resource} | grep ${second_resource} > /dev/null 2>&1", require => [Exec["wait-for-settle"],Package["pcs"]], + tries => $tries, + try_sleep => $try_sleep, } } 'location': { @@ -58,6 +68,8 @@ command => "/usr/sbin/pcs constraint location add ${name} ${first_resource} ${location} ${score}", unless => "/usr/sbin/pcs constraint location show | grep ${first_resource} > /dev/null 2>&1", require => [Exec["wait-for-settle"],Package["pcs"]], + tries => $tries, + try_sleep => $try_sleep, } } } diff --git a/pacemaker/manifests/corosync.pp b/pacemaker/manifests/corosync.pp index ae4e0638f..b28866993 100644 --- a/pacemaker/manifests/corosync.pp +++ b/pacemaker/manifests/corosync.pp @@ -53,16 +53,16 @@ } -> exec {"Set password for hacluster user on $cluster_name": - command => "/bin/echo ${::pacemaker::params::hacluster_pwd} | /usr/bin/passwd --stdin hacluster", + command => "/bin/echo ${::pacemaker::hacluster_pwd} | /usr/bin/passwd --stdin hacluster", creates => "/etc/cluster/cluster.conf", require => Class["::pacemaker::install"], } -> exec {"auth-successful-across-all-nodes": - command => "/usr/sbin/pcs cluster auth $cluster_members -u hacluster -p ${::pacemaker::params::hacluster_pwd} --force", - timeout => 3600, - tries => 360, - try_sleep => 10, + command => "/usr/sbin/pcs cluster auth $cluster_members -u hacluster -p ${::pacemaker::hacluster_pwd} --force", + timeout => $settle_timeout, + tries => $settle_tries, + try_sleep => $settle_try_sleep, } -> Exec["wait-for-settle"] diff --git a/pacemaker/manifests/resource/route.pp b/pacemaker/manifests/resource/route.pp index 106924108..b62ae2a50 100644 --- a/pacemaker/manifests/resource/route.pp +++ b/pacemaker/manifests/resource/route.pp @@ -28,7 +28,7 @@ default => " gateway=$gateway" } - pcmk_resource { "route-${src}-${dest}-${gateway}-${group}": + pcmk_resource { "route-${name}-${group}": ensure => $ensure, resource_type => 'Route', resource_params => "${dest_option} ${src_option} ${nic_option} ${gw_option}", diff --git a/pacemaker/manifests/stonith.pp b/pacemaker/manifests/stonith.pp index 991872bde..16ea0dcbd 100644 --- a/pacemaker/manifests/stonith.pp +++ b/pacemaker/manifests/stonith.pp @@ -1,15 +1,19 @@ -class pacemaker::stonith ($disable=true) inherits pacemaker::corosync { +class pacemaker::stonith ($disable=true) { if $disable == true { exec {"Disable STONITH": command => "/usr/sbin/pcs property set stonith-enabled=false", unless => "/usr/sbin/pcs property show stonith-enabled | grep 'stonith-enabled: false'", - require => Exec["wait-for-settle"], + require => [ Exec["wait-for-settle"], + Class['::pacemaker::corosync'] + ], } } else { exec {"Enable STONITH": command => "/usr/sbin/pcs property set stonith-enabled=true", onlyif => "/usr/sbin/pcs property show stonith-enabled | grep 'stonith-enabled: false'", - require => Exec["wait-for-settle"], + require => [ Exec["wait-for-settle"], + Class['::pacemaker::corosync'] + ], } } } diff --git a/pacemaker/manifests/stonith/fence_apc.pp b/pacemaker/manifests/stonith/fence_apc.pp new file mode 100644 index 000000000..13f6b6663 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_apc.pp @@ -0,0 +1,148 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_apc ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $cmd_prompt = undef, + $secure = undef, + $port = undef, + $switch = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $identity_file = undef, + $ssh_options = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_apc": + command => "/usr/sbin/pcs stonith delete stonith-fence_apc-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_apc-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $cmd_prompt_chunk = $cmd_prompt ? { + undef => "", + default => "cmd_prompt=\"${cmd_prompt}\"", + } + $secure_chunk = $secure ? { + undef => "", + default => "secure=\"${secure}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $switch_chunk = $switch ? { + undef => "", + default => "switch=\"${switch}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $identity_file_chunk = $identity_file ? { + undef => "", + default => "identity_file=\"${identity_file}\"", + } + $ssh_options_chunk = $ssh_options ? { + undef => "", + default => "ssh_options=\"${ssh_options}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-apc": ensure => installed, + } -> exec { + "Creating stonith::fence_apc": + command => "/usr/sbin/pcs stonith create stonith-fence_apc-${real_address} fence_apc pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${switch_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_apc-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_apc ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_apc-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_apc_snmp.pp b/pacemaker/manifests/stonith/fence_apc_snmp.pp new file mode 100644 index 000000000..fd1a508b1 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_apc_snmp.pp @@ -0,0 +1,158 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_apc_snmp ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $port = undef, + $snmp_version = undef, + $community = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $snmp_auth_prot = undef, + $snmp_sec_level = undef, + $snmp_priv_prot = undef, + $snmp_priv_passwd = undef, + $snmp_priv_passwd_script = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_apc_snmp": + command => "/usr/sbin/pcs stonith delete stonith-fence_apc_snmp-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_apc_snmp-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $snmp_version_chunk = $snmp_version ? { + undef => "", + default => "snmp_version=\"${snmp_version}\"", + } + $community_chunk = $community ? { + undef => "", + default => "community=\"${community}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $snmp_auth_prot_chunk = $snmp_auth_prot ? { + undef => "", + default => "snmp_auth_prot=\"${snmp_auth_prot}\"", + } + $snmp_sec_level_chunk = $snmp_sec_level ? { + undef => "", + default => "snmp_sec_level=\"${snmp_sec_level}\"", + } + $snmp_priv_prot_chunk = $snmp_priv_prot ? { + undef => "", + default => "snmp_priv_prot=\"${snmp_priv_prot}\"", + } + $snmp_priv_passwd_chunk = $snmp_priv_passwd ? { + undef => "", + default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"", + } + $snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? { + undef => "", + default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-apc-snmp": ensure => installed, + } -> exec { + "Creating stonith::fence_apc_snmp": + command => "/usr/sbin/pcs stonith create stonith-fence_apc_snmp-${real_address} fence_apc_snmp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_apc_snmp-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_apc_snmp ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_apc_snmp-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_bladecenter.pp b/pacemaker/manifests/stonith/fence_bladecenter.pp new file mode 100644 index 000000000..175e25dfc --- /dev/null +++ b/pacemaker/manifests/stonith/fence_bladecenter.pp @@ -0,0 +1,148 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_bladecenter ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $cmd_prompt = undef, + $secure = undef, + $port = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $identity_file = undef, + $ssh_options = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $missing_as_off = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_bladecenter": + command => "/usr/sbin/pcs stonith delete stonith-fence_bladecenter-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_bladecenter-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $cmd_prompt_chunk = $cmd_prompt ? { + undef => "", + default => "cmd_prompt=\"${cmd_prompt}\"", + } + $secure_chunk = $secure ? { + undef => "", + default => "secure=\"${secure}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $identity_file_chunk = $identity_file ? { + undef => "", + default => "identity_file=\"${identity_file}\"", + } + $ssh_options_chunk = $ssh_options ? { + undef => "", + default => "ssh_options=\"${ssh_options}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $missing_as_off_chunk = $missing_as_off ? { + undef => "", + default => "missing_as_off=\"${missing_as_off}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-bladecenter": ensure => installed, + } -> exec { + "Creating stonith::fence_bladecenter": + command => "/usr/sbin/pcs stonith create stonith-fence_bladecenter-${real_address} fence_bladecenter pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${missing_as_off_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_bladecenter-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_bladecenter ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_bladecenter-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_brocade.pp b/pacemaker/manifests/stonith/fence_brocade.pp new file mode 100644 index 000000000..d06dc8712 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_brocade.pp @@ -0,0 +1,143 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_brocade ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $cmd_prompt = undef, + $secure = undef, + $port = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $identity_file = undef, + $ssh_options = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_brocade": + command => "/usr/sbin/pcs stonith delete stonith-fence_brocade-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_brocade-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $cmd_prompt_chunk = $cmd_prompt ? { + undef => "", + default => "cmd_prompt=\"${cmd_prompt}\"", + } + $secure_chunk = $secure ? { + undef => "", + default => "secure=\"${secure}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $identity_file_chunk = $identity_file ? { + undef => "", + default => "identity_file=\"${identity_file}\"", + } + $ssh_options_chunk = $ssh_options ? { + undef => "", + default => "ssh_options=\"${ssh_options}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-brocade": ensure => installed, + } -> exec { + "Creating stonith::fence_brocade": + command => "/usr/sbin/pcs stonith create stonith-fence_brocade-${real_address} fence_brocade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_brocade-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_brocade ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_brocade-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_cisco_mds.pp b/pacemaker/manifests/stonith/fence_cisco_mds.pp new file mode 100644 index 000000000..eab35940f --- /dev/null +++ b/pacemaker/manifests/stonith/fence_cisco_mds.pp @@ -0,0 +1,158 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_cisco_mds ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $port = undef, + $snmp_version = undef, + $community = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $snmp_auth_prot = undef, + $snmp_sec_level = undef, + $snmp_priv_prot = undef, + $snmp_priv_passwd = undef, + $snmp_priv_passwd_script = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_cisco_mds": + command => "/usr/sbin/pcs stonith delete stonith-fence_cisco_mds-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_cisco_mds-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $snmp_version_chunk = $snmp_version ? { + undef => "", + default => "snmp_version=\"${snmp_version}\"", + } + $community_chunk = $community ? { + undef => "", + default => "community=\"${community}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $snmp_auth_prot_chunk = $snmp_auth_prot ? { + undef => "", + default => "snmp_auth_prot=\"${snmp_auth_prot}\"", + } + $snmp_sec_level_chunk = $snmp_sec_level ? { + undef => "", + default => "snmp_sec_level=\"${snmp_sec_level}\"", + } + $snmp_priv_prot_chunk = $snmp_priv_prot ? { + undef => "", + default => "snmp_priv_prot=\"${snmp_priv_prot}\"", + } + $snmp_priv_passwd_chunk = $snmp_priv_passwd ? { + undef => "", + default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"", + } + $snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? { + undef => "", + default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-cisco-mds": ensure => installed, + } -> exec { + "Creating stonith::fence_cisco_mds": + command => "/usr/sbin/pcs stonith create stonith-fence_cisco_mds-${real_address} fence_cisco_mds pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_cisco_mds-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_cisco_mds ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_cisco_mds-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_cisco_ucs.pp b/pacemaker/manifests/stonith/fence_cisco_ucs.pp new file mode 100644 index 000000000..0acb7a49e --- /dev/null +++ b/pacemaker/manifests/stonith/fence_cisco_ucs.pp @@ -0,0 +1,148 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_cisco_ucs ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $ssl = undef, + $notls = undef, + $port = undef, + $suborg = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $ssl_secure = undef, + $ssl_insecure = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_cisco_ucs": + command => "/usr/sbin/pcs stonith delete stonith-fence_cisco_ucs-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_cisco_ucs-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $ssl_chunk = $ssl ? { + undef => "", + default => "ssl=\"${ssl}\"", + } + $notls_chunk = $notls ? { + undef => "", + default => "notls=\"${notls}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $suborg_chunk = $suborg ? { + undef => "", + default => "suborg=\"${suborg}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $ssl_secure_chunk = $ssl_secure ? { + undef => "", + default => "ssl_secure=\"${ssl_secure}\"", + } + $ssl_insecure_chunk = $ssl_insecure ? { + undef => "", + default => "ssl_insecure=\"${ssl_insecure}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-cisco-ucs": ensure => installed, + } -> exec { + "Creating stonith::fence_cisco_ucs": + command => "/usr/sbin/pcs stonith create stonith-fence_cisco_ucs-${real_address} fence_cisco_ucs pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${suborg_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_cisco_ucs-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_cisco_ucs ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_cisco_ucs-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_drac5.pp b/pacemaker/manifests/stonith/fence_drac5.pp new file mode 100644 index 000000000..6e3f54d63 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_drac5.pp @@ -0,0 +1,148 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_drac5 ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $cmd_prompt = undef, + $secure = undef, + $drac_version = undef, + $port = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $identity_file = undef, + $ssh_options = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_drac5": + command => "/usr/sbin/pcs stonith delete stonith-fence_drac5-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_drac5-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $cmd_prompt_chunk = $cmd_prompt ? { + undef => "", + default => "cmd_prompt=\"${cmd_prompt}\"", + } + $secure_chunk = $secure ? { + undef => "", + default => "secure=\"${secure}\"", + } + $drac_version_chunk = $drac_version ? { + undef => "", + default => "drac_version=\"${drac_version}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $identity_file_chunk = $identity_file ? { + undef => "", + default => "identity_file=\"${identity_file}\"", + } + $ssh_options_chunk = $ssh_options ? { + undef => "", + default => "ssh_options=\"${ssh_options}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-drac5": ensure => installed, + } -> exec { + "Creating stonith::fence_drac5": + command => "/usr/sbin/pcs stonith create stonith-fence_drac5-${real_address} fence_drac5 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${drac_version_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_drac5-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_drac5 ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_drac5-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_eaton_snmp.pp b/pacemaker/manifests/stonith/fence_eaton_snmp.pp new file mode 100644 index 000000000..826d2e357 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_eaton_snmp.pp @@ -0,0 +1,158 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_eaton_snmp ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $port = undef, + $snmp_version = undef, + $community = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $snmp_auth_prot = undef, + $snmp_sec_level = undef, + $snmp_priv_prot = undef, + $snmp_priv_passwd = undef, + $snmp_priv_passwd_script = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_eaton_snmp": + command => "/usr/sbin/pcs stonith delete stonith-fence_eaton_snmp-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_eaton_snmp-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $snmp_version_chunk = $snmp_version ? { + undef => "", + default => "snmp_version=\"${snmp_version}\"", + } + $community_chunk = $community ? { + undef => "", + default => "community=\"${community}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $snmp_auth_prot_chunk = $snmp_auth_prot ? { + undef => "", + default => "snmp_auth_prot=\"${snmp_auth_prot}\"", + } + $snmp_sec_level_chunk = $snmp_sec_level ? { + undef => "", + default => "snmp_sec_level=\"${snmp_sec_level}\"", + } + $snmp_priv_prot_chunk = $snmp_priv_prot ? { + undef => "", + default => "snmp_priv_prot=\"${snmp_priv_prot}\"", + } + $snmp_priv_passwd_chunk = $snmp_priv_passwd ? { + undef => "", + default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"", + } + $snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? { + undef => "", + default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-eaton-snmp": ensure => installed, + } -> exec { + "Creating stonith::fence_eaton_snmp": + command => "/usr/sbin/pcs stonith create stonith-fence_eaton_snmp-${real_address} fence_eaton_snmp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_eaton_snmp-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_eaton_snmp ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_eaton_snmp-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_eps.pp b/pacemaker/manifests/stonith/fence_eps.pp new file mode 100644 index 000000000..f25d9b298 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_eps.pp @@ -0,0 +1,128 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_eps ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $port = undef, + $hidden_page = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_eps": + command => "/usr/sbin/pcs stonith delete stonith-fence_eps-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_eps-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $hidden_page_chunk = $hidden_page ? { + undef => "", + default => "hidden_page=\"${hidden_page}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-eps": ensure => installed, + } -> exec { + "Creating stonith::fence_eps": + command => "/usr/sbin/pcs stonith create stonith-fence_eps-${real_address} fence_eps pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${hidden_page_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_eps-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_eps ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_eps-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_hpblade.pp b/pacemaker/manifests/stonith/fence_hpblade.pp new file mode 100644 index 000000000..de9f42bf8 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_hpblade.pp @@ -0,0 +1,148 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_hpblade ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $cmd_prompt = undef, + $secure = undef, + $port = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $identity_file = undef, + $ssh_options = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $missing_as_off = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_hpblade": + command => "/usr/sbin/pcs stonith delete stonith-fence_hpblade-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_hpblade-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $cmd_prompt_chunk = $cmd_prompt ? { + undef => "", + default => "cmd_prompt=\"${cmd_prompt}\"", + } + $secure_chunk = $secure ? { + undef => "", + default => "secure=\"${secure}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $identity_file_chunk = $identity_file ? { + undef => "", + default => "identity_file=\"${identity_file}\"", + } + $ssh_options_chunk = $ssh_options ? { + undef => "", + default => "ssh_options=\"${ssh_options}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $missing_as_off_chunk = $missing_as_off ? { + undef => "", + default => "missing_as_off=\"${missing_as_off}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-hpblade": ensure => installed, + } -> exec { + "Creating stonith::fence_hpblade": + command => "/usr/sbin/pcs stonith create stonith-fence_hpblade-${real_address} fence_hpblade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${missing_as_off_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_hpblade-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_hpblade ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_hpblade-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ibmblade.pp b/pacemaker/manifests/stonith/fence_ibmblade.pp new file mode 100644 index 000000000..f72cedc36 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ibmblade.pp @@ -0,0 +1,158 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ibmblade ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $port = undef, + $snmp_version = undef, + $community = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $snmp_auth_prot = undef, + $snmp_sec_level = undef, + $snmp_priv_prot = undef, + $snmp_priv_passwd = undef, + $snmp_priv_passwd_script = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ibmblade": + command => "/usr/sbin/pcs stonith delete stonith-fence_ibmblade-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ibmblade-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $snmp_version_chunk = $snmp_version ? { + undef => "", + default => "snmp_version=\"${snmp_version}\"", + } + $community_chunk = $community ? { + undef => "", + default => "community=\"${community}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $snmp_auth_prot_chunk = $snmp_auth_prot ? { + undef => "", + default => "snmp_auth_prot=\"${snmp_auth_prot}\"", + } + $snmp_sec_level_chunk = $snmp_sec_level ? { + undef => "", + default => "snmp_sec_level=\"${snmp_sec_level}\"", + } + $snmp_priv_prot_chunk = $snmp_priv_prot ? { + undef => "", + default => "snmp_priv_prot=\"${snmp_priv_prot}\"", + } + $snmp_priv_passwd_chunk = $snmp_priv_passwd ? { + undef => "", + default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"", + } + $snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? { + undef => "", + default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ibmblade": ensure => installed, + } -> exec { + "Creating stonith::fence_ibmblade": + command => "/usr/sbin/pcs stonith create stonith-fence_ibmblade-${real_address} fence_ibmblade pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ibmblade-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ibmblade ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ibmblade-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_idrac.pp b/pacemaker/manifests/stonith/fence_idrac.pp new file mode 100644 index 000000000..dce567db2 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_idrac.pp @@ -0,0 +1,103 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_idrac ( + $auth = undef, + $ipaddr = undef, + $passwd = undef, + $passwd_script = undef, + $lanplus = undef, + $login = undef, + $timeout = undef, + $cipher = undef, + $method = undef, + $power_wait = undef, + $delay = undef, + $privlvl = undef, + $verbose = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_idrac": + command => "/usr/sbin/pcs stonith delete stonith-fence_idrac-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_idrac-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $auth_chunk = $auth ? { + undef => "", + default => "auth=\"${auth}\"", + } + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $lanplus_chunk = $lanplus ? { + undef => "", + default => "lanplus=\"${lanplus}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $timeout_chunk = $timeout ? { + undef => "", + default => "timeout=\"${timeout}\"", + } + $cipher_chunk = $cipher ? { + undef => "", + default => "cipher=\"${cipher}\"", + } + $method_chunk = $method ? { + undef => "", + default => "method=\"${method}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $privlvl_chunk = $privlvl ? { + undef => "", + default => "privlvl=\"${privlvl}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ipmilan": ensure => installed, + } -> exec { + "Creating stonith::fence_idrac": + command => "/usr/sbin/pcs stonith create stonith-fence_idrac-${real_address} fence_idrac pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_idrac-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_idrac ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_idrac-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ifmib.pp b/pacemaker/manifests/stonith/fence_ifmib.pp new file mode 100644 index 000000000..2d33d98c5 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ifmib.pp @@ -0,0 +1,158 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ifmib ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $port = undef, + $snmp_version = undef, + $community = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $snmp_auth_prot = undef, + $snmp_sec_level = undef, + $snmp_priv_prot = undef, + $snmp_priv_passwd = undef, + $snmp_priv_passwd_script = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ifmib": + command => "/usr/sbin/pcs stonith delete stonith-fence_ifmib-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ifmib-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $snmp_version_chunk = $snmp_version ? { + undef => "", + default => "snmp_version=\"${snmp_version}\"", + } + $community_chunk = $community ? { + undef => "", + default => "community=\"${community}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $snmp_auth_prot_chunk = $snmp_auth_prot ? { + undef => "", + default => "snmp_auth_prot=\"${snmp_auth_prot}\"", + } + $snmp_sec_level_chunk = $snmp_sec_level ? { + undef => "", + default => "snmp_sec_level=\"${snmp_sec_level}\"", + } + $snmp_priv_prot_chunk = $snmp_priv_prot ? { + undef => "", + default => "snmp_priv_prot=\"${snmp_priv_prot}\"", + } + $snmp_priv_passwd_chunk = $snmp_priv_passwd ? { + undef => "", + default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"", + } + $snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? { + undef => "", + default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ifmib": ensure => installed, + } -> exec { + "Creating stonith::fence_ifmib": + command => "/usr/sbin/pcs stonith create stonith-fence_ifmib-${real_address} fence_ifmib pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ifmib-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ifmib ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ifmib-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ilo.pp b/pacemaker/manifests/stonith/fence_ilo.pp new file mode 100644 index 000000000..fe4297310 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ilo.pp @@ -0,0 +1,138 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ilo ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $ssl = undef, + $notls = undef, + $ribcl = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $ssl_secure = undef, + $ssl_insecure = undef, + $verbose = undef, + $debug = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ilo": + command => "/usr/sbin/pcs stonith delete stonith-fence_ilo-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $ssl_chunk = $ssl ? { + undef => "", + default => "ssl=\"${ssl}\"", + } + $notls_chunk = $notls ? { + undef => "", + default => "notls=\"${notls}\"", + } + $ribcl_chunk = $ribcl ? { + undef => "", + default => "ribcl=\"${ribcl}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $ssl_secure_chunk = $ssl_secure ? { + undef => "", + default => "ssl_secure=\"${ssl_secure}\"", + } + $ssl_insecure_chunk = $ssl_insecure ? { + undef => "", + default => "ssl_insecure=\"${ssl_insecure}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ilo2": ensure => installed, + } -> exec { + "Creating stonith::fence_ilo": + command => "/usr/sbin/pcs stonith create stonith-fence_ilo-${real_address} fence_ilo pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${ribcl_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ilo-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ilo ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ilo-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ilo2.pp b/pacemaker/manifests/stonith/fence_ilo2.pp new file mode 100644 index 000000000..4799dc73d --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ilo2.pp @@ -0,0 +1,138 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ilo2 ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $ssl = undef, + $notls = undef, + $ribcl = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $ssl_secure = undef, + $ssl_insecure = undef, + $verbose = undef, + $debug = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ilo2": + command => "/usr/sbin/pcs stonith delete stonith-fence_ilo2-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo2-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $ssl_chunk = $ssl ? { + undef => "", + default => "ssl=\"${ssl}\"", + } + $notls_chunk = $notls ? { + undef => "", + default => "notls=\"${notls}\"", + } + $ribcl_chunk = $ribcl ? { + undef => "", + default => "ribcl=\"${ribcl}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $ssl_secure_chunk = $ssl_secure ? { + undef => "", + default => "ssl_secure=\"${ssl_secure}\"", + } + $ssl_insecure_chunk = $ssl_insecure ? { + undef => "", + default => "ssl_insecure=\"${ssl_insecure}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ilo2": ensure => installed, + } -> exec { + "Creating stonith::fence_ilo2": + command => "/usr/sbin/pcs stonith create stonith-fence_ilo2-${real_address} fence_ilo2 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${ribcl_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ilo2-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ilo2 ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ilo2-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ilo3.pp b/pacemaker/manifests/stonith/fence_ilo3.pp new file mode 100644 index 000000000..b7777cb39 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ilo3.pp @@ -0,0 +1,103 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ilo3 ( + $auth = undef, + $ipaddr = undef, + $passwd = undef, + $passwd_script = undef, + $lanplus = undef, + $login = undef, + $timeout = undef, + $cipher = undef, + $method = undef, + $power_wait = undef, + $delay = undef, + $privlvl = undef, + $verbose = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ilo3": + command => "/usr/sbin/pcs stonith delete stonith-fence_ilo3-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo3-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $auth_chunk = $auth ? { + undef => "", + default => "auth=\"${auth}\"", + } + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $lanplus_chunk = $lanplus ? { + undef => "", + default => "lanplus=\"${lanplus}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $timeout_chunk = $timeout ? { + undef => "", + default => "timeout=\"${timeout}\"", + } + $cipher_chunk = $cipher ? { + undef => "", + default => "cipher=\"${cipher}\"", + } + $method_chunk = $method ? { + undef => "", + default => "method=\"${method}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $privlvl_chunk = $privlvl ? { + undef => "", + default => "privlvl=\"${privlvl}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ipmilan": ensure => installed, + } -> exec { + "Creating stonith::fence_ilo3": + command => "/usr/sbin/pcs stonith create stonith-fence_ilo3-${real_address} fence_ilo3 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ilo3-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ilo3 ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ilo3-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ilo4.pp b/pacemaker/manifests/stonith/fence_ilo4.pp new file mode 100644 index 000000000..3b1da970e --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ilo4.pp @@ -0,0 +1,103 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ilo4 ( + $auth = undef, + $ipaddr = undef, + $passwd = undef, + $passwd_script = undef, + $lanplus = undef, + $login = undef, + $timeout = undef, + $cipher = undef, + $method = undef, + $power_wait = undef, + $delay = undef, + $privlvl = undef, + $verbose = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ilo4": + command => "/usr/sbin/pcs stonith delete stonith-fence_ilo4-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo4-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $auth_chunk = $auth ? { + undef => "", + default => "auth=\"${auth}\"", + } + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $lanplus_chunk = $lanplus ? { + undef => "", + default => "lanplus=\"${lanplus}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $timeout_chunk = $timeout ? { + undef => "", + default => "timeout=\"${timeout}\"", + } + $cipher_chunk = $cipher ? { + undef => "", + default => "cipher=\"${cipher}\"", + } + $method_chunk = $method ? { + undef => "", + default => "method=\"${method}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $privlvl_chunk = $privlvl ? { + undef => "", + default => "privlvl=\"${privlvl}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ipmilan": ensure => installed, + } -> exec { + "Creating stonith::fence_ilo4": + command => "/usr/sbin/pcs stonith create stonith-fence_ilo4-${real_address} fence_ilo4 pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ilo4-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ilo4 ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ilo4-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ilo_mp.pp b/pacemaker/manifests/stonith/fence_ilo_mp.pp new file mode 100644 index 000000000..661a70e85 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ilo_mp.pp @@ -0,0 +1,133 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ilo_mp ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $secure = undef, + $cmd_prompt = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $identity_file = undef, + $ssh_options = undef, + $verbose = undef, + $debug = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ilo_mp": + command => "/usr/sbin/pcs stonith delete stonith-fence_ilo_mp-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ilo_mp-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $secure_chunk = $secure ? { + undef => "", + default => "secure=\"${secure}\"", + } + $cmd_prompt_chunk = $cmd_prompt ? { + undef => "", + default => "cmd_prompt=\"${cmd_prompt}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $identity_file_chunk = $identity_file ? { + undef => "", + default => "identity_file=\"${identity_file}\"", + } + $ssh_options_chunk = $ssh_options ? { + undef => "", + default => "ssh_options=\"${ssh_options}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ilo-mp": ensure => installed, + } -> exec { + "Creating stonith::fence_ilo_mp": + command => "/usr/sbin/pcs stonith create stonith-fence_ilo_mp-${real_address} fence_ilo_mp pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${secure_chunk} ${cmd_prompt_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ilo_mp-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ilo_mp ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ilo_mp-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_imm.pp b/pacemaker/manifests/stonith/fence_imm.pp new file mode 100644 index 000000000..993556c5a --- /dev/null +++ b/pacemaker/manifests/stonith/fence_imm.pp @@ -0,0 +1,103 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_imm ( + $auth = undef, + $ipaddr = undef, + $passwd = undef, + $passwd_script = undef, + $lanplus = undef, + $login = undef, + $timeout = undef, + $cipher = undef, + $method = undef, + $power_wait = undef, + $delay = undef, + $privlvl = undef, + $verbose = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_imm": + command => "/usr/sbin/pcs stonith delete stonith-fence_imm-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_imm-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $auth_chunk = $auth ? { + undef => "", + default => "auth=\"${auth}\"", + } + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $lanplus_chunk = $lanplus ? { + undef => "", + default => "lanplus=\"${lanplus}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $timeout_chunk = $timeout ? { + undef => "", + default => "timeout=\"${timeout}\"", + } + $cipher_chunk = $cipher ? { + undef => "", + default => "cipher=\"${cipher}\"", + } + $method_chunk = $method ? { + undef => "", + default => "method=\"${method}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $privlvl_chunk = $privlvl ? { + undef => "", + default => "privlvl=\"${privlvl}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ipmilan": ensure => installed, + } -> exec { + "Creating stonith::fence_imm": + command => "/usr/sbin/pcs stonith create stonith-fence_imm-${real_address} fence_imm pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_imm-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_imm ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_imm-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_intelmodular.pp b/pacemaker/manifests/stonith/fence_intelmodular.pp new file mode 100644 index 000000000..bde84bafd --- /dev/null +++ b/pacemaker/manifests/stonith/fence_intelmodular.pp @@ -0,0 +1,158 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_intelmodular ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $port = undef, + $snmp_version = undef, + $community = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $snmp_auth_prot = undef, + $snmp_sec_level = undef, + $snmp_priv_prot = undef, + $snmp_priv_passwd = undef, + $snmp_priv_passwd_script = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_intelmodular": + command => "/usr/sbin/pcs stonith delete stonith-fence_intelmodular-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_intelmodular-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $snmp_version_chunk = $snmp_version ? { + undef => "", + default => "snmp_version=\"${snmp_version}\"", + } + $community_chunk = $community ? { + undef => "", + default => "community=\"${community}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $snmp_auth_prot_chunk = $snmp_auth_prot ? { + undef => "", + default => "snmp_auth_prot=\"${snmp_auth_prot}\"", + } + $snmp_sec_level_chunk = $snmp_sec_level ? { + undef => "", + default => "snmp_sec_level=\"${snmp_sec_level}\"", + } + $snmp_priv_prot_chunk = $snmp_priv_prot ? { + undef => "", + default => "snmp_priv_prot=\"${snmp_priv_prot}\"", + } + $snmp_priv_passwd_chunk = $snmp_priv_passwd ? { + undef => "", + default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"", + } + $snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? { + undef => "", + default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-intelmodular": ensure => installed, + } -> exec { + "Creating stonith::fence_intelmodular": + command => "/usr/sbin/pcs stonith create stonith-fence_intelmodular-${real_address} fence_intelmodular pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_intelmodular-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_intelmodular ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_intelmodular-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ipdu.pp b/pacemaker/manifests/stonith/fence_ipdu.pp new file mode 100644 index 000000000..7dbd3a598 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ipdu.pp @@ -0,0 +1,158 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ipdu ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $port = undef, + $snmp_version = undef, + $community = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $snmp_auth_prot = undef, + $snmp_sec_level = undef, + $snmp_priv_prot = undef, + $snmp_priv_passwd = undef, + $snmp_priv_passwd_script = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ipdu": + command => "/usr/sbin/pcs stonith delete stonith-fence_ipdu-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ipdu-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $snmp_version_chunk = $snmp_version ? { + undef => "", + default => "snmp_version=\"${snmp_version}\"", + } + $community_chunk = $community ? { + undef => "", + default => "community=\"${community}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $snmp_auth_prot_chunk = $snmp_auth_prot ? { + undef => "", + default => "snmp_auth_prot=\"${snmp_auth_prot}\"", + } + $snmp_sec_level_chunk = $snmp_sec_level ? { + undef => "", + default => "snmp_sec_level=\"${snmp_sec_level}\"", + } + $snmp_priv_prot_chunk = $snmp_priv_prot ? { + undef => "", + default => "snmp_priv_prot=\"${snmp_priv_prot}\"", + } + $snmp_priv_passwd_chunk = $snmp_priv_passwd ? { + undef => "", + default => "snmp_priv_passwd=\"${snmp_priv_passwd}\"", + } + $snmp_priv_passwd_script_chunk = $snmp_priv_passwd_script ? { + undef => "", + default => "snmp_priv_passwd_script=\"${snmp_priv_passwd_script}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ipdu": ensure => installed, + } -> exec { + "Creating stonith::fence_ipdu": + command => "/usr/sbin/pcs stonith create stonith-fence_ipdu-${real_address} fence_ipdu pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${port_chunk} ${snmp_version_chunk} ${community_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${snmp_auth_prot_chunk} ${snmp_sec_level_chunk} ${snmp_priv_prot_chunk} ${snmp_priv_passwd_chunk} ${snmp_priv_passwd_script_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ipdu-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ipdu ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ipdu-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_ipmilan.pp b/pacemaker/manifests/stonith/fence_ipmilan.pp new file mode 100644 index 000000000..c143d5820 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_ipmilan.pp @@ -0,0 +1,103 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_ipmilan ( + $auth = undef, + $ipaddr = undef, + $passwd = undef, + $passwd_script = undef, + $lanplus = undef, + $login = undef, + $timeout = undef, + $cipher = undef, + $method = undef, + $power_wait = undef, + $delay = undef, + $privlvl = undef, + $verbose = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_ipmilan": + command => "/usr/sbin/pcs stonith delete stonith-fence_ipmilan-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_ipmilan-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $auth_chunk = $auth ? { + undef => "", + default => "auth=\"${auth}\"", + } + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $lanplus_chunk = $lanplus ? { + undef => "", + default => "lanplus=\"${lanplus}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $timeout_chunk = $timeout ? { + undef => "", + default => "timeout=\"${timeout}\"", + } + $cipher_chunk = $cipher ? { + undef => "", + default => "cipher=\"${cipher}\"", + } + $method_chunk = $method ? { + undef => "", + default => "method=\"${method}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $privlvl_chunk = $privlvl ? { + undef => "", + default => "privlvl=\"${privlvl}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-ipmilan": ensure => installed, + } -> exec { + "Creating stonith::fence_ipmilan": + command => "/usr/sbin/pcs stonith create stonith-fence_ipmilan-${real_address} fence_ipmilan pcmk_host_list=\"${pcmk_host_value_chunk}\" ${auth_chunk} ${ipaddr_chunk} ${passwd_chunk} ${passwd_script_chunk} ${lanplus_chunk} ${login_chunk} ${timeout_chunk} ${cipher_chunk} ${method_chunk} ${power_wait_chunk} ${delay_chunk} ${privlvl_chunk} ${verbose_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_ipmilan-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_ipmilan ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_ipmilan-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_kdump.pp b/pacemaker/manifests/stonith/fence_kdump.pp new file mode 100644 index 000000000..dda1a83f8 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_kdump.pp @@ -0,0 +1,68 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_kdump ( + $nodename = undef, + $ipport = undef, + $family = undef, + $timeout = undef, + $verbose = undef, + $usage = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_kdump": + command => "/usr/sbin/pcs stonith delete stonith-fence_kdump-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_kdump-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $nodename_chunk = $nodename ? { + undef => "", + default => "nodename=\"${nodename}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $family_chunk = $family ? { + undef => "", + default => "family=\"${family}\"", + } + $timeout_chunk = $timeout ? { + undef => "", + default => "timeout=\"${timeout}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $usage_chunk = $usage ? { + undef => "", + default => "usage=\"${usage}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-kdump": ensure => installed, + } -> exec { + "Creating stonith::fence_kdump": + command => "/usr/sbin/pcs stonith create stonith-fence_kdump-${real_address} fence_kdump pcmk_host_list=\"${pcmk_host_value_chunk}\" ${nodename_chunk} ${ipport_chunk} ${family_chunk} ${timeout_chunk} ${verbose_chunk} ${usage_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_kdump-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_kdump ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_kdump-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_rhevm.pp b/pacemaker/manifests/stonith/fence_rhevm.pp new file mode 100644 index 000000000..9b31530c0 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_rhevm.pp @@ -0,0 +1,143 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_rhevm ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $ssl = undef, + $notls = undef, + $port = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $ssl_secure = undef, + $ssl_insecure = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_rhevm": + command => "/usr/sbin/pcs stonith delete stonith-fence_rhevm-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_rhevm-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $ssl_chunk = $ssl ? { + undef => "", + default => "ssl=\"${ssl}\"", + } + $notls_chunk = $notls ? { + undef => "", + default => "notls=\"${notls}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $ssl_secure_chunk = $ssl_secure ? { + undef => "", + default => "ssl_secure=\"${ssl_secure}\"", + } + $ssl_insecure_chunk = $ssl_insecure ? { + undef => "", + default => "ssl_insecure=\"${ssl_insecure}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-rhevm": ensure => installed, + } -> exec { + "Creating stonith::fence_rhevm": + command => "/usr/sbin/pcs stonith create stonith-fence_rhevm-${real_address} fence_rhevm pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_rhevm-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_rhevm ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_rhevm-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_rsb.pp b/pacemaker/manifests/stonith/fence_rsb.pp new file mode 100644 index 000000000..879799a52 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_rsb.pp @@ -0,0 +1,133 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_rsb ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $secure = undef, + $cmd_prompt = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $identity_file = undef, + $ssh_options = undef, + $verbose = undef, + $debug = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_rsb": + command => "/usr/sbin/pcs stonith delete stonith-fence_rsb-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_rsb-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $secure_chunk = $secure ? { + undef => "", + default => "secure=\"${secure}\"", + } + $cmd_prompt_chunk = $cmd_prompt ? { + undef => "", + default => "cmd_prompt=\"${cmd_prompt}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $identity_file_chunk = $identity_file ? { + undef => "", + default => "identity_file=\"${identity_file}\"", + } + $ssh_options_chunk = $ssh_options ? { + undef => "", + default => "ssh_options=\"${ssh_options}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-rsb": ensure => installed, + } -> exec { + "Creating stonith::fence_rsb": + command => "/usr/sbin/pcs stonith create stonith-fence_rsb-${real_address} fence_rsb pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${secure_chunk} ${cmd_prompt_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_rsb-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_rsb ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_rsb-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_scsi.pp b/pacemaker/manifests/stonith/fence_scsi.pp new file mode 100644 index 000000000..52032dde2 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_scsi.pp @@ -0,0 +1,68 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_scsi ( + $aptpl = undef, + $devices = undef, + $logfile = undef, + $delay = undef, + $key = undef, + $nodename = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_scsi": + command => "/usr/sbin/pcs stonith delete stonith-fence_scsi-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_scsi-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $aptpl_chunk = $aptpl ? { + undef => "", + default => "aptpl=\"${aptpl}\"", + } + $devices_chunk = $devices ? { + undef => "", + default => "devices=\"${devices}\"", + } + $logfile_chunk = $logfile ? { + undef => "", + default => "logfile=\"${logfile}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $key_chunk = $key ? { + undef => "", + default => "key=\"${key}\"", + } + $nodename_chunk = $nodename ? { + undef => "", + default => "nodename=\"${nodename}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-scsi": ensure => installed, + } -> exec { + "Creating stonith::fence_scsi": + command => "/usr/sbin/pcs stonith create stonith-fence_scsi-${real_address} fence_scsi pcmk_host_list=\"${pcmk_host_value_chunk}\" ${aptpl_chunk} ${devices_chunk} ${logfile_chunk} ${delay_chunk} ${key_chunk} ${nodename_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_scsi-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_scsi ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_scsi-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_virt.pp b/pacemaker/manifests/stonith/fence_virt.pp new file mode 100644 index 000000000..d948a58a1 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_virt.pp @@ -0,0 +1,83 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_virt ( + $debug = undef, + $serial_device = undef, + $serial_params = undef, + $channel_address = undef, + $ipport = undef, + $port = undef, + $timeout = undef, + $delay = undef, + $domain = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_virt": + command => "/usr/sbin/pcs stonith delete stonith-fence_virt-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_virt-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $serial_device_chunk = $serial_device ? { + undef => "", + default => "serial_device=\"${serial_device}\"", + } + $serial_params_chunk = $serial_params ? { + undef => "", + default => "serial_params=\"${serial_params}\"", + } + $channel_address_chunk = $channel_address ? { + undef => "", + default => "channel_address=\"${channel_address}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $timeout_chunk = $timeout ? { + undef => "", + default => "timeout=\"${timeout}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $domain_chunk = $domain ? { + undef => "", + default => "domain=\"${domain}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-virt": ensure => installed, + } -> exec { + "Creating stonith::fence_virt": + command => "/usr/sbin/pcs stonith create stonith-fence_virt-${real_address} fence_virt pcmk_host_list=\"${pcmk_host_value_chunk}\" ${debug_chunk} ${serial_device_chunk} ${serial_params_chunk} ${channel_address_chunk} ${ipport_chunk} ${port_chunk} ${timeout_chunk} ${delay_chunk} ${domain_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_virt-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_virt ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_virt-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_vmware_soap.pp b/pacemaker/manifests/stonith/fence_vmware_soap.pp new file mode 100644 index 000000000..47c6cedc8 --- /dev/null +++ b/pacemaker/manifests/stonith/fence_vmware_soap.pp @@ -0,0 +1,143 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_vmware_soap ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $ssl = undef, + $notls = undef, + $port = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $ssl_secure = undef, + $ssl_insecure = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_vmware_soap": + command => "/usr/sbin/pcs stonith delete stonith-fence_vmware_soap-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_vmware_soap-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $ssl_chunk = $ssl ? { + undef => "", + default => "ssl=\"${ssl}\"", + } + $notls_chunk = $notls ? { + undef => "", + default => "notls=\"${notls}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $ssl_secure_chunk = $ssl_secure ? { + undef => "", + default => "ssl_secure=\"${ssl_secure}\"", + } + $ssl_insecure_chunk = $ssl_insecure ? { + undef => "", + default => "ssl_insecure=\"${ssl_insecure}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-vmware-soap": ensure => installed, + } -> exec { + "Creating stonith::fence_vmware_soap": + command => "/usr/sbin/pcs stonith create stonith-fence_vmware_soap-${real_address} fence_vmware_soap pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${ssl_chunk} ${notls_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${ssl_secure_chunk} ${ssl_insecure_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_vmware_soap-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_vmware_soap ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_vmware_soap-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +} diff --git a/pacemaker/manifests/stonith/fence_wti.pp b/pacemaker/manifests/stonith/fence_wti.pp new file mode 100644 index 000000000..14b346fbd --- /dev/null +++ b/pacemaker/manifests/stonith/fence_wti.pp @@ -0,0 +1,143 @@ +# generated by agent_generator.rb, manual changes will be lost + +class pacemaker::stonith::fence_wti ( + $ipaddr = undef, + $login = undef, + $passwd = undef, + $cmd_prompt = undef, + $secure = undef, + $port = undef, + $ipport = undef, + $inet4_only = undef, + $inet6_only = undef, + $passwd_script = undef, + $identity_file = undef, + $ssh_options = undef, + $verbose = undef, + $debug = undef, + $separator = undef, + $power_timeout = undef, + $shell_timeout = undef, + $login_timeout = undef, + $power_wait = undef, + $delay = undef, + $retry_on = undef, + + $interval = "60s", + $ensure = present, + $pcmk_host_value = undef, + +) { + $real_address = "$(corosync-cfgtool -a $(crm_node -n))" + + if($ensure == absent) { + exec { + "Removing stonith::fence_wti": + command => "/usr/sbin/pcs stonith delete stonith-fence_wti-${real_address}", + onlyif => "/usr/sbin/pcs stonith show stonith-fence_wti-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } + } else { + $ipaddr_chunk = $ipaddr ? { + undef => "", + default => "ipaddr=\"${ipaddr}\"", + } + $login_chunk = $login ? { + undef => "", + default => "login=\"${login}\"", + } + $passwd_chunk = $passwd ? { + undef => "", + default => "passwd=\"${passwd}\"", + } + $cmd_prompt_chunk = $cmd_prompt ? { + undef => "", + default => "cmd_prompt=\"${cmd_prompt}\"", + } + $secure_chunk = $secure ? { + undef => "", + default => "secure=\"${secure}\"", + } + $port_chunk = $port ? { + undef => "", + default => "port=\"${port}\"", + } + $ipport_chunk = $ipport ? { + undef => "", + default => "ipport=\"${ipport}\"", + } + $inet4_only_chunk = $inet4_only ? { + undef => "", + default => "inet4_only=\"${inet4_only}\"", + } + $inet6_only_chunk = $inet6_only ? { + undef => "", + default => "inet6_only=\"${inet6_only}\"", + } + $passwd_script_chunk = $passwd_script ? { + undef => "", + default => "passwd_script=\"${passwd_script}\"", + } + $identity_file_chunk = $identity_file ? { + undef => "", + default => "identity_file=\"${identity_file}\"", + } + $ssh_options_chunk = $ssh_options ? { + undef => "", + default => "ssh_options=\"${ssh_options}\"", + } + $verbose_chunk = $verbose ? { + undef => "", + default => "verbose=\"${verbose}\"", + } + $debug_chunk = $debug ? { + undef => "", + default => "debug=\"${debug}\"", + } + $separator_chunk = $separator ? { + undef => "", + default => "separator=\"${separator}\"", + } + $power_timeout_chunk = $power_timeout ? { + undef => "", + default => "power_timeout=\"${power_timeout}\"", + } + $shell_timeout_chunk = $shell_timeout ? { + undef => "", + default => "shell_timeout=\"${shell_timeout}\"", + } + $login_timeout_chunk = $login_timeout ? { + undef => "", + default => "login_timeout=\"${login_timeout}\"", + } + $power_wait_chunk = $power_wait ? { + undef => "", + default => "power_wait=\"${power_wait}\"", + } + $delay_chunk = $delay ? { + undef => "", + default => "delay=\"${delay}\"", + } + $retry_on_chunk = $retry_on ? { + undef => "", + default => "retry_on=\"${retry_on}\"", + } + + $pcmk_host_value_chunk = $pcmk_host_list ? { + '' => '$(/usr/sbin/crm_node -n)', + default => "${pcmk_host_list}", + } + + package { + "fence-agents-wti": ensure => installed, + } -> exec { + "Creating stonith::fence_wti": + command => "/usr/sbin/pcs stonith create stonith-fence_wti-${real_address} fence_wti pcmk_host_list=\"${pcmk_host_value_chunk}\" ${ipaddr_chunk} ${login_chunk} ${passwd_chunk} ${cmd_prompt_chunk} ${secure_chunk} ${port_chunk} ${ipport_chunk} ${inet4_only_chunk} ${inet6_only_chunk} ${passwd_script_chunk} ${identity_file_chunk} ${ssh_options_chunk} ${verbose_chunk} ${debug_chunk} ${separator_chunk} ${power_timeout_chunk} ${shell_timeout_chunk} ${login_timeout_chunk} ${power_wait_chunk} ${delay_chunk} ${retry_on_chunk} op monitor interval=${interval}", + unless => "/usr/sbin/pcs stonith show stonith-fence_wti-${real_address} > /dev/null 2>&1", + require => Class["pacemaker::corosync"], + } -> exec { + "Adding non-local constraint stonith::fence_wti ${real_address}": + command => "/usr/sbin/pcs constraint location stonith-fence_wti-${real_address} avoids ${pcmk_host_value_chunk}" + } + } +}