Issues with creating a dev machine.

50 views
Skip to first unread message

Luca Degasperi

unread,
Jun 7, 2013, 12:29:56 PM6/7/13
to example42-pu...@googlegroups.com
Hello,

I'm currently trying to setup a dev environment with puppet and vagrant. I'm using almost only the example42 modules because they are really clean.

I'm trying to build this env: https://github.com/lucadegasperi/vagrant-setup it uses nginx + php + php-fpm + mysql and i'm having some issues.
while the provision goes smooth (you can try it by yourselves by cloning the repo). Some weird things happen:

- Unless the vm is rebooted, nginx doesn't work.
- The mysql grant is not applied in any way.

Who could help me building this and/or give me some hints on how to build it correctly?

Alessandro Franceschi

unread,
Jun 7, 2013, 2:40:02 PM6/7/13
to example42-pu...@googlegroups.com
Tested it. Result is here: https://gist.github.com/example42/5731381

The grant seems correctly done, to start NGINX a second Puppet run is needed .
This is probably due to a non complete dependencies management either in the modules or in the code you used to glue them together.

If having to run Puppet twice (not perfect but sometimes hard to avoid) is not an issue this should be ok.
Otherwise some more tests are needed.

Alessandro Franceschi

unread,
Jun 7, 2013, 2:50:54 PM6/7/13
to example42-pu...@googlegroups.com
Adding the dependency when the declaring the apache class solves (here):

class { 'apache':
  disable => true,
  before  => Class['nginx'],
}

Luca Degasperi

unread,
Jun 7, 2013, 3:45:03 PM6/7/13
to example42-pu...@googlegroups.com
That last command surely helped, and now the provisioning works just fine.
As for the grant, it gets created but when running the mysql command inside the vm and typing "show databases;" I can't see the one I created but only test and information_schema. how can I see the db from inside the vm? 

Luca Degasperi

unread,
Jun 7, 2013, 3:58:40 PM6/7/13
to example42-pu...@googlegroups.com
Also I have noticed the php modules are only installed only after I reboot the vm. How can I solve this?

Alessandro Franceschi

unread,
Jun 7, 2013, 4:39:38 PM6/7/13
to example42-pu...@googlegroups.com
If you see my gist (I replicated the vm creation with the same effect) the php modules are installed at the first run and the database is created.
Can't reproduce the missing parts you mention.

Luca Degasperi

unread,
Jun 7, 2013, 4:43:28 PM6/7/13
to example42-pu...@googlegroups.com
My bad, I explained the problem poorly. If you run the index.php (which contains a phpinfo) script inside the public folder after the first puppet run, only the base modules look to be installed. whereas when rebooting all the other module appear in the phpinfo.

Alessandro Franceschi

unread,
Jun 7, 2013, 5:37:34 PM6/7/13
to example42-pu...@googlegroups.com
Verify if the modules are installed before the nginx service during the puppet run.
If not, something like this might help:
Php::Module <||> {
  notify +> Service['nginx'],
}
(I would not place such a dependency directly in the php or nginx module),
 
If you don't see the modules in any case, even if they are installed before the service, then give a deeper look to the logs or debug the puppet run, as the problem could not be directly related to Puppet.

Luca Degasperi

unread,
Jun 7, 2013, 6:18:59 PM6/7/13
to example42-pu...@googlegroups.com
Tried the way you just wrote, results doesn't change. The fact is, the modules are available via the php command but not on php-fpm configuration... trying some more runs and different parameters now...

Luca Degasperi

unread,
Jun 9, 2013, 6:11:01 AM6/9/13
to example42-pu...@googlegroups.com
II digged deeper into the problem, at the first start the modules aren't installed because the .ini files of the different modules are not loaded.

the /etc/php5/fpm/conf.d/  directory contains the appropriate ini files but nor php-fpm or php-cli appear to load thoose files at the first start. how can I solve this issue?
Reply all
Reply to author
Forward
0 new messages