Issue #19019 has been updated by eric sorenson.
Status changed from Unreviewed to Needs More Information
Assignee set to Richard K. Miller
So you want the command to be executed as a byproduct of being defined as an
attribute of the file resource? That seems like it would be very confusing for
the next person who comes across it to understand. It seems like your use case
would be handled exactly by John Bollinger's suggestion in #2762 "The Exec can
be given a short, meaningful title (i.e. different from its command) so that
relationships to it are more readable to humans" and then you have clear,
non-magical code:
<pre>
exec { "get_composer":
command => "curl -s https://getcomposer.org/installer | php --
--install-dir=/usr/local/bin":
creates => "/usr/local/bin/composer.phar",
}
file { "/usr/local/bin/composer.phar":
require => Exec["get_composer"]
mode => 0755,
owner => "root",
}
</pre>
Have I misunderstood or mischaracterized something here?
I’ve put this ticket’s status into “Needs more Information” and assigned it to
you. Please either (a) update it with the information I’ve requested and
re-assign it to me if you need more help, or (b) change the status to “Closed”
if you were able to resolve the issue on your own.
----------------------------------------
Feature #19019: Add "createdby" parameter to "file" type
https://projects.puppetlabs.com/issues/19019#change-90327
* Author: Richard K. Miller
* Status: Needs More Information
* Priority: Normal
* Assignee: Richard K. Miller
* Category: language
* Target version:
* Affected Puppet version:
* Keywords:
* Branch:
----------------------------------------
I occasionally use **exec** + **creates** to install a file not easily
available any other way.
<pre>
exec { "curl -s https://getcomposer.org/installer | php --
--install-dir=/usr/local/bin":
creates => "/usr/local/bin/composer.phar",
}
</pre>
If there were a **createdby** parameter on the **file** type, I could reverse
the clauses like this:
<pre>
file { "/usr/local/bin/composer.phar":
createdby => "curl -s https://getcomposer.org/installer | php --
--install-dir=/usr/local/bin",
}
</pre>
...which would mean I could use **file** parameters like **mode**, **owner**,
**group**, etc.
<pre>
file { "/usr/local/bin/composer.phar":
createdby => "curl -s https://getcomposer.org/installer | php --
--install-dir=/usr/local/bin",
mode => 0755,
owner => "root",
}
</pre>
The **createdby** parameter would be somewhat similar to the **content**
parameter except that it would create the file by running a local command
instead of passing the content.
This may also help solve Issue #2762 and Issue #2546 .
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.