Bom dia,
Eu estou com problemas para testar o servidor php criado através o Vagrant/puppet, quando acesso o servidor php e rodo o comando netstat -tln mesmo como sudo não consigo ver a porta 8888 definida. já verifiquei os arquivos de configuração, destui a subi a máquina novamente porém sem sucesso, poderiam me ajudar a identificar o problema.
Segue meu Vagrantfile:
$script_mysql = <<-SCRIPT apt-get update && apt-get install -y mysql-server-5.7 && mysql -e "create user 'phpuser'@'%' identified by 'pass';" SCRIPT
criando VMs MySql e PHP, com box Linux bionic
Vagrant.configure("2") do |config| config.vm.box = "ubuntu/bionic64"
define servidor MySql
config.vm.define "mysqldb" do |mysql|
# configura ip privado via DHCP
#mysql.vm.network "private_network", type: "dhcp"
mysql.vm.network "public_network", ip: "10.0.0.71"
# copia pub key do host para guest(VM)
mysql.vm.provision "shell", inline: "cat /configs/id_bionic.pub >> .ssh/authorized_keys"
# executa script, modifica mysql cnf file, restart mysql service
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"
# monta folder do host na guest(VM), disabilita folder padrão
mysql.vm.synced_folder "./configs", "/configs"
mysql.vm.synced_folder ".", "/vagrant", disabled: true
end
define servidor PHP
config.vm.define "phpweb" do |phpweb| phpweb.vm.network "forwarded_port", guest:8888, host:8888 phpweb.vm.network "public_network", ip: "10.0.0.72"
# instala puppet no servidor php
phpweb.vm.provision "shell", inline: "apt-get update && apt-get install puppet -y"
# configura puppet no servidor php
phpweb.vm.provision "puppet" do |puppet|
puppet.manifests_path = "./configs/manifests"
puppet.manifest_file = "phpweb.pp"
end
end end
** Puppet file **
execute 'apt-get update'
exec { 'apt-update': command => '/usr/bin/apt-get update' }
install php package
package { ['php7.2' ,'php7.2-mysql'] : require => Exec['apt-update'], ensure => installed, }
ensure php service is running
exec { 'run-php7': require => Package['php7.2'], command => '/usr/bin/php -S 0.0.0.0:8888 -t /vagrant/src &' }