Eu estava seguindo este guia para criar um fantoche sem mestre máquina que poderia usar o fantoche para gerenciar a si mesmo (de uma forma que me deixaria adicionar nós e usá-lo como o mestre mais tarde, mas isso é irrelevante agora). E eu tenho um módulo básico configurado que deve verificar se o nginx está instalado e um arquivo de configuração do site está lá. Mas quando executo o ambiente usando sudo r10k deploy environment -p -v
, parece atualizar tudo, mas o módulo não parece estar sendo executado corretamente.
Meu módulo pode ser encontrado aqui , e meu repo de controle pode ser encontrado aqui .
Meu módulo está estruturado errado? Estou faltando alguma coisa aqui? É porque quando eu verifico o status do serviço de marionetes usando sudo service puppet status
ele gera alguns erros com o meu arquivo heira.yaml
?
● puppet.service - Puppet agent
Loaded: loaded (/lib/systemd/system/puppet.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-02-22 23:07:06 UTC; 3min 0s ago
Main PID: 19319 (puppet)
Tasks: 2 (limit: 4915)
CGroup: /system.slice/puppet.service
└─19319 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/puppet agent --no-daemonize
Feb 22 23:07:06 puppeteer systemd[1]: Started Puppet agent.
Feb 22 23:07:07 puppeteer puppet-agent[19319]: Starting Puppet client version 5.4.0
Feb 22 23:07:09 puppeteer puppet-agent[19327]: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'classes' failed: The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 0 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]: The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 1 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]: The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, entry 'hierarchy' index 2 expects a Struct value, got String
Feb 22 23:07:09 puppeteer puppet-agent[19327]: The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, unrecognized key 'backends'
Feb 22 23:07:09 puppeteer puppet-agent[19327]: The Lookup Configuration at '/etc/puppetlabs/puppet/hiera.yaml' has wrong type, unrecognized key 'yaml' (file: /etc/puppetlabs/code/environments/production/site.pp, line: 1, column: 1) on node puppeteer.c.personal-server-193919.internal
Feb 22 23:07:09 puppeteer puppet-agent[19327]: Applied catalog in 0.03 seconds
Conteúdo de heira.yaml
:
---
# Hiera 5 Global configuration file
version: 5
# defaults:
# data_hash: yaml_data
# hierarchy:
# - name: Common
# data_hash: yaml_data
#hierarchy: [] (tried with and without this commented out)
:backends:
- yaml
:hierarchy:
- "%{clientcert}"
- "%{environment}"
- global
:yaml:
:datadir: '/etc/puppetlabs/puppet/environmets/%{environment}/hieradata'