puppet resource dependency
When I do puppet apply, I get the error:
Warning: Scope(Mod::Cl[title]): Can't load '/tmp/file.yaml' File does not exist!
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '' is not applicable to an Undef Value.
I specify that loadyaml is a function of stdlib module
However, I want to execute file resource before define resource
Someone can help me ?
class mod::princ (
file { '/tmp/file.yaml':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:///modules/othermod/file.yaml",
before => Mod::Cl["title"],
}->
Mod::Cl{ "title" :
tmp_file => "/tmp/file.yaml",
}
}
define mod::cl (
String $tmp_file,
){
$tmp = loadyaml("$tmp_file")
$tmp[var].each |Integer $i, Hash[String,String] $var|
{
$mark=$var['Mark']
}
}
linux puppet yaml
add a comment |
When I do puppet apply, I get the error:
Warning: Scope(Mod::Cl[title]): Can't load '/tmp/file.yaml' File does not exist!
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '' is not applicable to an Undef Value.
I specify that loadyaml is a function of stdlib module
However, I want to execute file resource before define resource
Someone can help me ?
class mod::princ (
file { '/tmp/file.yaml':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:///modules/othermod/file.yaml",
before => Mod::Cl["title"],
}->
Mod::Cl{ "title" :
tmp_file => "/tmp/file.yaml",
}
}
define mod::cl (
String $tmp_file,
){
$tmp = loadyaml("$tmp_file")
$tmp[var].each |Integer $i, Hash[String,String] $var|
{
$mark=$var['Mark']
}
}
linux puppet yaml
Reading through puppet.com/blog/…, it sounds like loadyaml opens a file on the puppet server, not the client.
– SYN
May 25 '17 at 11:22
add a comment |
When I do puppet apply, I get the error:
Warning: Scope(Mod::Cl[title]): Can't load '/tmp/file.yaml' File does not exist!
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '' is not applicable to an Undef Value.
I specify that loadyaml is a function of stdlib module
However, I want to execute file resource before define resource
Someone can help me ?
class mod::princ (
file { '/tmp/file.yaml':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:///modules/othermod/file.yaml",
before => Mod::Cl["title"],
}->
Mod::Cl{ "title" :
tmp_file => "/tmp/file.yaml",
}
}
define mod::cl (
String $tmp_file,
){
$tmp = loadyaml("$tmp_file")
$tmp[var].each |Integer $i, Hash[String,String] $var|
{
$mark=$var['Mark']
}
}
linux puppet yaml
When I do puppet apply, I get the error:
Warning: Scope(Mod::Cl[title]): Can't load '/tmp/file.yaml' File does not exist!
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '' is not applicable to an Undef Value.
I specify that loadyaml is a function of stdlib module
However, I want to execute file resource before define resource
Someone can help me ?
class mod::princ (
file { '/tmp/file.yaml':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:///modules/othermod/file.yaml",
before => Mod::Cl["title"],
}->
Mod::Cl{ "title" :
tmp_file => "/tmp/file.yaml",
}
}
define mod::cl (
String $tmp_file,
){
$tmp = loadyaml("$tmp_file")
$tmp[var].each |Integer $i, Hash[String,String] $var|
{
$mark=$var['Mark']
}
}
linux puppet yaml
linux puppet yaml
edited 18 mins ago
Rui F Ribeiro
40.1k1479136
40.1k1479136
asked May 21 '17 at 16:48
soufsouf
11
11
Reading through puppet.com/blog/…, it sounds like loadyaml opens a file on the puppet server, not the client.
– SYN
May 25 '17 at 11:22
add a comment |
Reading through puppet.com/blog/…, it sounds like loadyaml opens a file on the puppet server, not the client.
– SYN
May 25 '17 at 11:22
Reading through puppet.com/blog/…, it sounds like loadyaml opens a file on the puppet server, not the client.
– SYN
May 25 '17 at 11:22
Reading through puppet.com/blog/…, it sounds like loadyaml opens a file on the puppet server, not the client.
– SYN
May 25 '17 at 11:22
add a comment |
2 Answers
2
active
oldest
votes
Out of my experience with puppet things like "before"/"require" and sequencing(->) don't work very well together. Try removing the sequencing as probably the file isn't getting created...
Thanks for the answer, even if I delete "before"/"require" and sequencing(->), I get the same error
– souf
May 21 '17 at 18:01
Sorry, I should've made myself more clear. You need either before/require OR sequencing. Try keeping before in place and delete the sequence part.
– man0v
May 21 '17 at 18:04
Unfortunately, i get the same error. Thank you Georgi
– souf
May 21 '17 at 18:23
I take my answer back then.
– man0v
May 21 '17 at 18:26
add a comment |
As specified in puppet function call reference page, functions are called at compilation time, so it doesn't matter what the ordering is, the function will be called before the module gets executed.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f366392%2fpuppet-resource-dependency%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Out of my experience with puppet things like "before"/"require" and sequencing(->) don't work very well together. Try removing the sequencing as probably the file isn't getting created...
Thanks for the answer, even if I delete "before"/"require" and sequencing(->), I get the same error
– souf
May 21 '17 at 18:01
Sorry, I should've made myself more clear. You need either before/require OR sequencing. Try keeping before in place and delete the sequence part.
– man0v
May 21 '17 at 18:04
Unfortunately, i get the same error. Thank you Georgi
– souf
May 21 '17 at 18:23
I take my answer back then.
– man0v
May 21 '17 at 18:26
add a comment |
Out of my experience with puppet things like "before"/"require" and sequencing(->) don't work very well together. Try removing the sequencing as probably the file isn't getting created...
Thanks for the answer, even if I delete "before"/"require" and sequencing(->), I get the same error
– souf
May 21 '17 at 18:01
Sorry, I should've made myself more clear. You need either before/require OR sequencing. Try keeping before in place and delete the sequence part.
– man0v
May 21 '17 at 18:04
Unfortunately, i get the same error. Thank you Georgi
– souf
May 21 '17 at 18:23
I take my answer back then.
– man0v
May 21 '17 at 18:26
add a comment |
Out of my experience with puppet things like "before"/"require" and sequencing(->) don't work very well together. Try removing the sequencing as probably the file isn't getting created...
Out of my experience with puppet things like "before"/"require" and sequencing(->) don't work very well together. Try removing the sequencing as probably the file isn't getting created...
answered May 21 '17 at 17:30
man0vman0v
30917
30917
Thanks for the answer, even if I delete "before"/"require" and sequencing(->), I get the same error
– souf
May 21 '17 at 18:01
Sorry, I should've made myself more clear. You need either before/require OR sequencing. Try keeping before in place and delete the sequence part.
– man0v
May 21 '17 at 18:04
Unfortunately, i get the same error. Thank you Georgi
– souf
May 21 '17 at 18:23
I take my answer back then.
– man0v
May 21 '17 at 18:26
add a comment |
Thanks for the answer, even if I delete "before"/"require" and sequencing(->), I get the same error
– souf
May 21 '17 at 18:01
Sorry, I should've made myself more clear. You need either before/require OR sequencing. Try keeping before in place and delete the sequence part.
– man0v
May 21 '17 at 18:04
Unfortunately, i get the same error. Thank you Georgi
– souf
May 21 '17 at 18:23
I take my answer back then.
– man0v
May 21 '17 at 18:26
Thanks for the answer, even if I delete "before"/"require" and sequencing(->), I get the same error
– souf
May 21 '17 at 18:01
Thanks for the answer, even if I delete "before"/"require" and sequencing(->), I get the same error
– souf
May 21 '17 at 18:01
Sorry, I should've made myself more clear. You need either before/require OR sequencing. Try keeping before in place and delete the sequence part.
– man0v
May 21 '17 at 18:04
Sorry, I should've made myself more clear. You need either before/require OR sequencing. Try keeping before in place and delete the sequence part.
– man0v
May 21 '17 at 18:04
Unfortunately, i get the same error. Thank you Georgi
– souf
May 21 '17 at 18:23
Unfortunately, i get the same error. Thank you Georgi
– souf
May 21 '17 at 18:23
I take my answer back then.
– man0v
May 21 '17 at 18:26
I take my answer back then.
– man0v
May 21 '17 at 18:26
add a comment |
As specified in puppet function call reference page, functions are called at compilation time, so it doesn't matter what the ordering is, the function will be called before the module gets executed.
add a comment |
As specified in puppet function call reference page, functions are called at compilation time, so it doesn't matter what the ordering is, the function will be called before the module gets executed.
add a comment |
As specified in puppet function call reference page, functions are called at compilation time, so it doesn't matter what the ordering is, the function will be called before the module gets executed.
As specified in puppet function call reference page, functions are called at compilation time, so it doesn't matter what the ordering is, the function will be called before the module gets executed.
answered Aug 14 '17 at 16:33
giraidgiraid
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f366392%2fpuppet-resource-dependency%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Reading through puppet.com/blog/…, it sounds like loadyaml opens a file on the puppet server, not the client.
– SYN
May 25 '17 at 11:22