chef-solo ssl advertencia al aprovisionar


Al usar vagrant y chef como proveedor, tengo esta advertencia:

[web] Chef 11.12.2 Omnibus package is already installed.
[web] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
stdin: is not a tty
[2014-04-10T14:48:46+00:00] INFO: Forking chef instance to converge...
[2014-04-10T14:48:46+00:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

```
  # Verify all HTTPS connections (recommended)
  ssl_verify_mode :verify_peer

  # OR, Verify only connections to chef-server
  verify_api_cert true
```

To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

```
  knife ssl check -c /tmp/vagrant-chef-1/solo.rb
```

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Sería bueno saber qué tipo de configuración requiere chef en Vagrantfile para solucionar este problema.

Author: holms, 2014-04-10

3 answers

Esta advertencia se introdujo en Chef 11.12.0. Vea las notas de la versión para más detalles:

Cuando ssl_verify_mode se establece en :verify_none, Chef imprimirá un advertencia. Use knife ssl check para probar la conectividad SSL y luego agregue ssl_verify_mode :verify_peer a su archivo de configuración para arreglar advertencia. Aunque :verify_none es actualmente el valor predeterminado, esto será cambiado en una versión futura, por lo que se anima a los usuarios a ser proactivos en probando y actualizando su configuración SSL.

Para corregir esta advertencia en Vagrant, debe modificar el archivo de configuración solo.rb que crea en la máquina virtual. Con Vagrant puedes usar el custom_config_path opción para eso.

Por lo tanto, puede modificar su Vagrantfile de la siguiente manera:

Vagrant.configure("2") do |config|
  config.vm.provision "chef_solo" do |chef|
    # the next line is added
    chef.custom_config_path = "Vagrantfile.chef"
  end
end

Esto hace que Vagrant incluya el contenido del archivo local Vagrantfile.chef en el solo generado.rb, por lo tanto, el archivo debe estar presente en su sistema host, no en la máquina virtual.

Luego, crea un nuevo archivo Vagrantfile.chef en el directorio donde también guardas tu Vagrantfile con el siguiente contenido:

Chef::Config.ssl_verify_mode = :verify_peer

La siguiente ejecución de vagrant provision ya no debería imprimir la advertencia.

 47
Author: Holger Just,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-01-27 19:04:14

Tuve este problema al trabajar con test-kitchen.

Si ese también es el caso para usted, tenga en cuenta que este valor también se puede configurar directamente dentro de .kitchen.yml.

Si su bloque provisioner estándar se ve así:

provisioner:
  name: chef_solo

Simplemente puede agregar la tecla solo_rb con la opción ssl_verify_mode:

provisioner:
  name: chef_solo
  solo_rb:
    ssl_verify_mode: verify_peer

Y el solo generado.rb tendrá esta opción.

 12
Author: Zxaos,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-13 21:00:39

Sé que la pregunta original era sobre Vagrant, pero para las personas que usan la gema knife-solo y encuentran este error, simplemente agregue la siguiente línea a .chef/knife.rb:

ssl_verify_mode :verify_peer

La gema knife-solo tomará ese valor y lo pondrá en el archivo solo.rb que se carga en el servidor, que es el archivo de configuración principal que se pasa a chef-solo.

 8
Author: David Grayson,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-10-07 01:19:36