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

Cannot apply a cs_location to a group of resources #396

Closed
tullis opened this issue Jan 18, 2017 · 8 comments
Closed

Cannot apply a cs_location to a group of resources #396

tullis opened this issue Jan 18, 2017 · 8 comments

Comments

@tullis
Copy link

tullis commented Jan 18, 2017

I'm unable to apply a cs_location type to a group of resources. Am I missing something, or has it not yet been implemented?

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.8.5
  • Ruby: 2.1.5p273
  • Distribution: Debian Jessie
  • Module version: 5.0.0

How to reproduce (e.g Puppet code you use)

I'm trying to apply a cs_location type to a previously created cs_group but it doesn't work.

I have tried using the following puppet code:

  cs_location { 'ns1_internal_gw1':
    primitive => 'ns1_vips', # <- Name of group resource
    node_name => 'gw1',
    score     => '200',
  }

and

  cs_location { 'ns1_internal_gw1':
    primitive => Cs_group['ns1_vips'],
    node_name => 'gw1',
    score     => '200',
  }

I have had to resort to configuring a cs_location type for each member of the group, or creating the location constraints outside of puppet.

What are you seeing

These are the error messages displayed by my puppet client

ERROR: constraint ns1_vips_gw1 references a resource ns1_vips which doesn't exist
ERROR: constraint ns1_vips_gw1 references a resource Cs_group[ns1_vips] which doesn't exist

What behaviour did you expect instead

I would have expected to be able to apply a cs_location type to a group of resources.

@roidelapluie
Copy link
Member

That error message means that crm expects another syntax for location that imply groups.

Can you please add the location by hand : do a crm configure show and paste the crm configure show output for that location?

Thanks

@tullis
Copy link
Author

tullis commented Jan 20, 2017

Hi,

Thanks for the response.

Here is where I add four location constraints in by hand, using the crm shell.

crm(live)# configure location ns1_gw1 ns1_vips 200: gw1
crm(live)# configure location ns1_gw2 ns1_vips -1: gw2
crm(live)# configure location ns2_gw1 ns2_vips -1: gw1
crm(live)# configure location ns2_gw2 ns2_vips 200: gw2

Here is the portion of the crm configure show which shows the four location constraints.

location ns1_gw1 ns1_vips 200: gw1
location ns1_gw2 ns1_vips -1: gw2
location ns2_gw1 ns2_vips -1: gw1
location ns2_gw2 ns2_vips 200: gw2

If I use the puppet module as is, and I have to select primitives rather than groups for the location constraints, I seem to have to double this to 8 constraints, because each group has two member resources.

@roidelapluie
Copy link
Member

This should work. Can you add require => Cs_group['ns1_vips'],

@tullis
Copy link
Author

tullis commented Jan 20, 2017

Thanks very much. I can confirm that it works with that resource ordering pattern in place.
Sorry to trouble you with user error and thanks very much for your work on this module.

@tullis tullis closed this as completed Jan 20, 2017
@roidelapluie
Copy link
Member

No problem. Actually I will take some action of this.

@roidelapluie roidelapluie reopened this Jan 20, 2017
roidelapluie added a commit to roidelapluie/puppet-corosync that referenced this issue Jan 20, 2017
cs_location works with cs_group (at last with crm). It should the
autorequire it.

Fix voxpupuli#396

Signed-off-by: Julien Pivotto <[email protected]>
@roidelapluie
Copy link
Member

#397

roidelapluie added a commit to roidelapluie/puppet-corosync that referenced this issue Jan 20, 2017
cs_location works with cs_group (at last with crm). It should the
autorequire it.

Fix voxpupuli#396

Signed-off-by: Julien Pivotto <[email protected]>
@tullis
Copy link
Author

tullis commented Jan 20, 2017

Good stuff. Is it worth adding a note about the cs_group type to the README as well, while you're at it? I had to dig into the code to check that I could use it.

@roidelapluie
Copy link
Member

The readme should move away and be replaced by puppet-strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants