mongodbvirtualboxpuppetpuphpetvagrant-windows

puPHPet + puppet + puppetlabs/mongodb


I tried to install ubuntu 16.04 by puPHPet. But confronted with following problems with mongodb there: I have updated puppetlabs/mongodb module to actual version 0.16, but mongo wasn't installed because apt-get can't install from unauthorized sources by default. I modify mongodb/install.pp:

  if ! defined(Package['mongodb-org-tools']) {
    package {'mongodb-org-tools':
      require => Class['mongodb::client'],
      install_options => ['--allow-unauthenticated', '-f']
    }
  }

Then it was installed perfectly on linux machine. But it stiil doesn't work when host OS is win10. Here is a piece of log:

Info: /Stage[main]/Mongodb::Server::Config/File[/etc/mongod.conf]: Filebucketed /etc/mongod.conf to puppet with sum 2f77cad9cf008f0d1cba3ab00e6f201b
Notice: /Stage[main]/Mongodb::Server::Config/File[/etc/mongod.conf]/content: content changed '{md5}2f77cad9cf008f0d1cba3ab00e6f201b' to '{md5}27a1615781754ebd40a4f2afee063b10'
Notice: /Stage[main]/Mongodb::Server::Config/File[/var/run/mongod.pid]/ensure: created
Info: Class[Mongodb::Server::Config]: Scheduling refresh of Class[Mongodb::Server::Service]
Info: Class[Mongodb::Server::Service]: Scheduling refresh of Service[mongodb]
Notice: /Stage[main]/Mongodb::Server::Service/Service[mongodb]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Mongodb::Server::Service/Service[mongodb]: Unscheduling refresh on Service[mongodb]
     Notice: Failed to connect to mongodb within timeout window of 240 seconds; giving up.
Info: Class[Mongodb::Server::Service]: Unscheduling all events on Class[Mongodb::Server::Service]
Notice: /Stage[main]/Mongodb::Server/Anchor[mongodb::server::end]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Notice: /Stage[main]/Mongodb::Client/Anchor[::mongodb::client::start]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Notice: /Stage[main]/Mongodb::Client::Install/Package[mongodb_client]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Notice: /Stage[main]/Mongodb::Client/Anchor[::mongodb::client::end]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Notice: /Stage[main]/Puphpet::Mongodb::Install/Package[mongodb-org-tools]: Dependency Mongodb_conn_validator[mongodb] has failures: true
Error: Unable to connect to mongodb server! (127.0.0.1:27017)
Error: /Stage[main]/Mongodb::Server::Service/Mongodb_conn_validator[mongodb]/ensure: change from absent to present failed: Unable to connect to mongodb server! (127.0.0.1:27017)
Warning: /Stage[main]/Mongodb::Server/Anchor[mongodb::server::end]: Skipping because of failed dependencies
Warning: /Stage[main]/Mongodb::Client/Anchor[::mongodb::client::start]: Skipping because of failed dependencies
Warning: /Stage[main]/Mongodb::Client::Install/Package[mongodb_client]: Skipping because of failed dependencies
Warning: /Stage[main]/Mongodb::Client/Anchor[::mongodb::client::end]: Skipping because of failed dependencies
Warning: /Stage[main]/Puphpet::Mongodb::Install/Package[mongodb-org-tools]: Skipping because of failed dependencies
...
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.

And here is peace of my config.yaml:

provider:
    local:
        box: puphpet/ubuntu1604-x64
        box_url: puphpet/ubuntu1604-x64
        box_version: '0'
        chosen_virtualizer: virtualbox

...

mongodb:
    install: '1'
    settings:
        bind_ip: ['127.0.0.1', '192.168.10.10']
        port: '27017'
    globals:
        version: '3.4.0'

databases: { }

Oh, now I realized, that the same problem with postgress

What's wrong with my config or win10 ?

Thank you.


Solution

  • I solve it. It's a trouble, because of folder sharing. If you map your var/log folder to host machine - its not possible to change permission of this folder. Because of it mongodb can not write to log.