Skip to content

Add a type for ensure on service resources #750

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

Merged
merged 1 commit into from
Nov 2, 2017

Conversation

npwalker
Copy link
Contributor

No description provided.

@ekohl
Copy link
Collaborator

ekohl commented Mar 29, 2017

Would ServiceEnsure or EnsureService be easier to read?

@jonhattan
Copy link

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
Collaborator

ekohl commented Oct 23, 2017

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

@@ -0,0 +1 @@
type Stdlib::Serviceensure = Enum['stopped', 'running']
Copy link
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
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
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
Member

Add the needed docs change and I will merge.

@david22swan
Copy link
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
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