Cookbook for installing Rancher server & agent
It should work on most Linux distributions.
Tested on Ubuntu and CentOS 7.x.
See the attributes/default.rb
file for default values.
Setup default Rancher Server container, based on node['rancher_ng']['server']
attributes.
Setup default Rancher Agent container, based on node['rancher_ng']['agent']
attributes.
To use the providers, append the following to your metadata.rb
depends 'rancher-ng'
Deploys server container. With this you can skip keys in server
provider.
rancher_ng_server 'name' do
name 'mycontainer' # Container/Job name
image 'rancher/server' # Server image
version 'v1.6.0' # Server image version
db_dir '/var/opt/rancher_db' # Rancher's db directory
port '8080' # Rancher's server port
detach true # Docker's `detach` mode
restart_policy 'unless-stopped' # Docker's `restart` mode
external_db false # Use external MySQL DB?
db_container 'mysql' # Use DB in container?
db_container_version '5.7'
db_container_command '--max_allowed_packet=32M --innodb_log_file_size=256M --innodb_large_prefix=on --innodb_file_format=Barracuda --innodb_file_per_table=1 --innodb_buffer_pool_size=1GB'
db_host 'localhost' # Database host
db_port '3306' # Database port
db_user 'cattle' # Database user
db_pass 'password' # Database password
db_name 'cattle' # Database name
cookbook 'rancher-ng' # Cookbook to take erb template from
action :create # :create, :delete
end
Deploys agent container. With this you can skip keys in agent
provider.
rancher_ng_agent 'name' do
name 'mycontainer' # Job name
image 'rancher/agent' # Agent image
version 'v1.2.2' # Agent image version
labels {
a: 'some',
b: 8
}
auth_url 'http://yourserver:8080/SOMETOKEN' # Agent's server authentication url
mount_point '/var/lib/rancher:/var/lib/rancher' # Rancher's volume
autoremove false # Docker's `autoremove` mode
privileged true # Docker's `privileged` mode
cookbook 'rancher-ng' # Cookbook to take erb template from
action :create # :create, :delete
end
- Fork the repository on Github
- Create a named feature branch (i.e.
add-new-recipe
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request
Author: Alexander Merkulov sasha@merqlove.ru
Contributors: write me, to be here