Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change commands for pcs-0.10 #513

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@
# is applied.
# TODO - make it run only once
exec { 'pcs_cluster_auth':
command => "pcs cluster auth ${node_string} ${auth_credential_string}",
command => "pcs host auth ${node_string} ${auth_credential_string}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a corosync expert. Can you explain a bit why do you this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax has changed from previous version. See 'man pcs' -> Changes in pcs-0.10.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but for which operating systems? as far as I know it works fine on the operating systems listed in the metadata.json. If this is version specific we could use a fact for the corosync/pcs version and use the correct command based on that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course this makes sense. i had to make the change for ubuntu 20.04 because ubuntu 16.04 has no maintenance anymore

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you can take a look at the work in #499 . That already looks promising. It would be nice if we could get this implemented without breaking backwards compatibility.

path => $exec_path,
require => [
Service['pcsd'],
Expand All @@ -628,7 +628,7 @@
# the pcs_cluster_auth_qdevice command doesn't fail. This should generate
# a temporary corosync.conf which will then be overwritten
exec { 'pcs_cluster_temporary':
command => "pcs cluster setup --force --name ${cluster_name} ${node_string}",
command => "pcs cluster setup --force ${cluster_name} ${node_string}",
path => $exec_path,
onlyif => 'test ! -f /etc/corosync/corosync.conf',
require => Exec['pcs_cluster_auth'],
Expand All @@ -645,7 +645,7 @@

$quorum_device_password = $sensitive_quorum_device_password.unwrap
exec { 'pcs_cluster_auth_qdevice':
command => "pcs cluster auth ${quorum_device_host} -u hacluster -p ${quorum_device_password}",
command => "pcs host auth ${quorum_device_host} -u hacluster -p ${quorum_device_password}",
path => $exec_path,
onlyif => $qdevice_token_check,
require => [
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/corosync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@

it 'authorizes all nodes' do
is_expected.to contain_exec('pcs_cluster_auth').with(
command: 'pcs cluster auth node1.test.org node2.test.org node3.test.org -u hacluster -p some-secret-sauce',
command: 'pcs host auth node1.test.org node2.test.org node3.test.org -u hacluster -p some-secret-sauce',
path: '/sbin:/bin:/usr/sbin:/usr/bin',
require: [
'Service[pcsd]',
Expand Down Expand Up @@ -801,7 +801,7 @@

it 'match ip and auth nodes by member names' do
is_expected.to contain_exec('pcs_cluster_auth').with(
command: 'pcs cluster auth 192.168.0.10 192.168.0.12 192.168.0.13 -u hacluster -p some-secret-sauce',
command: 'pcs host auth 192.168.0.10 192.168.0.12 192.168.0.13 -u hacluster -p some-secret-sauce',
path: '/sbin:/bin:/usr/sbin:/usr/bin',
require: [
'Service[pcsd]',
Expand Down Expand Up @@ -973,7 +973,7 @@

it 'configures a temporary cluster if corosync.conf is missing' do
is_expected.to contain_exec('pcs_cluster_temporary').with(
command: 'pcs cluster setup --force --name cluster_test node1.test.org node2.test.org node3.test.org',
command: 'pcs cluster setup --force cluster_test node1.test.org node2.test.org node3.test.org',
path: '/sbin:/bin:/usr/sbin:/usr/bin',
onlyif: 'test ! -f /etc/corosync/corosync.conf',
require: 'Exec[pcs_cluster_auth]'
Expand All @@ -982,7 +982,7 @@

it 'authorizes and adds the quorum device' do
is_expected.to contain_exec('pcs_cluster_auth_qdevice').with(
command: 'pcs cluster auth quorum1.test.org -u hacluster -p quorum-secret-password',
command: 'pcs host auth quorum1.test.org -u hacluster -p quorum-secret-password',
path: '/sbin:/bin:/usr/sbin:/usr/bin',
onlyif: 'test 0 -ne $(grep quorum1.test.org /var/lib/pcsd/tokens >/dev/null 2>&1; echo $?)',
require: [
Expand Down