2015-11-19 2 views
0

Я пытаюсь установить узел на новый бродячий бокс, используя марионетку, однако при запуске манифеста я получаю следующие ошибки на коробке.Настройка nodejs с использованием марионетки на бродяге

Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults 
Warning: Scope(Apt::Source[nodesource]): $include_src is deprecated and will be removed in the next major release, please use $include => { 'src' => false } instead 
Warning: Scope(Apt::Source[nodesource]): $required_packages is deprecated and will be removed in the next major release, please use package resources instead. 
Warning: Scope(Apt::Source[nodesource]): $key_source is deprecated and will be removed in the next major release, please use $key => { 'source' => https://deb.nodesource.com/gpgkey/nodesource.gpg.key } instead. 
Warning: Scope(Apt::Key[Add key: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 from Apt::Source nodesource]): $key_source is deprecated and will be removed in the next major release. Please use $source instead. 
Error: undefined method `ref' for nil:NilClass on node vagrant-ubuntu-trusty-64.efiling.local 
Error: undefined method `ref' for nil:NilClass on node vagrant-ubuntu-trusty-64.efiling.local 

Мой бродяга файл выглядит следующим образом:

config.vm.provision :shell do |shell| 
    shell.inline = "mkdir -p /etc/puppet/modules; 
        puppet module install puppetlabs-apt; 
        puppet module install puppetlabs/nodejs" 
    end 

    config.vm.provision "puppet" do |puppet| 
    puppet.manifests_path = "manifests" 
    puppet.manifest_file = "default.pp" 
    end 

Это мой файл манифеста:

class { 'nodejs': } 

Следующая часть, чтобы получить бродягу, чтобы запустить файл манифеста, но я считаю, что эти ошибки останавливают это.

Это все относительно новое для меня, так что вы ищете какое-то руководство по этой проблеме.

ответ

1

вы должны заменить puppetlabs/nodejs на puppetlabs-nodejs так что ваш Vagrantfile будет выглядеть

config.vm.provision :shell do |shell| 
    shell.inline = "mkdir -p /etc/puppet/modules; 
        puppet module install puppetlabs-apt; 
        puppet module install puppetlabs-nodejs" 
    end 

Какую версию кукольный вы используете? Я должен был перейти на новую версию на моем Ubuntu поле, чтобы заставить его работать, я обновить кукольный v3.8.4, чтобы заставить его работать - смотрите ниже журнале

==> default: Running provisioner: puppet... 
==> default: Running Puppet with default.pp... 
==> default: stdin: is not a tty 
==> default: Warning: Setting templatedir is deprecated. See http://links.puppetlabs.com/env-settings-deprecations 
==> default: (at /usr/lib/ruby/vendor_ruby/puppet/settings.rb:1139:in `issue_deprecation_warning') 
==> default: Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults 
==> default: Warning: Scope(Apt::Source[nodesource]): $include_src is deprecated and will be removed in the next major release, please use $include => { 'src' => false } instead 
==> default: Warning: Scope(Apt::Source[nodesource]): $required_packages is deprecated and will be removed in the next major release, please use package resources instead. 
==> default: Warning: Scope(Apt::Source[nodesource]): $key_source is deprecated and will be removed in the next major release, please use $key => { 'source' => https://deb.nodesource.com/gpgkey/nodesource.gpg.key } instead. 
==> default: Warning: Scope(Apt::Key[Add key: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 from Apt::Source nodesource]): $key_source is deprecated and will be removed in the next major release. Please use $source instead. 
==> default: Notice: Compiled catalog for ubuntu.localdomain in environment production in 0.71 seconds 
==> default: Notice: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]/ensure: defined content as '{md5}0962d70c4ec78bbfa6f3544ae0c41974' 
==> default: Notice: /Stage[main]/Apt/File[preferences]/ensure: created 
==> default: Notice: /Stage[main]/Nodejs::Repo::Nodesource/Nodejs::Repo::Nodesource::Apt/Apt::Source[nodesource]/Apt::Key[Add key: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 from Apt::Source nodesource]/Apt_key[Add key: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280 from Apt::Source nodesource]/ensure: created 
==> default: Notice: /Stage[main]/Nodejs::Repo::Nodesource/Nodejs::Repo::Nodesource::Apt/Apt::Source[nodesource]/Apt::Setting[list-nodesource]/File[/etc/apt/sources.list.d/nodesource.list]/ensure: created 
==> default: Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: E: The method driver /usr/lib/apt/methods/https could not be found. 
==> default: Error: /Stage[main]/Apt::Update/Exec[apt_update]: Failed to call refresh: /usr/bin/apt-get update returned 100 instead of one of [0] 
==> default: Error: /Stage[main]/Apt::Update/Exec[apt_update]: /usr/bin/apt-get update returned 100 instead of one of [0] 
==> default: Notice: /Stage[main]/Nodejs::Install/Package[nodejs]/ensure: ensure changed 'purged' to 'present' 
==> default: Notice: Finished catalog run in 29.83 seconds 
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. 
[email protected]:~/project/examples/vagrant/ubuntu$ vagrant ssh 
Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-virtual x86_64) 

* Documentation: https://help.ubuntu.com/ 
Last login: Thu Nov 19 06:46:10 2015 from 172.16.42.1 
[email protected]:~$ node -v 
v0.6.12 
+0

Получая ту же проблему, я уничтожил коробку и побежал бодро. Командная строка подтвердила, что новый пакет был установлен - ==> default:/etc/puppet/modules ==> default: puppetlabs-nodejs (v0.8.0) –

+0

, какую версию марионетки вы используете? –

+0

Я бегу 3.4.3, рассмотрю обновление марионеточной версии и посмотрю, что произойдет, хотя я также разместил другое решение. Что может быть или не быть лучшим способом. –

0

--- Это альтернативный метод

Это заняло некоторое время, чтобы устранить ошибку, но лучший подход, который я нашел для установки узла на сервере через марионетку, - запустить ручную установку через марионетку.

Я нашел это repo и взял то, что мне нужно из файла манифеста.

class apt_update { 
    exec { "aptGetUpdate": 
     command => "sudo apt-get update", 
     path => ["/bin", "/usr/bin"] 
    } 
} 

class othertools { 
    package { "git": 
     ensure => latest, 
     require => Exec["aptGetUpdate"] 
    } 

    package { "vim-common": 
     ensure => latest, 
     require => Exec["aptGetUpdate"] 
    } 

    package { "curl": 
     ensure => present, 
     require => Exec["aptGetUpdate"] 
    } 

    package { "htop": 
     ensure => present, 
     require => Exec["aptGetUpdate"] 
    } 

    package { "g++": 
     ensure => present, 
     require => Exec["aptGetUpdate"] 
    } 
} 

class nodejs { 
    exec { "git_clone_n": 
    command => "git clone https://github.com/visionmedia/n.git /home/vagrant/n", 
    path => ["/bin", "/usr/bin"], 
    require => [Exec["aptGetUpdate"], Package["git"], Package["curl"], Package["g++"]] 
    } 

    exec { "install_n": 
    command => "make install", 
    path => ["/bin", "/usr/bin"], 
    cwd => "/home/vagrant/n", 
    require => Exec["git_clone_n"] 
    } 

    exec { "install_node": 
    command => "n stable", 
    path => ["/bin", "/usr/bin", "/usr/local/bin"], 
    require => [Exec["git_clone_n"], Exec["install_n"]] 
    } 
} 

include apt_update 
include othertools 
include nodejs 
Смежные вопросы