puppet resource dependency












0















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']
}

}









share|improve this question

























  • 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
















0















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']
}

}









share|improve this question

























  • 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














0












0








0








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']
}

}









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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










2 Answers
2






active

oldest

votes


















0














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...






share|improve this answer
























  • 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



















0














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.






share|improve this answer























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    0














    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...






    share|improve this answer
























    • 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
















    0














    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...






    share|improve this answer
























    • 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














    0












    0








    0







    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...






    share|improve this answer













    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...







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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



















    • 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













    0














    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.






    share|improve this answer




























      0














      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.






      share|improve this answer


























        0












        0








        0







        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.






        share|improve this answer













        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 14 '17 at 16:33









        giraidgiraid

        1




        1






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt