Estou tentando instalar o jdk do Oracle com o Vagrant / Puppet .
Aqui está a parte relevante do meu Vagrant file
:
config.vm.provision :puppet, :module_path => "puppet/modules" do |puppet|
puppet.options = "--verbose --debug"
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "java.pp"
end
e aqui está o arquivo de fantoches java.pp
:
class java {
package { "python-software-properties":
require => Exec['apt-update'],
ensure => installed
}
exec { 'add-webupd8-key':
command => 'sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886',
path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ],
}
exec { 'apt-update':
command => 'sudo apt-get update',
path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ],
}
exec { "add-apt-repository-oracle":
command => "sudo add-apt-repository -y ppa:webupd8team/java",
path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ],
require => [Exec["add-webupd8-key"],Package["python-software-properties"]],
# notify => Exec["apt-update"]
}
exec {
'set-licence-selected':
command => '/bin/echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections';
'set-licence-seen':
command => '/bin/echo debconf shared/accepted-oracle-license-v1-1 seen true | /usr/bin/debconf-set-selections';
}
package { 'oracle-java7-installer':
# ensure => "7u40-0~webupd8~0",
ensure => installed,
require => [Exec['add-apt-repository-oracle'], Exec['apt-update'], Exec['set-licence-selected'], Exec['set-licence-seen']],
}
}
include java
Quando executo vagrant up
pela primeira vez, sempre recebo o seguinte erro:
debug: Puppet::Type::Package::ProviderApt: Executing '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install oracle-java7-installer'
err: /Stage[main]/Java/Package[oracle-java7-installer]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install oracle-java7-installer' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package oracle-java7-installer
quando eu próximo executar um vagrant provision
, o jdk será instalado corretamente .
Alguém por favor pode me ajudar a entender por que o provisionamento não funciona tranqüilamente no estágio errante? Além disso, como posso simplificar meu arquivo java.pp?