FAQ
Hello guys,
I'm creating class for update my servers these are Centos (RedHat Family) .
But when i run from puppet client, only apply update version but the
command "yum update" declared within in my class not found .


My class "updateso" (/etc/puppet/modules/updateso/manifests/init.pp) :

[.............]

class updateso {

#operatingsystem => CentOS
#operatingsystemrelease => 5.8
#osfamily => RedHat
#architecture => x86_64

if $osfamily == 'RedHat' {

schedule { "daily":
period => daily,
range => "12 - 17",
repeat => "1",
}

exec { "Update SO":
user => "root",
command => "/usr/bin/yum --exclude=kernel* --exclude=mysql*
--exclude=php* update -y",
schedule => daily,
refreshonly => true,
}

}

} #End class

[.............]


My instance site.pp

[.............]

node 'mail.example.com' {
include updateso
}

[.............]

From agent:

[.............]

[root@correo ~]# puppet agent --test
info: Caching catalog for mail.example.com
info: Applying configuration version '1357155391'
notice: Finished catalog run in 0.12 seconds
[.............]


¿Any suggestions?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/CoiasMKiwMQJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Miguel Angel Coa Morales at Jan 3, 2013 at 3:37 pm
    Hello,
    I resolved the structure inside my init.pp, but the command in the puppet agent fails:

    [………]
    Jan 3 12:25:45 mail2 puppet-agent[31902]: (/Stage[main]/Updateso/Exec[yum --exclude=drbd* --exclude=kernel* --exclude=mysql* --exclude=php* update -y]/returns) change from notrun to 0 failed: yum --exclude=drbd* --exclude=kernel* --exclude=mysql* --exclude=php* update -y returned 1 instead of one of [0] at /etc/puppet/modules/updateso/manifests/init.pp:13
    [………]

    My class updateso

    [………]

    class updateso {

    schedule{ daily:
    range => "10 - 15",
    repeat => 2,
    }

    exec { "yum --exclude=drbd* --exclude=kernel* --exclude=mysql* --exclude=php* update -y": #LINE 13
    schedule => daily,
    path => "/usr/local/bin/:/bin/:/usr/bin/",
    # refreshonly => true,
    # command => "yum --exclude=kernel* --exclude=mysql* --exclude=php* update -y",
    }

    #}


    }
    [………]


    The line 13 is the command yum --exclude ……


    Thanks!


    El 02-01-2013, a las 16:53, Kazor <miguelcoam@gmail.com> escribió:
    Hello guys,
    I'm creating class for update my servers these are Centos (RedHat Family) . But when i run from puppet client, only apply update version but the command "yum update" declared within in my class not found .


    My class "updateso" (/etc/puppet/modules/updateso/manifests/init.pp) :

    [.............]

    class updateso {

    #operatingsystem => CentOS
    #operatingsystemrelease => 5.8
    #osfamily => RedHat
    #architecture => x86_64

    if $osfamily == 'RedHat' {

    schedule { "daily":
    period => daily,
    range => "12 - 17",
    repeat => "1",
    }

    exec { "Update SO":
    user => "root",
    command => "/usr/bin/yum --exclude=kernel* --exclude=mysql* --exclude=php* update -y",
    schedule => daily,
    refreshonly => true,
    }

    }

    } #End class

    [.............]


    My instance site.pp

    [.............]

    node 'mail.example.com' {
    include updateso
    }

    [.............]

    From agent:

    [.............]

    [root@correo ~]# puppet agent --test
    info: Caching catalog for mail.example.com
    info: Applying configuration version '1357155391'
    notice: Finished catalog run in 0.12 seconds
    [.............]


    ¿Any suggestions?

    Thanks!


    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/CoiasMKiwMQJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Jcbollinger at Jan 4, 2013 at 2:28 pm

    On Thursday, January 3, 2013 9:37:49 AM UTC-6, Kazor wrote:
    Hello,
    I resolved the structure inside my init.pp, but the command in the puppet
    agent fails:

    [………]
    Jan 3 12:25:45 mail2 puppet-agent[31902]: (/Stage[main]/Updateso/Exec[yum
    --exclude=drbd* --exclude=kernel* --exclude=mysql* --exclude=php* update
    -y]/returns) change from notrun to 0 failed: yum --exclude=drbd*
    --exclude=kernel* --exclude=mysql* --exclude=php* update -y returned 1
    instead of one of [0] at /etc/puppet/modules/updateso/manifests/init.pp:13
    [………]

    My class updateso

    [………]

    class updateso {

    schedule{ daily:
    range => "10 - 15",
    repeat => 2,
    }

    exec { "yum --exclude=drbd* --exclude=kernel* --exclude=mysql*
    --exclude=php* update -y": #LINE 13
    schedule => daily,
    path => "/usr/local/bin/:/bin/:/usr/bin/",
    # refreshonly => true,
    # command => "yum --exclude=kernel* --exclude=mysql* --exclude=php*
    update -y",
    }

    #}


    }
    [………]


    The line 13 is the command yum --exclude ……
    That looks perfectly normal to me. Your "yum update" command is not
    completing successfully. That's probably not Puppet's fault. Run the same
    command manually to see yum's explanation of the problem, but I'd bet it's
    a depsolving failure arising from your package exclusions.


    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/PWxzV5bAb9IJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Miguel Angel Coa Morales at Jan 4, 2013 at 3:12 pm
    Hello jcbollinger,
    I resolved the problem with "sudo" in the command syntax .

    [………...]
    class updateso {

    schedule{ weekly:
    range => "14 - 16",
    repeat => 2,
    }

    exec { "sudo yum --exclude=drbd* --exclude=kernel* --exclude=mysql* --exclude=php* update -y":
    user => root,
    # password_required => true,
    schedule => weekly,
    path => "/bin:/usr/bin:/sbin:/usr/sbin",
    }

    }
    […………]


    Thanks a lot!!

    El 04-01-2013, a las 11:28, jcbollinger <john.bollinger@stjude.org> escribió:

    On Thursday, January 3, 2013 9:37:49 AM UTC-6, Kazor wrote:
    Hello,
    I resolved the structure inside my init.pp, but the command in the puppet agent fails:

    [………]
    Jan 3 12:25:45 mail2 puppet-agent[31902]: (/Stage[main]/Updateso/Exec[yum --exclude=drbd* --exclude=kernel* --exclude=mysql* --exclude=php* update -y]/returns) change from notrun to 0 failed: yum --exclude=drbd* --exclude=kernel* --exclude=mysql* --exclude=php* update -y returned 1 instead of one of [0] at /etc/puppet/modules/updateso/manifests/init.pp:13
    [………]

    My class updateso

    [………]

    class updateso {

    schedule{ daily:
    range => "10 - 15",
    repeat => 2,
    }

    exec { "yum --exclude=drbd* --exclude=kernel* --exclude=mysql* --exclude=php* update -y": #LINE 13
    schedule => daily,
    path => "/usr/local/bin/:/bin/:/usr/bin/",
    # refreshonly => true,
    # command => "yum --exclude=kernel* --exclude=mysql* --exclude=php* update -y",
    }

    #}


    }
    [………]


    The line 13 is the command yum --exclude ……


    That looks perfectly normal to me. Your "yum update" command is not completing successfully. That's probably not Puppet's fault. Run the same command manually to see yum's explanation of the problem, but I'd bet it's a depsolving failure arising from your package exclusions.


    John


    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/PWxzV5bAb9IJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJan 2, '13 at 7:53p
activeJan 4, '13 at 3:12p
posts4
users2
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase