Puppet/FAQ

Материал из ALT Linux Wiki
Перейти к: навигация, поиск
Stub.png
Данная страница находится в разработке.
Эта страница ещё не закончена. Информация, представленная здесь, может оказаться неполной или неверной.


ЧаВО по теме Puppet[править]

В: Почему при запуске службы Puppet у меня вылезают ошибки при получении статуса службы (**systemctl status puppet**):

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node dno.office.basealt.ru: Exception while executing '/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb': Cannot run program "/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb" (in directory "."): error=2, No such file or directory
Could not retrieve catalog; skipping run

О: Отстствует модуль puppet-а называемый theforeman-foreman, установие его так:

# apt-get install puppet-theforeman-foreman

В: Почему при запуске службы Puppet у меня вылезают предупреждения при получении статуса службы (**systemctl status puppet**):

Unable to fetch my node definition, but the agent run will continue:
Error 500 on SERVER: Server Error: Failed to find dno.office.basealt.ru via exec: Execution of '/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb dno.office.basealt.ru' returned 1:
Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node dno.office.basealt.ru: Failed to find dno.office.basealt.ru via exec: Execution of '/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb dno.office.basealt.ru' returned 1:
Could not retrieve catalog; skipping run

О: Ваш foreman не настроен для работы с текущей конфигурацией puppet, вам нужно отключить службу внешних узлов в **/etc/puppet/puppet.conf** так:

 # external_nodes = /usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb
 # node_terminus = exec

и перезапустить puppet после перезапуска puppetserver. После чего при необходимости установите facter настройте Foreman и Smart-proxy


В: При запуске puppet с ключём apply и манифестом site вылезает ошибка о невозможности соединиться с сервером foreman:

# puppet apply /etc/puppet/environments/production/manifests/site.pp
/usr/lib/ruby/gems/2.7.0/gems/facter-2.5.7.1/lib/facter/ec2/rest.rb:28: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
Warning: Facter: Error loading fact /usr/lib/puppet-modules/theforeman-foreman/lib/facter/sssd.rb: cannot load such file -- facter/util/sssd
/usr/lib/ruby/gems/2.7.0/gems/facter-2.5.7.1/lib/facter/ec2/rest.rb:28: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
/usr/lib/ruby/gems/2.7.0/gems/facter-2.5.7.1/lib/facter/ec2/rest.rb:28: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
Notice: Compiled catalog for dno.office.basealt.ru in environment production in 0.03 seconds
Notice: /Stage[main]/Main/File[/etc/passwd]/group: group changed 'root' to 'bin'
Notice: Applied catalog in 0.06 seconds
Error: Report processor failed: Could not send report to Foreman at http://dno.office.basealt.ru:2345/api/config_reports: Failed to open TCP connection to dno.office.basealt.ru:2345 (Connection refused -  connect(2) for "dno.office.basealt.ru" port 2345)
["/usr/lib/ruby/net/http.rb:960:in `initialize'", "/usr/lib/ruby/net/http.rb:960:in `open'", "/usr/lib/ruby/net/http.rb:960:in `block in connect'", "/usr/lib/ruby/timeout.rb:95:in `block in timeout'", "/usr/lib/ruby/timeout.rb:105:in `timeout'", "/usr/lib/ruby/net/http.rb:958:in `connect'", "/usr/lib/ruby/net/http.rb:943:in `do_start'", "/usr/lib/ruby/net/http.rb:932:in `start'", "/usr/lib/ruby/net/http.rb:1483:in `request'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/reports/foreman.rb:69:in `process'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/indirector/report/processor.rb:37:in `block in process'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/indirector/report/processor.rb:54:in `block in processors'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/indirector/report/processor.rb:51:in `each'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/indirector/report/processor.rb:51:in `processors'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/indirector/report/processor.rb:30:in `process'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/indirector/report/processor.rb:14:in `save'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/indirector/indirection.rb:316:in `save'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/configurer.rb:476:in `send_report'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/configurer.rb:452:in `run_internal'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/configurer.rb:246:in `run'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/application/apply.rb:342:in `apply_catalog'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/application/apply.rb:254:in `block in main'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/context.rb:62:in `override'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet.rb:306:in `override'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/application/apply.rb:208:in `main'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/application/apply.rb:178:in `run_command'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/application.rb:421:in `block in run'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/util.rb:735:in `exit_on_fail'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/application.rb:421:in `run'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/util/command_line.rb:143:in `run'", "/usr/lib/ruby/gems/2.7.0/gems/puppet-7.3.0/lib/puppet/util/command_line.rb:77:in `execute'", "/usr/bin/puppet:5:in `<main>'"]

О: Настроить foreman и запустить его службу.



В: У меня при запуске

puppet agent -t

вылезает ошибка:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node predvridlo.office.basealt.ru: Failed to find predvridlo.office.basealt.ru via exec:  Execution of '/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb predvridlo.office.basealt.ru' returned 1: 
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

А при прямом запуске node.rb:

# /usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb predvridlo.office.basealt.ru
predvridlo.office.basealt.ru: During the fact upload the server responded with: 403 Forbidden. Error is ignored and the execution continues.
{
  "error": {"message":"Access denied","details":"Missing one of the required permissions: upload_facts","missing_permissions":["upload_facts"]}
}
Error retrieving node predvridlo.office.basealt.ru: Net::HTTPForbidden
Check Foreman's /var/log/foreman/production.log for more information.

Как лечить?

О: Вам необходимо добавить значение имена машины, с которой производится запуск, в доверенные хосты (trusted hosts), которые находятся на странице форемана в Администратор -> Параметры -> Безопасность и проверка подлинности.


В: У меня при запуске

puppet agent -t

выдается ошибка:

#puppet agent -t
WARN: Unresolved specs during Gem::Specification.reset:
      scanf (~> 1.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 500 on SERVER: Server Error: Exception while executing '/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb': Cannot run program "/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb" (in directory "."): error=2, No such file or directory
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node sample.server.name: Exception while executing '/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb': Cannot run program "/usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb" (in directory "."): error=2, No such file or directory
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

О: Причина в том, что не может запуститься скрипт конфигурации подключаемых хостов для foreman

Закомметируйте строки в файле /etc/puppet/puppet.conf

#  external_nodes = /usr/lib/puppet-modules/theforeman-foreman/files/external_node_v2.rb
#  node_terminus = exec

После изменений перезапустите puppetserver