Skip to content

Add a type for ensure on service resources#750

Merged
david22swan merged 1 commit intopuppetlabs:masterfrom
npwalker:add_service_ensure_type
Nov 2, 2017
Merged

Add a type for ensure on service resources#750
david22swan merged 1 commit intopuppetlabs:masterfrom
npwalker:add_service_ensure_type

Conversation

@npwalker
Copy link
Copy Markdown
Contributor

No description provided.

@ekohl
Copy link
Copy Markdown
Collaborator

ekohl commented Mar 29, 2017

Would ServiceEnsure or EnsureService be easier to read?

@jonhattan
Copy link
Copy Markdown

Only first character uppercase, for consistency with existing types (f.e: Stdlib::Absolutepath).

Ensureservice seems better to me, so it's consistent with adding Ensurewhatever in a future.

@ekohl
Copy link
Copy Markdown
Collaborator

ekohl commented Oct 23, 2017

A third option is Stdlib::Ensure::Service and Stdlib::Ensure::Whatever.

Comment thread types/serviceensure.pp Outdated
@@ -0,0 +1 @@
type Stdlib::Serviceensure = Enum['stopped', 'running']
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this not be

type Stdlib::Serviceensure = Varient[Boolean,Enum['stopped', 'running']]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

IMO, using ensure => true or ensure => false on a service is an anti-pattern. It works but it's just not as clear to new users what is going on. As a convention I don't support it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I tend to agree with you however if this is going into stdlib then i think it should conform to the documentation
https://puppet.com/docs/puppet/5.3/type.html#service-attribute-ensure

@david22swan
Copy link
Copy Markdown
Member

Add the needed docs change and I will merge.

@david22swan
Copy link
Copy Markdown
Member

@npwalker Moving towards a clean release on this module to allow a full rubocop run, so would love to get this in before that. Please add the docs so I can do o, otherwise a full-rebase will be needed.

@npwalker npwalker force-pushed the add_service_ensure_type branch from bb1a971 to ec2c517 Compare November 2, 2017 16:33
@npwalker
Copy link
Copy Markdown
Contributor Author

npwalker commented Nov 2, 2017

@david22swan okay updated.

@david22swan david22swan merged commit df3b527 into puppetlabs:master Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants