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

Support pcs 0.10 syntax and Debian family with pcs #499

Merged
merged 2 commits into from
Jan 17, 2022

Conversation

towo
Copy link
Member

@towo towo commented Dec 29, 2020

Pull Request (PR) description

This PR adds nominal support for some new OSes:

  • Debian 10
  • Debian 11
  • Ubuntu 18.04
  • Ubuntu 20.04

It also allows for the new syntax of pcs encountered in newer releases (namely starting with 0.10.0).

In that context, there are

Breaking changes
  1. version_corosync et al have been renamed to ensure_corosync (etc.) to better reflect what they're doing and reduce confusion.
  2. The promotable and ms_metadata attributes have been removed from ms_metadata. I recommend explicitly defining the clone resources.

The reasoning for this is simple:

  1. It's always ever been a shortcut; even pcs only aliases the promotable attribute on creation to creating the relevant resource manually. e.g. a clone
  2. promotable is not an actual attribute of a primitive; thus assigning and parsing it involves looking at other objects to see if it's embedded in the relevant container resource.
  3. Having two possible conflicting ways to achieve the same goal, in this case cs_primitive { 'foo': promotable => true } and cs_clone { foo-clone: primitive => 'foo'} is a sure-fire way of foot-shooting that will give issues with idempotency.

This Pull Request (PR) fixes the following issues

  • n/a

@towo
Copy link
Member Author

towo commented Dec 29, 2020

I'll try integrating #469 while I'm doing this anyway.

@bastelfreak bastelfreak added the enhancement New feature or request label Dec 29, 2020
$package_pcs = true
$package_fence_agents = false
$package_install_options = undef
} else {
Copy link
Member

Choose a reason for hiding this comment

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

since we only support 16 and newer, we don't need the else block?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, thus far it still has legacy support for 14.04, thought it would be easy just to keep this in.

@towo
Copy link
Member Author

towo commented Dec 30, 2020

There'll be commit cleanup, don't worry.

@towo towo force-pushed the os/debian10 branch 2 times, most recently from 522dace to 50c373d Compare December 30, 2020 16:11
@bastelfreak
Copy link
Member

@towo can you give it a try and rebase against our master?

@bastelfreak
Copy link
Member

@towo can you give this another look please?

@towo towo force-pushed the os/debian10 branch 8 times, most recently from c7cdcac to 1624df5 Compare December 22, 2021 14:17
@towo towo changed the title Support newer Debianites Support pcs 0.10 syntax and Debian family with pcs Dec 22, 2021
@towo towo force-pushed the os/debian10 branch 11 times, most recently from baed4bd to ca25910 Compare December 22, 2021 16:06
@towo towo force-pushed the os/debian10 branch 6 times, most recently from 8958a8a to cde46ca Compare December 27, 2021 15:56
* Removed the `promotable` attribute from `cs_primitive`. It's just a
  convenience function that was causing serious headaches in properly parsing
  the configuration, as promotability is *not* a property of the managed
  resource. Thus, it arguably should not be managed like it relates to the
  resource.
* Rename `version_corosync` et al. to `ensure_corosync` etc. to reduce confusion
  and clear up meaning.

* Add support for Debian 10, 11
* Add support for Ubuntu 18.04. 20.04
* Implicitly add support for `pcs` version 0.10.0+ commands; the CLI interface
  was changed here.

* Fix SLES references in `metadata.json`
@towo
Copy link
Member Author

towo commented Dec 28, 2021

There'll probably be some follow-up work for people thus inclined, I can add some issues for that. That'd be:

  • Consider splitting up the pcs provider in old and new; ideally just have a common base provider and extend, if that's possible.
  • There's some odd redundancies in the code that need to be refactored (i.e. thrown out).
  • Generally figure out if there's a nicer way to split up the pcs/crm parts, so that we don't have to do as many inline evaluations.

@towo towo marked this pull request as ready for review December 28, 2021 22:16
@towo towo requested a review from bastelfreak December 28, 2021 22:16
data/os/Debian/9.yaml Outdated Show resolved Hide resolved
data/os/RedHat/6.yaml Outdated Show resolved Hide resolved
@towo
Copy link
Member Author

towo commented Dec 30, 2021

Little idempotency feedback from one of our Debian 10 systems:

Info: Using environment 'test_puppet_corosync'
Info: Applying configuration version '1640727887'
Notice: /Stage[main]/Profile::Base/Service[puppet-update.timer]/ensure: current_value 'running', should be 'stopped' (noop)
Notice: /Stage[main]/Corosync/Package[pcs]/ensure: current_value 'purged', should be 'present' (noop)
Notice: Class[Corosync]: Would have triggered 'refresh' from 1 event
[… unoptimized non-relevant stuff …]
Notice: Stage[main]: Would have triggered 'refresh' from 3 events

That's without changing anything, so it would (logically) assume the new pcs corosync::provider as a default, but see nothing wrong with the resources while still maintaining it with crm.

Settings corosync::provider to crm gives me a total noop.

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

Successfully merging this pull request may close these issues.

3 participants