Schedule yum update not found

140 views
Skip to first unread message

Kazor

unread,
Jan 2, 2013, 2:53:13 PM1/2/13
to puppet...@googlegroups.com
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

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

        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!

Miguel Angel Coa Morales

unread,
Jan 3, 2013, 10:37:49 AM1/3/13
to puppet...@googlegroups.com
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!


--
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...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

jcbollinger

unread,
Jan 4, 2013, 9:28:08 AM1/4/13
to puppet...@googlegroups.com


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

Miguel Angel Coa Morales

unread,
Jan 4, 2013, 10:12:30 AM1/4/13
to puppet...@googlegroups.com
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!!

--
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.
Reply all
Reply to author
Forward
0 new messages