0
respostas

Error: Could not parse for environment production

Esta somente aparecendo o index do APACHE

phpweb: Error: Could not parse for environment production: Syntax error at end of input (file: /tmp/vagrant-puppet/manifests-1987fd5f72c17d54c08031a1c4913b39/phpweb.pp) on node ubuntu-bionic 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.

Vagrant- File $script_mysql = <<-SCRIPT apt-get update && apt-get install -y mysql-server-5.7 && mysql -e "create user 'phpuser'@'%' identified by 'pass';" SCRIPT

Vagrant.configure("2") do |config| config.vm.box = "ubuntu/bionic64"

config.vm.define "mysqldb" do |mysql|  
    mysql.vm.network "public_network", ip: "192.168.0.107"

    mysql.vm.provision "shell", inline: "cat /configs/id_bionic.pub  >> .ssh/authorized_keys"
    mysql.vm.provision "shell", inline: $script_mysql
    mysql.vm.provision "shell", inline: "cat /configs/mysqld.cnf  > /etc/mysql/mysql.conf.d/mysqld.cnf"
    mysql.vm.provision "shell", inline: "service mysql restart"


    mysql.vm.synced_folder "./configs", "/configs"
    mysql.vm.synced_folder "./", "/vagrant", disabled: true
end

config.vm.define "phpweb" do |phpweb|
    phpweb.vm.network "forwarded_port", guest: 8888, host: 8888
    phpweb.vm.network "public_network", ip: "192.168.0.156"

    phpweb.vm.provision "shell", inline: "apt-get update && apt-get install -y puppet"

    phpweb.vm.provision "puppet" do |puppet|
        puppet.manifests_path = "./configs/manifests"
        puppet.manifest_file = "phpweb.pp"
    end

end

end

phpweb.pp - Puppet

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

package { ['php7.2' ,'php7.2-mysql'] : require => Exec['apt-update'], ensure => installed, }

exec { 'run-php7': require => Package['php7.2'], command => '/usr/bin/php -S 0.0.0.0:8888 -t /vagrant/src &'

index.php

"; $servername = "192.168.1.24"; $username = "phpuser"; $password = "pass"; // Create connection $conn = new mysqli($servername, $username, $password); // Check connection if ($conn->connect_error) { die("Conexão falhou: " . $conn->connect_error); } echo "Conectado com sucesso"; ?>