2016-04-25 7 views
1

Zuvor hatte ich eine ähnliche Konfiguration zu dieser Arbeit, aber sobald ich hiera zu meinem Puppet Build hinzugefügt habe, begann ich Probleme zu haben. Der Fehler habe ich zur Zeit nach vagrant provision läuft wie folgt:Node.js Modul wird nicht neu installiert mit Puppet/Vagrant

==> default: [vagrant-hostsupdater] Checking for host entries 
==> default: [vagrant-hostsupdater] found entry for: 192.168.33.10 local.mysite 
==> default: Configuring cache buckets... 
==> default: Running provisioner: puppet... 
==> default: Running Puppet with app.pp... 
==> default: stdin: is not a tty 
==> default: Error: Could not find class nodejs for local.mysite on node local.mysite 
==> default: Error: Could not find class nodejs for local.mysite on node local.mysite 
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. 

Meine vagrant config:

# -*- mode: ruby -*- 
# vi: set ft=ruby : 
require "yaml" 

# Load yaml configuration 
config_file = "#{File.dirname(__FILE__)}/config/vm_config.yml" 
default_config_file = "#{File.dirname(__FILE__)}/config/.vm_config_default.yml" 

vm_external_config = YAML.load_file(config_file) 

# Configure Vagrant 
Vagrant.configure("2") do |config| 
    config.vm.box = "ubuntu/trusty64" 

    config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" 

    config.vm.network :private_network, ip: vm_external_config["ip"] 
    config.vm.hostname = vm_external_config["hostname"] 
    config.vm.network "forwarded_port", guest: vm_external_config["port"], host: 2368 

    config.vm.synced_folder vm_external_config["ghost_path"], "/var/www/mysite.com", :nfs => true 

    config.vm.provider :virtualbox do |vb| 
    vb.customize ["modifyvm", :id, "--memory", vm_external_config["memory"]] 
    end 

    config.cache.scope = :box 

    config.librarian_puppet.placeholder_filename = ".gitkeep" 

    config.vm.provision :puppet do |puppet| 
    puppet.hiera_config_path = "puppet/hiera/hiera.yaml" 
    puppet.manifests_path = "puppet/manifests" 
    puppet.manifest_file = "app.pp" 
    puppet.module_path = "puppet/modules" 
    puppet.facter = { 
     "environment" => ENV['ENV'] ? ENV['ENV'] : 'local' 
    } 
    end 
end 

Mein Quellbaum wie so aussieht (viel davon ist nicht relevant, abgesehen von der Ordner-Struktur für das benutzerdefinierte Blog-Modul und hiera config):

├── Vagrantfile 
├── config 
│   └── vm_config.yml 
└── puppet 
    ├── Puppetfile 
    ├── hiera 
    │   ├── common.yaml 
    │   ├── hiera.yaml 
    │   ├── local 
    │   │   └── site.yaml 
    │   └── production 
    │    └── site.yaml 
    ├── manifests 
    │   └── app.pp 
    └── modules 
     ├── blog 
     │   └── manifests 
     │    └── app.pp 
     ├── ghost 
     │   └── manifests 
     │    └── app.pp 
     ├── init.d 
     │   └── files 
     │    ├── WebhookServer 
     │    └── ghost 
     ├── mailgunner 
     ├── nginx 
     │   ├── files 
     │   │   ├── local 
     │   │   │   ├── mysite.com 
     │   │   │   └── mail.mysite.com 
     │   │   └── production 
     │   │    ├── mysite.com 
     │   │    └── mail.mysite.com 
     │   └── manifests 
     │    └── server.pp 
     ├── tools 
     │   ├── files 
     │   │   ├── local 
     │   │   │   ├── backup.sh 
     │   │   │   ├── ghostsitemap.sh 
     │   │   │   └── init-mysite.sh 
     │   │   └── production 
     │   │    ├── backup.sh 
     │   │    ├── ghostsitemap.sh 
     │   │    └── init-mysite.sh 
     │   └── manifests 
     │    └── install.pp 
     └── webhooks 
      ├── files 
      │   ├── local 
      │   │   └── init-webhook.sh 
      │   ├── production 
      │   │   └── init-webhook.sh 
      │   ├── webhook.sh 
      │   └── webhooks.rb 
      └── manifests 
       └── install.pp 

hiera.yaml:

--- 
:backends: 
    - yaml 

:yaml: 
    :datadir: /vagrant/hieradata 

:hierarchy: 
    - "%{::environment}/site 
    - common 

common.yaml

-- 
classes: 
    - site 

local/site.yaml

-- 
:site: 
    environment: local 
    name: local.mysite 
    mailserver: local.mail.mysite 

Blog/Manifeste/app.pp

class blog::app { 

    class { 'nodejs': 
    version => 'v0.10.25', 
    } -> 
    package { 'pm2': 
    ensure => present, 
    provider => 'npm', 
    require => Class['nodejs'], 
    } 
} 

Puppetfile

forge 'https://forgeapi.puppetlabs.com' 

mod 'willdurand/nodejs', '1.9.4' 

Grundsätzlich mein Problem ist, dass meine Puppe installieren nicht NodeJS Neuinstallation (hatte ich es vorher entfernt unter Verwendung eines rm -rf puppet/modules/nodejs)

Hat jemand irgendwelche Ideen, wie oder warum Puppen jetzt weigert sich die NodeJS Puppen Modul in der Installation Puppen-/Modulverzeichnis?

FYI - Ich habe die willdurand installiert/NodeJS Modul puppet module install willdurand/nodejs

Jede Hilfe sehr geschätzt wird - ich habe meinen Kopf gegen eine Mauer auf diese für ein paar Tage nun hämmern!

+0

scheint Sie Bibliothekar verwenden, so können Sie bestätigen, dass Sie haben das Plugin ' vagrant-librarian-puppet installiert –

+0

Hallo Frédéric - können Sie bitte darauf erweitern? –

+0

Ich bin sehr viel Erstbenutzer Marionette. Ich habe an der Bucheinführung von Puppet 3 von John Arundel gearbeitet, aber ein Großteil der Arbeit wurde aus skizzenhaften Beispielen aus dem Internet und anderen GitHub-Beispielen zusammengestellt. Es ist also durchaus möglich, dass ich meine Kabel gekreuzt habe –

Antwort

1

Die Puppetfile wird von der Vagrant-Bibliothekar-Puppe verwendet, um Ihr Puppenmodul zu installieren, damit es installiert werden sollte.

Stellen Sie sicher, das Plugin installiert ist

$ vagrant plugin list 
vagrant-librarian-puppet (0.9.2) 
.... 

Wenn Sie das Plugin nicht sehen, stellen Sie sicher, es zu installieren

$ vagrant plugin install vagrant-librarian-puppet 
+0

Danke Ich glaube, ich habe das getan, aber ich werde es überprüfen, wenn ich zu Hause bin. Aus Interesse muss ich noch Puppenmodule manuell installieren, z. 'Puppet-Modul installieren willdurand/nodejs'? Oder wird der Vagabund-Puppenbibliothekar das für mich tun? –

+0

nein die Idee mit Bibliothekar ist, dass es es für Sie tun wird - Sie setzen alle Ihre notwendigen Module und es wird die Installation Marionette Module für Sie vor jeder Bereitstellung ausgeführt wird.weiter gehend, persönlich bevorzuge ich immer noch ein Shell-Skript, das die Puppet-Module installiert, da es nicht auf ein weiteres Plugin auf der Workstation meiner Teammitglieder angewiesen ist, aber es ist eine Frage des Geschmacks und wie Sie es verwenden –

+0

Okay - I Ich denke, mein Problem ist, dass ich die Bibliothek manuell installiert habe und sie nicht installieren wird, weil sie glaubt, dass sie existiert. Ich werde versuchen, es zu deinstallieren und den vagrant Bereitstellungsschritt erneut auszuführen, um zu bestätigen - danke –

Verwandte Themen