Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Download da aula 6 inclui script puppet não-idempotente

O projeto fornecido por download para ser usado nesta aula não é idempotente. O curso passa o tempo todo batendo na tecla de que o script puppet tem que ser idempotente, mas acaba fornecendo como exemplo um script que não o é. Isso deveria ser corrigido.

$ vagrant up web
Bringing machine 'web' up with 'virtualbox' provider...
==> web: Importing base box 'ubuntu/bionic64'...

Aqui havia um trecho da saída. Omiti por falta de espaço.

    web: Notice: Preparing to install into /etc/puppet/code/modules ...
    web: Notice: Created target directory /etc/puppet/code/modules
    web: Notice: Downloading from https://forgeapi.puppet.com ...
    web: Notice: Installing -- do not interrupt ...
    web: /etc/puppet/code/modules
    web: └─┬ puppetlabs-apache (v3.4.0)
    web:   ├── puppetlabs-concat (v5.1.0)
    web:   └── puppetlabs-stdlib (v5.1.0)
    web: Puppet installed!
==> web: Running provisioner: puppet...
==> web: Running Puppet with web.pp...
==> web: Notice: Compiled catalog for ubuntu-bionic.prevnet in environment production in 0.08 seconds
==> web: Notice: /Stage[main]/Main/Exec[apt-update]/returns: executed successfully
==> web: Notice: /Stage[main]/Main/Package[openjdk-8-jre]/ensure: created
==> web: Notice: /Stage[main]/Main/Package[tomcat8]/ensure: created
==> web: Notice: /Stage[main]/Main/Package[mariadb-server]/ensure: created
==> web: Notice: /Stage[main]/Main/Exec[musicjungle]/returns: executed successfully
==> web: Notice: /Stage[main]/Main/Exec[user_mariadb]/returns: executed successfully
==> web: Notice: /Stage[main]/Main/File[/var/lib/tomcat8/webapps/vraptor-musicjungle.war]/ensure: defined content as '{md5}8c34dedbfa82c3afeff2d300739d18a6'
==> web: Notice: /Stage[main]/Main/File_line[production]/ensure: created
==> web: Notice: /Stage[main]/Main/Service[tomcat8]: Triggered 'refresh' from 2 events
==> web: Notice: Applied catalog in 174.53 seconds
$
$ vagrant provision web --provision-with puppet
==> web: Running provisioner: puppet...
==> web: Running Puppet with web.pp...
==> web: Notice: Compiled catalog for ubuntu-bionic.prevnet in environment production in 0.05 seconds
==> web: Notice: /Stage[main]/Main/Exec[apt-update]/returns: executed successfully
==> web: Notice: /Stage[main]/Main/Exec[user_mariadb]/returns: ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'admin'@'localhost'
==> web: Error: '/bin/echo "CREATE USER 'admin'@'localhost';GRANT USAGE on *.* TO 'admin'@'localhost';GRANT ALL privileges ON musicjungle.* TO  'admin'@'localhost';FLUSH PRIVILEGES;" |  /usr/bin/mysql -u root' returned 1 instead of one of [0]
==> web: Error: /Stage[main]/Main/Exec[user_mariadb]/returns: change from 'notrun' to ['0'] failed: '/bin/echo "CREATE USER 'admin'@'localhost';GRANT USAGE on *.* TO 'admin'@'localhost';GRANT ALL privileges ON musicjungle.* TO  'admin'@'localhost';FLUSH PRIVILEGES;" |  /usr/bin/mysql -u root' returned 1 instead of one of [0]
==> web: Notice: Applied catalog in 3.93 seconds
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
$
1 resposta
solução!

O fórum é mais pra dúvidas se tem certeza que está errado abra um chamado em http://suporte.alura.com.br/ .

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software