Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

Erro de instalação do Mysql através do puppet

Ao executar a instalação do mysql através do puppet estou recebendo o seguinte erro:

notice: /Stage[main]//Service[mysql]: Dependency Package[mysql-server] has failures: true
warning: /Stage[main]//Service[mysql]: Skipping because of failed dependencies
notice: /Stage[main]//Package[openjdk-7-jre]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]//Exec[musicjungle]: Dependency Package[mysql-server] has failures: true
warning: /Stage[main]//Exec[musicjungle]: Skipping because of failed dependencies
notice: /Stage[main]//Package[tomcat7]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]//Exec[criacaoUsuario]: Dependency Package[mysql-server] has failures: true
warning: /Stage[main]//Exec[criacaoUsuario]: Skipping because of failed dependencies
notice: /Stage[main]//File[/var/lib/tomcat7/webapps/vraptor-musicjungle.war]/ensure: defined content as '{md5}0ec91ca0714f19d02f2219e08ad8a531'
notice: /Stage[main]//Service[tomcat7]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 140.64 seconds

Meu arquivo web.app possui as seguintes configurações:

exec { "apt-update":
  command => "/usr/bin/apt-get update"
}

package { ["openjdk-7-jre", "tomcat7", "mysql-server"]:
    ensure => installed,
    require => Exec["apt-update"]
}

service { "tomcat7":
    ensure => running,
    enable => true,
    hasstatus => true,
    hasrestart => true,
    require => Package["tomcat7"]    
}

file { "/var/lib/tomcat7/webapps/vraptor-musicjungle.war":
    source => "/vagrant/manifests/vraptor-musicjungle.war",
    owner => "tomcat7",
    group => "tomcat7",
    mode => 0644,
    require => Package["tomcat7"],
    notify => Service["tomcat7"]
}

service { "mysql":
    ensure => running,
    enable => true,
    hasstatus => true,
    hasrestart => true,
    require => Package["mysql-server"]
}

exec { "musicjungle":
    command => "mysqladmin -uroot create musicjungle",
    unless => "mysql -u root musicjungle",
    path => "/usr/bin",
    require => Service["mysql"]
}
exec { "criacaoUsuario":
    command => "mysql -uroot -e \"GRANT ALL PRIVILEGES ON * TO 'musicjungle'@'%' IDENTIFIED BY 'musicjungle';\" musicjungle",
    unless => "mysql -u musicjungle musicjungle",
    path => "/usr/bin",
    require => Exec["musicjungle"]
}

Alguma sugestão?

3 respostas

Você já tentou um vagrant destroy?

solução!

Tentei sim @Alexandre Aquiles. Acredito que ontem ao testar estava com alguma instabilidade em minha rede ou no repositório do mysql, pois ao tentar exectar novamente hoje foi certinho. Obtive a seguinte saída:

gilson@laptop:~/vagrant_alura/musicjungle$ vagrant up
/usr/bin/vagrant:57: warning: Insecure world writable dir /opt/Softwares/java_env/jdk/bin in PATH, mode 040777
/usr/lib/ruby/vendor_ruby/vagrant/pre-rubygems.rb:33: warning: Insecure world writable dir /opt/Softwares/java_env/jdk/bin in PATH, mode 040777
/usr/lib/ruby/vendor_ruby/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /opt/Softwares/java_env/jdk/bin in PATH, mode 040777
Bringing machine 'web' up with 'virtualbox' provider...
==> web: Importing base box 'hashicorp/precise32'...
==> web: Matching MAC address for NAT networking...
==> web: Checking if box 'hashicorp/precise32' is up to date...
==> web: Setting the name of the VM: musicjungle_web_1520889283426_93767
==> web: Clearing any previously set network interfaces...
==> web: Preparing network interfaces based on configuration...
    web: Adapter 1: nat
    web: Adapter 2: hostonly
==> web: Forwarding ports...
    web: 22 (guest) => 2222 (host) (adapter 1)
==> web: Booting VM...
==> web: Waiting for machine to boot. This may take a few minutes...
    web: SSH address: 127.0.0.1:2222
    web: SSH username: vagrant
    web: SSH auth method: private key
    web: 
    web: Vagrant insecure key detected. Vagrant will automatically replace
    web: this with a newly generated keypair for better security.
    web: 
    web: Inserting generated public key within guest...
    web: Removing insecure key from the guest if it's present...
    web: Key inserted! Disconnecting and reconnecting using new SSH key...
==> web: Machine booted and ready!
==> web: Checking for guest additions in VM...
    web: The guest additions on this VM do not match the installed version of
    web: VirtualBox! In most cases this is fine, but in rare cases it can
    web: prevent things such as shared folders from working properly. If you see
    web: shared folder errors, please make sure the guest additions within the
    web: virtual machine match the version of VirtualBox you have installed on
    web: your host and reload your VM.
    web: 
    web: Guest Additions Version: 4.2.0
    web: VirtualBox Version: 5.0
==> web: Configuring and enabling network interfaces...
==> web: Mounting shared folders...
    web: /vagrant => /home/gilson/vagrant_alura/musicjungle
gilson@laptop:~/vagrant_alura/musicjungle$ vagrant ssh
/usr/bin/vagrant:57: warning: Insecure world writable dir /opt/Softwares/java_env/jdk/bin in PATH, mode 040777
/usr/lib/ruby/vendor_ruby/vagrant/pre-rubygems.rb:33: warning: Insecure world writable dir /opt/Softwares/java_env/jdk/bin in PATH, mode 040777
/usr/lib/ruby/vendor_ruby/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /opt/Softwares/java_env/jdk/bin in PATH, mode 040777
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)

 * Documentation:  https://help.ubuntu.com/
New release '14.04.5 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 06:22:31 2012 from 10.0.2.2
vagrant@precise32:~$ sudo puppet apply /vagrant/manifests/web.pp 
notice: /Stage[main]//Exec[apt-update]/returns: executed successfully
notice: /Stage[main]//Package[mysql-server]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]//Package[openjdk-7-jre]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]//Exec[musicjungle]/returns: executed successfully
notice: /Stage[main]//Exec[mysql-password]/returns: executed successfully
notice: /Stage[main]//Package[tomcat7]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]//File[/var/lib/tomcat7/webapps/vraptor-musicjungle.war]/ensure: defined content as '{md5}0ec91ca0714f19d02f2219e08ad8a531'
notice: /Stage[main]//Service[tomcat7]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 184.59 seconds
vagrant@precise32:~$ exit
logout
Connection to 127.0.0.1 closed.

Obrigado

Bacana!