Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Reid Vandewiele commented on PUP-10665 Re: Add weak dependencies to puppet resources It's really too bad we can't use before and after for weak ordering. isolated_* isn't exactly intuitive. Maybe instead we could for those ones do order_before order_after It's true we can never remove the original before, but it might be a good idea to introduce a new alias for that functionality which we can recommend new code use instead. We have require, which is good; we could pair require with the new before alias: required_by Add Comment This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371714.1599956556000.139514.1632518640040%40Atlassian.JIRA.
Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Reid Vandewiele commented on PUP-10665 Re: Add weak dependencies to puppet resources Language check: to match existing grammar (require, subscribe, before, notify), the suggested weak dependency keywords should be singular, not plural. That is, optional_require optional_notify want wanted_by Add Comment This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371714.1599956556000.138602.1632430320084%40Atlassian.JIRA.
Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Trevor Vaughan commented on PUP-10665 Re: Add weak dependencies to puppet resources Changed optionally to optional because it's easier to type Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371714.1599956556000.36286.1600184400027%40Atlassian.JIRA.
Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Trevor Vaughan updated an issue Puppet / PUP-10665 Add weak dependencies to puppet resources Change By: Trevor Vaughan After [a long discussion in Slack|https://puppetcommunity.slack.com/archives/C0W1X7ZAL/p1599682853112600], I was asked to create a ticket around adding 'weak dependencies' to puppet resources. Weak dependencies work like the {{wants}} keyword in {{systemd}} in that resources will be ordered after other resources that they {{want}} but failures in earlier resources will not cause cascading errors into resources that {{want}} them.This would be useful in cases like the {{yumrepo}} resource which may cascade down to packages that do not actually reside in that repository.Per the Slack discussion, it looks like implementing this in the compiler is going to be the best case for backwards compatibility and could constitute a non-breaking feature enhancement.An example of what this might look like is: (updated from comments below) {code} exec { 'ping host': command => 'ping 1.2.3.4'}exec { 'ping other host': command => 'ping 2.3.4.5'}file { '/tmp/foo': owner => 'root', mode => '0640', requires => [ File['/tmp'], Exec['ping host'] ], # Add these items to the autorequires list optionally_requires optional_requires => [File['/dev/shm']], # Do not fail if these resources fail wants => [ Exec['ping other host'] ]}{code} The pairings would be: * {{ optionally_requires optional_requires }} => {{ optionally_notifies optional_notifies }}* {{wants}} => {{wanted_by}}Potential symbols (Stretch Goal) : * {{ optionally_requires optional_requires }} => {{*>}}** Denotes the 'match anything' regex marker* {{wants}} => {{+>}}** Denotes a broken line == broken dependencyIn this case, {{requires}} would work as usual and {{wants}} would use the resource if present, ignore it if not, and not cascade resource failures.If something exists in both {{requires}} and {{wants}} then the stronger dependency ({{requires}}) should win. Add Comment
Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Trevor Vaughan updated an issue Puppet / PUP-10665 Add weak dependencies to puppet resources Change By: Trevor Vaughan After [a long discussion in Slack|https://puppetcommunity.slack.com/archives/C0W1X7ZAL/p1599682853112600], I was asked to create a ticket around adding 'weak dependencies' to puppet resources. Weak dependencies work like the {{wants}} keyword in {{systemd}} in that resources will be ordered after other resources that they {{want}} but failures in earlier resources will not cause cascading errors into resources that {{want}} them.This would be useful in cases like the {{yumrepo}} resource which may cascade down to packages that do not actually reside in that repository.Per the Slack discussion, it looks like implementing this in the compiler is going to be the best case for backwards compatibility and could constitute a non-breaking feature enhancement.An example of what this might look like is: (updated from comments below) {code} exec { 'ping host': command => 'ping 1.2.3.4'}exec { 'ping other host': command => 'ping 2.3.4.5'} file { '/tmp/foo': owner => 'root', mode => '0640', requires => [ File['/tmp'], Exec[' foo ping host '] ] , wants # Add these items to the autorequires list optionally_requires => [ File['/ etc dev / bar shm '] ] , # Do not fail if these resources fail wants => [ Exec[' baz ping other host '] ]}{code} The pairings would be:* {{optionally_requires}} => {{optionally_notifies}}* {{wants}} => {{wanted_by}}Potential symbols:* {{optionally_requires}} => {{*>}}** Denotes the 'match anything' regex marker* {{wants}} => {{+>}}** Denotes a broken line == broken dependency In this case, {{requires}} would work as usual and {{wants}} would use the resource if present, ignore it if not, and not cascade resource failures.If something exists in both {{requires}} and {{wants}} then the stronger dependency ({{requires}}) should win. Add Comment
Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Trevor Vaughan commented on PUP-10665 Re: Add weak dependencies to puppet resources I like the idea above from Henrik Lindberg. It is true that optionally_requires is not the same as isolated_before. (I warned people that I was bad at naming things). Technically, optionally_before is what I expected the regular before to be when I started using the language but I think that ship has sailed. Even though it's a bit more wordy, I think that this is probably better than my original idea. The optionally_ stuff is actually easy to implement because it's identical to the auto (autorequires, etc...) portions of custom types that already exist. I think may be borrowing from systemd and using wants and wanted_by would be a bit easier to wrap our heads around than the isolated_* naming scheme. I'll update the description with these ideas. Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371714.1599956556000.36162.1600171980061%40Atlassian.JIRA.
Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Henrik Lindberg commented on PUP-10665 Re: Add weak dependencies to puppet resources Is the case "resource must be there, but don't propagate errors" valid? Seems like optionally_requires and do_not_propagate are separate things. Maybe these concepts are: optionally_before, optionaly_after (since optionally_require is a bit of an oxymoron) - this is a soft dependency, no error if missing isolated_before, isolated_after - this does not propagate errors (isolated == isolated from errors) and implies optionality unless resource is also listed as required. Just a thought. Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.371714.1599956556000.35178.1600094280037%40Atlassian.JIRA.
Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Trevor Vaughan updated an issue Puppet / PUP-10665 Add weak dependencies to puppet resources Change By: Trevor Vaughan After [a long discussion in Slack|https://puppetcommunity.slack.com/archives/C0W1X7ZAL/p1599682853112600], I was asked to create a ticket around adding 'weak dependencies' to puppet resources. Weak dependencies work like the {{wants}} keyword in {{systemd}} in that resources will be ordered after other resources that they {{want}} but failures in earlier resources will not cause cascading errors into resources that {{want}} them.This would be useful in cases like the {{yumrepo}} resource which may cascade down to packages that do not actually reside in that repository.Per the Slack discussion, it looks like implementing this in the compiler is going to be the best case for backwards compatibility and could constitute a non-breaking feature enhancement. An example of what this might look like is:{code}file { '/tmp/foo': owner => 'root', mode => '0640', requires => [ File['/tmp'], Exec['foo'] ] wants => [ File['/etc/bar'], Exec['baz'] ]}{code}In this case, {{requires}} would work as usual and {{wants}} would use the resource if present, ignore it if not, and not cascade resource failures.If something exists in both {{requires}} and {{wants}} then the stronger dependency ({{requires}}) should win. Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Jira (PUP-10665) Add weak dependencies to puppet resources
Title: Message Title Trevor Vaughan created an issue Puppet / PUP-10665 Add weak dependencies to puppet resources Issue Type: New Feature Assignee: Unassigned Components: Language Created: 2020/09/12 5:22 PM Priority: Normal Reporter: Trevor Vaughan After a long discussion in Slack, I was asked to create a ticket around adding 'weak dependencies' to puppet resources. Weak dependencies work like the wants keyword in systemd in that resources will be ordered after other resources that they want but failures in earlier resources will not cause cascading errors into resources that want them. This would be useful in cases like the yumrepo resource which may cascade down to packages that do not actually reside in that repository. Per the Slack discussion, it looks like implementing this in the compiler is going to be the best case for backwards compatibility and could constitute a non-breaking feature enhancement. Add Comment