git 'microservice' do
repository 'https://github.com/JJ/microservices-broker'
user 'vagrant'
destination '/home/vagrant/microservice'
action :checkout
end
Sh*t happens
apt_package 'ruby' do
default_release '2.3'
end
The converge of the remote host failed for the
following reason:
Expected process to exit with [0], but received '100'
Usa los logs, Luke
tail ~/.chef-workstation/logs/default.log
STDOUT: ruby:
Installed: 1:2.1.5+deb8u2
Candidate: 1:2.1.5+deb8u2
Version table:
*** 1:2.1.5+deb8u2 0
500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
100 /var/lib/dpkg/status
STDERR: E: The value '2.3' is invalid for APT::Default-Release as such a release is not available in the sources
---- End output of ["apt-cache", "-o", "APT::Default-Release=2.3", "policy", "ruby"] ----
Ran ["apt-cache", "-o", "APT::Default-Release=2.3", "policy", "ruby"] returned 100
Usuario y directorio
user 'app' do
comment 'User for app'
home '/app'
shell '/bin/bash'
password '$1$JJsvHslasdfjVEroftprNn4JHtDi'
end
directory '/app' do
owner 'app'
group 'app'
mode '0755'
end
Nunca claves en ficheros.
Creando una clave secreta
openssl passwd -1 $MS_PASSWORD
Instalando de verdad
package 'git'
package 'gcc'
package 'make'
package 'sqlite3' do
case node[:platform]
when 'redhat', 'centos', 'fedora'
package_name 'sqlite-devel'
when 'ubuntu', 'debian'
package_name 'libsqlite3-dev'
end
end