Hi group,
I got this classic dependency error in my puppetagent:
"> puppetagent: Error: Could not apply complete catalog: Found 1 dependency cycle:
==> puppetagent: (Exec[aptget_update] => Package[ack-grep] => Class[company::Defaults] => Stage[package-provision] => Stage[main] => Class[jbossas::Web] => Apt::Repository[webupd8team.org.deb] => File[apt_repository_webupd8team.org.deb] => Exec[aptget_update])
==> puppetagent: Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz"
What i do, i have three stages, one for setup repositories (package-provision), other for setup default staff and the main, the relationship is like i just said, so the setup of the repositories is in the first stage. My problem come when i tried to setup another repository from a class in main stage, i thought this will broke the possible dependencies but like i see, it doesnt. So i would like to know which is the better way or any recomendation to resolve this kind of problems. Ive thought to use hiera to do this because that repository which i tried to setup, i only need it on some nodes, but i would like to know about it from someone who know more than me... :).
My class for provision:
class company::repo_basic {
include apt
apt::repository { 'security.debian.org.deb':
distro => "${lsbdistcodename}",
repository => 'main contrib non-free'
}
apt::repository { 'updates.debian.org.deb':
distro => "${lsbdistcodename}",
repository => 'main contrib non-free'
}
apt::repository { "${lsbdistcodename}.ftp.de.debian.org.deb":
distro => "${lsbdistcodename}",
repository => 'main contrib non-free'
}
}
The class where i setup the new repository:
class jbossas::web {
include jbossas
apt::repository { 'webupd8team.org.deb':
distro => "precise",
repository => 'main',
key => 'EEA14886',
} ->
package { 'oracle-java7-installer':
ensure => installed,
alias => java
} ->
package { 'oracle-java7-set-default':
ensure => installed
} ->
class { 'jboss':
install => 'source',
install_source => 'puppet:///private/jboss/7.2.0.Final.zip',
version => '7',
install_destination => '/var/lib/',
install_dirname => 'jbossas',
bindaddr => '${ipaddress_eth1}',
port => '8080',
}
package { 'ant':
ensure => installed,
require => Package['java']
}
file { '/etc/profile.d/java.sh':
ensure => present,
source => 'puppet:///modules/iptracker/java.sh',
owner => 'root',
group => 'root',
mode => 644
}
}
Cheers.