0

I was studing puppet and running the manifests happened without a problem but when I added modules to puppet I run into the following issue:


DEBUG ssh: Exit status: 0 INFO interface: info: Running Puppet with db.pp... INFO interface: info: ==> db: Running Puppet with db.pp... ==> db: Running Puppet with db.pp... DEBUG ssh: Re-using SSH connection. INFO ssh: Execute: puppet apply --verbose --debug --modulepath '/tmp/vagrant-puppet/modules-9f098f5eef3eb89ba69e9481e2fa4839:/etc/puppet/modules' --detailed-exitcodes --manifestdir /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513 /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/db.pp (sudo=true) DEBUG ssh: stderr: stdin: is not a tty

INFO interface: info: stdin: is not a tty INFO interface: info: ==> db: stdin: is not a tty ==> db: stdin: is not a tty DEBUG ssh: stdout: warning: Could not retrieve fact fqdn INFO interface: info: warning: Could not retrieve fact fqdn INFO interface: info: ==> db: warning: Could not retrieve fact fqdn ==> db: warning: Could not retrieve fact fqdn DEBUG ssh: stdout:

DEBUG ssh: stderr: Could not find class msql-server for precise32 at /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/db.pp:59 on node precise32 INFO interface: info: Could not find class msql-server for precise32 at /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/db.pp:59 on node precise32 INFO interface: info: ==> db: Could not find class msql-server for precise32 at /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/db.pp:59 on node precise32 ==> db: Could not find class msql-server for precise32 at /tmp/vagrant-puppet/manifests-a11d1078b1b1f2e3bdea27312f6ba513/db.pp:59 on node precise32


Aparently Vagrant is not using modules as described in this vagrant file (in the db machine section):

Vagrant.configure(2) do |config|


config.vm.box = "hashicorp/precise32"
  config.vm.define :db do |db_config|
    db_config.vm.network :private_network,
                         :ip => "192.168.33.10"
    db_config.vm.provision "puppet" do |puppet|
        puppet.module_path = "modules"
        puppet.manifest_file = "db.pp"
        puppet.options = "--verbose --debug"
    end
  end

  config.vm.define :web do |web_config|
    web_config.vm.network :private_network,
                          :ip => "192.168.33.12"
    web_config.vm.provision "puppet" do |puppet|
        puppet.module_path = "modules"
        puppet.manifest_file = "web.pp"
    end
  end

  config.vm.define :monitor do |monitor_config|
    monitor_config.vm.network :private_network,
                              :ip => "192.168.33.14"
  end
end

Any clue on what's going on?

EDITED

I was able to figure out... it was a sintax issue in puppet. But now I have another issue

::Resource failed with error ArgumentError: Invalid resource type msql::db

The resource type is used in the manifest:

include mysql::server

msql::db { "loja":   schema   => "loja_schema",   password => "xxxx", }

The definition is bellow:

define mysql::db($schema, $user = $title, $password) {
  #Dependência
  Class['mysql::server'] -> Mysql::db[$title]

  exec { "$title-schema":
    unless  => "mysql -uroot $schema",
    command => "mysqladmin -uroot create $schema",
    path  => "/usr/bin/",
  }

  exec {"$title-user":
    unless  => "mysql -u$user -p$password $schema",
    command => "mysql -uroot -e \"GRANT ALL PRIVILEGES ON \
                                  $schema.* TO '$user'@'%' \
                                  IDENTIFIED BY '$password';\"",
    path    => "/usr/bin/",
    require => Exec["$title-schema"],
  }
}
  • you need to be sure puppet.module_path point to an existing directory, If you have /home/pippo/vagrant/fedora22/Vagrantfile with your config you need to have your puppet modules installed in /home/pippo/vagrant/fedora/modules – c4f4t0r Jan 02 '16 at 09:56
  • Yes... I did that. My directory is with the following folders and files: README.md allow_external.cnf loja_virtual.cfg modules tomcat.xml Vagrantfile context.xml manifests tomcat tomcat7 – Fernanda Martins Jan 02 '16 at 19:33
  • @FernandaMartins could you post the cause/solution to your original issue as an answer? For the new problem, please open a new Question. Thanks! – Felix Frank Jan 04 '16 at 14:19

1 Answers1

0

The problem was solved by including module's classes into the manifest file pointed by Vagrant.

Example:

Inside manifests/db.pp add:

include <module name>::<class name>