puppet-dashboard: не удалось получить факты из службы инвентаризации

Я пытаюсь настроить puppet-dashboard, и у меня возникает проблема с инвентаризацией / фактами:

Could not retrieve facts from inventory service: 403 "Forbidden request: puppetmasterhostname(ip.address.was.here) access to /facts/agenthostname.example.com [find] at line 99 "

В /etc/puppet/auth.conf о мастере кукол:

path /facts
method find
auth any
allow *

Я перезапустил puppetmaster и puppet-dashboard, но все равно получаю вышеуказанную ошибку. Есть идеи или советы по устранению неполадок?

ОБНОВИТЬ

Я бегу кукольный v2.7.13. В соответствии с просьбой, вот мой полный /etc/puppet/auth.conf. Большинство из них по умолчанию, которые уже были в конфигурации:

# allow nodes to retrieve their own catalog (ie their configuration)
path ~ ^/catalog/([^/]+)$
method find
allow $1

# allow nodes to retrieve their own node definition
path ~ ^/node/([^/]+)$
method find
allow $1

# allow all nodes to access the certificates services
path /certificate_revocation_list/ca
method find
allow *

# allow all nodes to store their reports
path /report
method save
allow *

# inconditionnally allow access to all files services
# which means in practice that fileserver.conf will
# still be used
path /file
allow *

### Unauthenticated ACL, for clients for which the current master doesn't
### have a valid certificate; we allow authenticated users, too, because
### there isn't a great harm in letting that request through.

# allow access to the master CA
path /certificate/ca
auth any
method find
allow *

path /certificate/
auth any
method find
allow *

path /certificate_request
auth any
method find, save
allow *

# this one is not stricly necessary, but it has the merit
# to show the default policy which is deny everything else
path /
auth any

# Inventory
path /facts
method find
auth any
allow *

/etc/puppet/puppet.conf

[main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig

[master]
   reports = store, http
   reporturl = http://puppetmasterhostname.example.com:3000/reports/upload
   facts_terminus = yaml
   storeconfigs = true
   storeconfigs_backend = puppetdb
   node_terminus = exec
   external_nodes = /usr/bin/env PUPPET_DASHBOARD_URL=http://localhost:3000 /opt/puppet-dashboard/bin/external_node

4 ответа

Решение

Мой конфиг имеет следующее...

path /facts
auth any
allow *

path /fact
auth any
allow *

path /facts_search
allow *

Я думаю, что я также должен был создать пустой файл с именем namespaceauth.conf вот так;

touch /etc/puppet/namespaceauth.conf

У меня была та же проблема, и я обнаружил, что строка 99 в /etc/puppet/auth.conf соответствует следующему:

# this one is not stricly necessary, but it has the merit
# to show the default policy which is deny everything else
path /
auth any

Комментируя path / а также auth any разрешил Dashboard получить доступ к инвентарю, используя следующую конфигурацию:

path /facts
auth yes
method find, search
allow dashboard

... взято с http://docs.puppetlabs.com/dashboard/manual/1.2/configuring.html.

namespace.conf и другие пути не были необходимы для меня.

Это проблема заказа - убедитесь, что раздел:

path /facts
method find
auth any
allow *

ДО раздела по умолчанию:

# this one is not stricly necessary, but it has the merit
# to show the default policy which is deny everything else
path /
auth any

Это сработало + решило проблему для меня. Или, как указано выше, вы можете просто закомментировать это!

Проблема, которую вы имеете, имеет две стороны. Во-первых, ваш файл auth.conf должен иметь правильный доступ. Многие из упомянутых здесь решений достигают этого, но с большим риском! Используя следующее:

path /facts
auth any
allow *

path /fact
auth any
allow *

path /facts_search
allow *

... вы разрешаете * доступ

"звездочка" означает ВСЕХ!!!

Чтобы решить эту проблему, вам нужен файл auth.conf:

path /facts
auth yes
method find, search
allow dashboard

Затем вам нужно создать сертификаты для пользователя "приборной панели", так же, как вы делаете для узлов. На CentOS 6 с puppet-dashboard-1.2.23-1.el6.noarch эти шаги:

1) убедитесь, что config/settings.yml имеет правильное имя хоста и порт для вашего puppetmaster

2) создать вашу пару ключей для панели инструментов:

    sudo -u puppet-dashboard rake cert:create_key_pair

3) сгенерировать запрос на сертификат для панели инструментов:

sudo -u puppet-dashboard rake cert:request

4) на марионетке подписать сертификат:

    puppet cert sign dashboard

5) получить сертификат от мастера кукловодства

    sudo -u puppet-dashboard rake cert:retrieve

6) перезагрузить приборную панель

Все это позволит панели управления получать доступ к фактам вашего puppetmaster с помощью сертификата аутентификации.

Наслаждайтесь!

Другие вопросы по тегам