├── Berksfile ├── Gemfile ├── .rubocop.yml ├── files └── default │ ├── ip-detect-public │ ├── aws_public │ ├── aws │ ├── gce │ ├── gce_public │ └── fault-domain-detect ├── .delivery └── project.toml ├── spec ├── spec_helper.rb └── unit │ └── recipes │ ├── cli_spec.rb │ └── default_spec.rb ├── test └── integration │ └── default │ ├── inspec.yml │ └── controls │ └── default_spec.rb ├── .gitignore ├── templates └── default │ ├── ip-detect.erb │ └── config.yaml.erb ├── .kitchen.yml ├── metadata.rb ├── .kitchen.dokken.yml ├── .travis.yml ├── recipes ├── cli.rb ├── _ip-detect.rb └── default.rb ├── chefignore ├── libraries └── helpers.rb ├── .kitchen.local.yml.example ├── resources └── dcos_user.rb ├── attributes └── default.rb ├── README.md ├── CHANGELOG.md └── LICENSE /Berksfile: -------------------------------------------------------------------------------- 1 | source 'https://supermarket.chef.io' 2 | 3 | metadata 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'stove' 4 | gem 'zookeeper' 5 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | FileName: 2 | Exclude: 3 | - 'recipes/_ip-detect.rb' 4 | 5 | LineLength: 6 | Enabled: false 7 | -------------------------------------------------------------------------------- /files/default/ip-detect-public: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -o nounset -o errexit 3 | 4 | curl -fsSL https://ipinfo.io/ip 5 | -------------------------------------------------------------------------------- /files/default/aws_public: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -o nounset -o errexit 3 | 4 | curl -fsSL http://169.254.169.254/latest/meta-data/public-ipv4 5 | -------------------------------------------------------------------------------- /.delivery/project.toml: -------------------------------------------------------------------------------- 1 | remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml" 2 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'chefspec' 2 | require 'chefspec/berkshelf' 3 | 4 | RSpec.configure do |config| 5 | config.formatter = :documentation 6 | config.color = true 7 | end 8 | 9 | at_exit { ChefSpec::Coverage.report! } 10 | -------------------------------------------------------------------------------- /test/integration/default/inspec.yml: -------------------------------------------------------------------------------- 1 | name: default-dcos-master 2 | title: Integration tests for DC/OS master with Oauth 3 | summary: This InSpec profile contains integration tests for DC/OS cookbook 4 | version: 0.0.2 5 | supports: 6 | - os-family: linux 7 | -------------------------------------------------------------------------------- /files/default/aws: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Example ip-detect script using an external authority 3 | # Uses the AWS Metadata Service to get the node's internal 4 | # ipv4 address 5 | set -o nounset -o errexit 6 | 7 | curl -fsSL http://169.254.169.254/latest/meta-data/local-ipv4 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | *~ 3 | *# 4 | .#* 5 | \#*# 6 | .*.sw[a-z] 7 | *.un~ 8 | 9 | # Bundler 10 | Gemfile.lock 11 | bin/* 12 | .bundle/* 13 | 14 | .kitchen/ 15 | .kitchen.local.yml 16 | .direnv/ 17 | .envrc 18 | .ruby-version 19 | Berksfile.lock 20 | berks-cookbooks/* 21 | -------------------------------------------------------------------------------- /templates/default/ip-detect.erb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # generated by the _ip-detect recipe based on the interface specified 3 | set -o nounset -o errexit 4 | export PATH=/usr/sbin:/usr/bin:$PATH 5 | ip addr show <%= @interface %> | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1 6 | -------------------------------------------------------------------------------- /files/default/gce: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Example ip-detect script using an external authority 3 | # Uses the GCE metadata server to get the node's internal 4 | # ipv4 address 5 | set -o nounset -o errexit 6 | 7 | curl -fsSl -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/ip 8 | -------------------------------------------------------------------------------- /files/default/gce_public: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Example ip-detect script using an external authority 3 | # Uses the GCE metadata server to get the node's public 4 | # ipv4 address 5 | set -o nounset -o errexit 6 | 7 | curl -fsSl -H "Metadata-Flavor: Google" \ 8 | http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip 9 | -------------------------------------------------------------------------------- /.kitchen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | driver: 3 | name: vagrant 4 | customize: 5 | cpus: 2 6 | memory: 4096 7 | 8 | provisioner: 9 | name: chef_zero 10 | 11 | verifier: 12 | name: inspec 13 | 14 | platforms: 15 | - name: centos-7.4 16 | 17 | suites: 18 | - name: default 19 | run_list: 20 | - recipe[dcos::default] 21 | attributes: 22 | dcos: 23 | config: 24 | master_list: ['127.0.0.1'] 25 | ip-detect: lo 26 | -------------------------------------------------------------------------------- /spec/unit/recipes/cli_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: dcos 3 | # Spec:: cli 4 | # 5 | 6 | require 'spec_helper' 7 | 8 | describe 'dcos::cli' do 9 | context 'Default behavior' do 10 | let(:chef_run) do 11 | ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611').converge(described_recipe) 12 | end 13 | 14 | it 'creates remote_file[/usr/local/bin/dcos]' do 15 | expect(chef_run).to create_remote_file('/usr/local/bin/dcos').with(mode: '0755') 16 | end 17 | 18 | it 'converges successfully' do 19 | expect { chef_run }.to_not raise_error 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /metadata.rb: -------------------------------------------------------------------------------- 1 | name 'dcos' 2 | maintainer 'Chef Software, Inc.' 3 | maintainer_email 'partnereng@chef.io' 4 | license 'Apache-2.0' 5 | description 'Installs/Configures Mesosphere DC/OS' 6 | long_description 'Installs/Configures Mesosphere DC/OS' 7 | version '3.0.1' 8 | 9 | source_url 'https://github.com/chef-partners/dcos-cookbook' if 10 | respond_to?(:source_url) 11 | issues_url 'https://github.com/chef-partners/dcos-cookbook/issues' if 12 | respond_to?(:issues_url) 13 | chef_version '>= 12.10' if 14 | respond_to?(:chef_version) 15 | 16 | %w( 17 | centos 18 | oracle 19 | redhat 20 | scientific 21 | ).each do |distro| 22 | supports distro 23 | end 24 | 25 | depends 'docker', '~> 4.4' 26 | depends 'selinux', '~> 2.1' 27 | -------------------------------------------------------------------------------- /templates/default/config.yaml.erb: -------------------------------------------------------------------------------- 1 | --- 2 | <%- @config.each do |k, v| %> 3 | <%- next if %w(agent_list public_agent_list master_list resolvers rexray rexray_config).include?(k) %> 4 | <%= k %>: '<%= v %>' 5 | <% end %> 6 | <% %w(agent_list public_agent_list master_list resolvers).each do |n| %> 7 | <% if @config.key?(n) && !@config[n].empty? %> 8 | <%= n %>: 9 | <% @config[n].each do |i| %> 10 | - <%= i %> 11 | <% end %> 12 | <% end %> 13 | <% end %> 14 | <% %w(rexray rexray_config).each do |key| %> 15 | <% unless @config[key].nil? || @config[key].empty? %> 16 | <%= key %>: 17 | <% require 'yaml' %> 18 | <%- JSON.parse(@config[key].to_json).to_yaml.lines.drop(1).each do |l| %> 19 | <%= l.chomp %> 20 | <% end %> 21 | <% end %> 22 | <% end %> 23 | -------------------------------------------------------------------------------- /.kitchen.dokken.yml: -------------------------------------------------------------------------------- 1 | driver: 2 | name: dokken 3 | privileged: true # because Docker, systemd, and sysctl 4 | chef_version: <%= ENV['CHEF_VERSION'] || 'current' %> 5 | 6 | transport: 7 | name: dokken 8 | 9 | provisioner: 10 | name: dokken 11 | deprecations_as_errors: true 12 | 13 | platforms: 14 | - name: centos-7 15 | driver: 16 | image: dokken/centos-7 17 | pid_one_command: /usr/lib/systemd/systemd 18 | # This is needed because dcos-spartan.service does "modprobe dummy" 19 | volumes: 20 | - /lib/modules:/lib/modules:ro 21 | 22 | suites: 23 | - name: default 24 | run_list: 25 | - recipe[dcos::default] 26 | attributes: 27 | dcos: 28 | config: 29 | master_list: ['127.0.0.1'] 30 | docker_storage_driver: 'vfs' 31 | ip-detect: 'lo' 32 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | 4 | 5 | addons: 6 | apt: 7 | sources: 8 | - chef-current-trusty 9 | packages: 10 | - chefdk 11 | 12 | # Don't `bundle install` which takes about 1.5 mins 13 | install: echo 'skip bundle install' 14 | 15 | # Comment this, so we test everything, all the time 16 | # branches: 17 | # only: 18 | # - master 19 | 20 | services: docker 21 | 22 | env: 23 | matrix: 24 | - INSTANCE=default-centos-7 25 | 26 | before_script: 27 | - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER ) 28 | - eval "$(chef shell-init bash)" 29 | - chef --version 30 | - cookstyle --version 31 | - foodcritic --version 32 | - gem install docker-api --version '= 1.34.0' 33 | - gem install zookeeper 34 | 35 | script: KITCHEN_LOCAL_YAML=.kitchen.dokken.yml kitchen verify ${INSTANCE} 36 | 37 | matrix: 38 | include: 39 | - script: 40 | - chef exec delivery local all 41 | env: UNIT_AND_LINT=1 42 | -------------------------------------------------------------------------------- /recipes/cli.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: dcos 3 | # Recipe:: cli 4 | # 5 | # Copyright 2018 Chris Gianelloni 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | cli_base_url = "https://downloads.dcos.io/binaries/cli/#{node['os']}/#{node['kernel']['machine'].tr('_', '-')}" 21 | 22 | # Fetch the `dcos` CLI tool 23 | remote_file '/usr/local/bin/dcos' do 24 | source "#{cli_base_url}/dcos-#{node['dcos']['dcos_version'].to_f}/dcos" 25 | mode '0755' 26 | end 27 | -------------------------------------------------------------------------------- /chefignore: -------------------------------------------------------------------------------- 1 | # Put files/directories that should be ignored in this file when uploading 2 | # to a chef-server or supermarket. 3 | # Lines that start with '# ' are comments. 4 | 5 | # OS generated files # 6 | ###################### 7 | .DS_Store 8 | Icon? 9 | nohup.out 10 | ehthumbs.db 11 | Thumbs.db 12 | 13 | # SASS # 14 | ######## 15 | .sass-cache 16 | 17 | # EDITORS # 18 | ########### 19 | \#* 20 | .#* 21 | *~ 22 | *.sw[a-z] 23 | *.bak 24 | REVISION 25 | TAGS* 26 | tmtags 27 | *_flymake.* 28 | *_flymake 29 | *.tmproj 30 | .project 31 | .settings 32 | mkmf.log 33 | 34 | ## COMPILED ## 35 | ############## 36 | a.out 37 | *.o 38 | *.pyc 39 | *.so 40 | *.com 41 | *.class 42 | *.dll 43 | *.exe 44 | */rdoc/ 45 | 46 | # Testing # 47 | ########### 48 | .watchr 49 | .rspec 50 | spec/* 51 | spec/fixtures/* 52 | test/* 53 | features/* 54 | examples/* 55 | Guardfile 56 | Procfile 57 | .kitchen* 58 | .rubocop.yml 59 | spec/* 60 | Rakefile 61 | .travis.yml 62 | .foodcritic 63 | .codeclimate.yml 64 | 65 | # SCM # 66 | ####### 67 | .git 68 | */.git 69 | .gitignore 70 | .gitmodules 71 | .gitconfig 72 | .gitattributes 73 | .svn 74 | */.bzr/* 75 | */.hg/* 76 | */.svn/* 77 | 78 | # Berkshelf # 79 | ############# 80 | Berksfile 81 | Berksfile.lock 82 | cookbooks/* 83 | tmp 84 | 85 | # Cookbooks # 86 | ############# 87 | CONTRIBUTING* 88 | CHANGELOG* 89 | TESTING* 90 | MAINTAINERS.toml 91 | 92 | # Strainer # 93 | ############ 94 | Colanderfile 95 | Strainerfile 96 | .colander 97 | .strainer 98 | 99 | # Vagrant # 100 | ########### 101 | .vagrant 102 | Vagrantfile 103 | -------------------------------------------------------------------------------- /libraries/helpers.rb: -------------------------------------------------------------------------------- 1 | module Dcos 2 | # Helper functions 3 | module Helpers 4 | def dcos_generate_config_url 5 | return node['dcos']['dcos_generate_config_url'] if node['dcos'].key?('dcos_generate_config_url') 6 | return "#{dcos_base_url}/dcos_generate_config.ee.sh" if dcos_enterprise? 7 | "#{dcos_base_url}/dcos_generate_config.sh" 8 | end 9 | 10 | def dcos_enterprise? 11 | node['dcos']['dcos_enterprise'].to_s == 'true' 12 | end 13 | 14 | def dcos_cluster_address 15 | if node['dcos'].key?('config') && node['dcos']['config'].key?('master_discovery') && 16 | node['dcos']['config']['master_discovery'] == 'master_http_loadbalancer' && 17 | node['dcos']['config'].key?('master_external_loadbalancer') 18 | node['dcos']['config']['master_external_loadbalancer'] 19 | elsif node['dcos'].key?('config') && node['dcos']['config'].key?('master_list') 20 | node['dcos']['config']['master_list'].first # yuck, we can do better 21 | else 22 | 'leader.mesos' # assuming we're inside the cluster 23 | end 24 | end 25 | 26 | private 27 | 28 | def dcos_base_url 29 | v = node['dcos']['dcos_version'] 30 | return 'https://downloads.dcos.io/dcos/EarlyAccess' if v.downcase == 'earlyaccess' 31 | if v.to_f >= 1.10 32 | return "https://downloads.mesosphere.com/dcos-enterprise/stable/#{v}" if dcos_enterprise? 33 | return "https://downloads.dcos.io/dcos/stable/#{v}" 34 | else # stable or older releases 35 | return 'https://downloads.mesosphere.com/dcos-enterprise/stable/1.12.2' if dcos_enterprise? 36 | 'https://downloads.dcos.io/dcos/stable' 37 | end 38 | end 39 | end 40 | end 41 | 42 | Chef::Recipe.send(:include, Dcos::Helpers) 43 | Chef::Resource.send(:include, Dcos::Helpers) 44 | -------------------------------------------------------------------------------- /recipes/_ip-detect.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: dcos 3 | # Recipe:: _ip-detect 4 | # 5 | # Copyright 2016, Chef Software, Inc. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | # generates a genconf/ip-detect script based on the node['dcos']['ip-detect'] 21 | # https://docs.mesosphere.com/archived-dcos-enterprise-edition/installing-enterprise-edition-1-5/create-a-script-for-ip-address-discovery/ 22 | 23 | if %w(aws gce).include?(node['dcos']['ip-detect']) 24 | cookbook_file '/usr/src/dcos/genconf/ip-detect' do 25 | source node['dcos']['ip-detect'] 26 | mode '0755' 27 | end 28 | cookbook_file '/usr/src/dcos/genconf/ip-detect-public' do 29 | source "#{node['dcos']['ip-detect']}_public" 30 | mode '0755' 31 | end 32 | else 33 | # find the ipaddress for that interface 34 | interface = node['dcos']['ip-detect'] 35 | template '/usr/src/dcos/genconf/ip-detect' do 36 | source 'ip-detect.erb' 37 | mode '0755' 38 | variables(interface: interface) 39 | end 40 | cookbook_file '/usr/src/dcos/genconf/ip-detect-public' do 41 | cookbook node['dcos']['ip-detect-public']['cookbook'] 42 | source node['dcos']['ip-detect-public']['source'] 43 | mode '0755' 44 | not_if { node['dcos']['ip-detect-public']['source'].nil? } 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /.kitchen.local.yml.example: -------------------------------------------------------------------------------- 1 | --- 2 | driver: 3 | name: gce 4 | project: chef-marketplace-dev 5 | zone: us-central1-a 6 | preemptible: true 7 | email: matt@chef.io 8 | tags: 9 | - mesosphere 10 | - test-kitchen 11 | service_account_scopes: 12 | - devstorage.read_write 13 | - userinfo.email 14 | 15 | transport: 16 | username: mray 17 | ssh_key: 18 | - ~/.ssh/google_compute_engine 19 | 20 | platforms: 21 | - name: centos-7.2 22 | driver: 23 | image_name: centos-7 24 | 25 | suites: 26 | - name: default 27 | run_list: 28 | - recipe[dcos::default] 29 | attributes: 30 | dcos: 31 | master_list: ['127.0.0.1'] 32 | - name: gm1 33 | run_list: 34 | - recipe[dcos::default] 35 | attributes: 36 | dcos: 37 | ip-detect: 'gce' 38 | dcos_role: 'master' 39 | master_list: ['10.240.0.2', '10.240.0.3', '10.240.0.4'] 40 | - name: gm2 41 | run_list: 42 | - recipe[dcos::default] 43 | attributes: 44 | dcos: 45 | ip-detect: 'gce' 46 | dcos_role: 'master' 47 | master_list: ['10.240.0.2', '10.240.0.3', '10.240.0.4'] 48 | - name: gm3 49 | run_list: 50 | - recipe[dcos::default] 51 | attributes: 52 | dcos: 53 | dcos_role: 'master' 54 | master_list: ['10.240.0.2', '10.240.0.3', '10.240.0.4'] 55 | - name: gs1 56 | run_list: 57 | - recipe[dcos::default] 58 | attributes: 59 | dcos: 60 | ip-detect: 'gce' 61 | dcos_role: 'slave' 62 | master_list: ['10.240.0.2', '10.240.0.3', '10.240.0.4'] 63 | - name: gs2 64 | run_list: 65 | - recipe[dcos::default] 66 | attributes: 67 | dcos: 68 | ip-detect: 'gce' 69 | dcos_role: 'slave' 70 | master_list: ['10.240.0.2', '10.240.0.3', '10.240.0.4'] 71 | -------------------------------------------------------------------------------- /resources/dcos_user.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: dcos 3 | # Recipe:: default 4 | # 5 | # Copyright 2018, Chef Software, Inc. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | resource_name :dcos_user 21 | 22 | property :zk_host, String, 23 | default: 'zk-1.zk:2181,zk-2.zk:2181,zk-3.zk:2181,zk-4.zk:2181,'\ 24 | 'zk-5.zk:2181', 25 | required: true 26 | property :email, String, required: false 27 | 28 | load_current_value do 29 | require 'zookeeper' 30 | include Zookeeper::Constants 31 | z = Zookeeper.new(zk_host) 32 | user_node = z.get(path: "/dcos/users/#{email}") 33 | email user_node[:data] if user_node[:rc] == ZOK 34 | end 35 | 36 | action :create do 37 | # If there is a change, remove and replace the current data 38 | converge_if_changed :email do 39 | require 'zookeeper' 40 | include Zookeeper::Constants 41 | z = Zookeeper.new(zk_host) 42 | z.delete(path: "/dcos/users/#{email}") # Fails cleanly if it doesn't exist. 43 | z.create(path: "/dcos/users/#{email}", data: email) 44 | end 45 | end 46 | 47 | action :delete do 48 | require 'zookeeper' 49 | include Zookeeper::Constants 50 | # Remove the user node from Zookeeper 51 | z = Zookeeper.new(zk_host) 52 | z.delete(path: "/dcos/users/#{email}") 53 | end 54 | -------------------------------------------------------------------------------- /attributes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Matt Ray 3 | # Cookbook Name:: dcos 4 | # 5 | # Copyright 2016 Chef Software, Inc 6 | # Copyright 2017-2018 Chris Gianelloni 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | 21 | # DC/OS Edition/Version Setup 22 | default['dcos']['dcos_earlyaccess'] = false 23 | default['dcos']['dcos_version'] = node['dcos']['dcos_earlyaccess'] ? 'earlyaccess' : 'stable' 24 | default['dcos']['dcos_enterprise'] = false 25 | 26 | # DC/OS role 27 | default['dcos']['dcos_role'] = 'master' # 'master', 'slave' or 'slave_public' 28 | 29 | # DC/OS license (Enterprise only, 1.11+) 30 | default['dcos']['dcos_license_text'] = nil 31 | 32 | # DC/OS config.yaml 33 | default['dcos']['config']['bootstrap_url'] = 'file:///usr/src/dcos/genconf/serve' 34 | default['dcos']['config']['cluster_name'] = 'DCOS' 35 | default['dcos']['config']['exhibitor_storage_backend'] = 'static' 36 | default['dcos']['config']['master_discovery'] = 'static' 37 | # ipv4 only, must be odd number 1-9 38 | default['dcos']['config']['master_list'] = [] 39 | # upstream DNS for MesosDNS 40 | default['dcos']['config']['resolvers'] = ['8.8.8.8', '8.8.4.4'] 41 | default['dcos']['config']['security'] = 'permissive' if node['dcos']['dcos_enterprise'] 42 | 43 | default['dcos']['manage_docker'] = true 44 | default['dcos']['docker_storage_driver'] = 'overlay' 45 | default['dcos']['docker_version'] = nil 46 | 47 | # Number of times to poll for leader.mesos before giving up 48 | default['dcos']['leader_check_retries'] = 120 49 | 50 | # determine how to generate the genconf/ip-detect script 51 | # 'aws' or 'gce' will use the local ipv4 address from the metadata service 52 | # otherwise use 'eth0', 'eth1', etc. and it will get the ipaddress associated 53 | # with node['network']['interface'][VALUE] 54 | default['dcos']['ip-detect'] = 'eth0' 55 | 56 | # Override this to use a file from another cookbook 57 | default['dcos']['ip-detect-public']['cookbook'] = 'dcos' 58 | default['dcos']['ip-detect-public']['source'] = 'ip-detect-public' 59 | default['dcos']['fault-domain-detect']['cookbook'] = 'dcos' 60 | default['dcos']['fault-domain-detect']['source'] = 'fault-domain-detect' 61 | -------------------------------------------------------------------------------- /test/integration/default/controls/default_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright:: (c) 2017 Chris Gianelloni 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | %w( 18 | firewalld 19 | rsyslog 20 | ).each do |svc| 21 | describe service(svc) do 22 | it { should_not be_running } 23 | it { should_not be_enabled } 24 | end 25 | end 26 | 27 | %w( 28 | curl 29 | ipset 30 | tar 31 | unzip 32 | xz 33 | ).each do |pkg| 34 | describe package(pkg) do 35 | it { should be_installed } 36 | end 37 | end 38 | 39 | describe group('nobody') do 40 | it { should exist } 41 | end 42 | 43 | describe directory('/opt/mesosphere') do 44 | it { should exist } 45 | it { should be_directory } 46 | it { should be_readable } 47 | end 48 | 49 | describe file('/opt/mesosphere/environment') do 50 | it { should exist } 51 | it { should be_file } 52 | it { should be_readable } 53 | end 54 | 55 | describe file('/etc/profile.d/dcos.sh') do 56 | it { should exist } 57 | it { should be_file } 58 | it { should be_readable } 59 | it { should be_symlink } 60 | end 61 | 62 | target_file = file('/etc/profile.d/dcos.sh').link_path 63 | describe file(target_file) do 64 | it { should exist } 65 | it { should be_file } 66 | it { should be_readable } 67 | end 68 | 69 | %w( 70 | docker 71 | dcos-exhibitor 72 | dcos-marathon 73 | dcos-mesos-master 74 | ).each do |svc| 75 | describe service(svc) do 76 | it { should be_installed } 77 | it { should be_enabled } 78 | it { should be_running } 79 | end 80 | end 81 | 82 | describe file('/etc/mesosphere/roles/master') do 83 | it { should exist } 84 | it { should be_readable } 85 | end 86 | 87 | %w( 88 | slave 89 | slave_public 90 | ).each do |role| 91 | describe file("/etc/mesosphere/roles/#{role}") do 92 | it { should_not exist } 93 | end 94 | end 95 | 96 | %w( 97 | /etc/mesosphere/setup-flags/repository-url 98 | ).each do |conf| 99 | describe file(conf) do 100 | it { should exist } 101 | it { should be_readable } 102 | end 103 | end 104 | 105 | describe yaml('/etc/rexray/config.yml') do 106 | its(['rexray', 'modules', 'default-docker', 'disabled']) { should eq true } 107 | end 108 | 109 | # IPv4 (TCP + UDP) 110 | describe port(53) do 111 | it { should be_listening } 112 | its('protocols') { should include 'tcp' } 113 | its('protocols') { should include 'udp' } 114 | end 115 | 116 | # IPv4 (TCP + TCP6) 117 | %w( 118 | 80 119 | 443 120 | 2181 121 | 5050 122 | 8080 123 | 8181 124 | ).each do |tcp| 125 | describe port(tcp) do 126 | it { should be_listening } 127 | its('protocols') { should cmp(/tcp/) } 128 | end 129 | end 130 | -------------------------------------------------------------------------------- /files/default/fault-domain-detect: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AWS_URL="http://169.254.169.254/latest/dynamic/instance-identity/document" 4 | 5 | AZURE_REGION_URL="http://169.254.169.254/metadata/instance/compute/location?api-version=2017-08-01&format=text" 6 | AZURE_FD_URL="http://169.254.169.254/metadata/instance/compute/platformFaultDomain?api-version=2017-04-02&format=text" 7 | 8 | GCP_METADATA_URL="http://metadata.google.internal/computeMetadata/v1/instance/zone" 9 | 10 | 11 | function aws() { 12 | METADATA="$(curl -f -m3 $AWS_URL 2>/dev/null)" 13 | rc=$? 14 | if [ $rc -ne 0 ]; then 15 | echo "unable to fetch aws region/zone. URL $AWS_URL. Ret code $rc" >&2 16 | exit 1 17 | fi 18 | REGION=$(echo $METADATA | grep -Po "\"region\"\s+:\s+\"(.*?)\"" | cut -f2 -d: | tr -d ' \"') 19 | ZONE=$(echo $METADATA | grep -Po "\"availabilityZone\"\s+:\s+\"(.*?)\"" | cut -f2 -d: | tr -d ' \"') 20 | echo "{\"fault_domain\":{\"region\":{\"name\": \"aws/$REGION\"},\"zone\":{\"name\": \"aws/$ZONE\"}}}" 21 | } 22 | 23 | function azure() { 24 | REGION=$(curl -f -m3 -H Metadata:true "$AZURE_REGION_URL" 2>/dev/null) 25 | rc=$? 26 | if [ $rc -ne 0 ]; then 27 | echo "unable to fetch azure region. URL $AZURE_REGION_URL. Ret code $rc" >&2 28 | exit 1 29 | fi 30 | 31 | FAULT_DOMAIN=$(curl -f -m3 -H Metadata:true "$AZURE_FD_URL" 2>/dev/null) 32 | rc=$? 33 | if [ $rc -ne 0 ]; then 34 | echo "unable to fetch azure fault domain. URL $AZURE_FD_URL. Ret code $rc" >&2 35 | exit 1 36 | fi 37 | 38 | echo "{\"fault_domain\":{\"region\":{\"name\": \"azure/$REGION\"},\"zone\":{\"name\": \"azure/$FAULT_DOMAIN\"}}}" 39 | } 40 | 41 | function gcp() { 42 | BODY=$(curl -f -m3 -H "Metadata-Flavor: Google" "$GCP_METADATA_URL" 2>/dev/null) 43 | rc=$? 44 | if [ $rc -ne 0 ]; then 45 | echo "unable to fetch gcp metadata. URL $GCP_METADATA_URL. Ret code $rc" >&2 46 | exit 1 47 | fi 48 | 49 | ZONE=$(echo "$BODY" | sed 's@^projects/.*/zones/\(.*\)$@\1@') 50 | REGION=$(echo "$ZONE" | sed 's@\(.*-.*\)-.*@\1@') 51 | 52 | echo "{\"fault_domain\":{\"region\":{\"name\": \"gcp/$REGION\"},\"zone\":{\"name\": \"gcp/$ZONE\"}}}" 53 | } 54 | 55 | function main() { 56 | if [ $# -eq 1 ]; then 57 | case $1 in 58 | --aws) aws; exit 0;; 59 | --azure) azure; exit 0;; 60 | --gcp) gcp; exit 0;; 61 | esac 62 | echo "invalid parameter $1. Must be one of --aws, --azure or --gcp" 63 | exit 1 64 | fi 65 | 66 | # declare PROVIDERS as an empty array 67 | PROVIDERS=() 68 | 69 | # try aws first 70 | curl -f -q -m1 "$AWS_URL" >/dev/null 2>&1 71 | if [ $? -eq 0 ]; then 72 | PROVIDERS+=("aws") 73 | fi 74 | 75 | # try azure 76 | curl -f -q -m1 -H 'Metadata:true' "$AZURE_REGION_URL" >/dev/null 2>&1 77 | if [ $? -eq 0 ]; then 78 | PROVIDERS+=("azure") 79 | fi 80 | 81 | # try gcp 82 | curl -f -q m1 -H "Metadata-Flavor: Google" "$GCP_METADATA_URL" >/dev/null 2>&1 83 | if [ $? -eq 0 ]; then 84 | PROVIDERS+=("gcp") 85 | fi 86 | 87 | if [ ${#PROVIDERS[@]} -eq 0 ]; then 88 | "ERROR: unable to detect cloud provider. Use explicit parameter --aws, --azure, or --gcp" >&2 89 | exit 1 90 | fi 91 | 92 | if [ ${#PROVIDERS[@]} -gt 1 ]; then 93 | echo "ERROR: found multiple cloud providers: ${PROVIDERS[@]}" >&2 94 | exit 1 95 | fi 96 | 97 | provider=${PROVIDERS[0]} 98 | case $provider in 99 | "aws") aws; exit 0;; 100 | "gcp") gcp; exit 0;; 101 | "azure") azure; exit 0;; 102 | *) echo "ERROR: Unknown cloud provider $provider" >&2; exit 1;; 103 | esac 104 | } 105 | 106 | main $@ 107 | -------------------------------------------------------------------------------- /spec/unit/recipes/default_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: dcos 3 | # Spec:: default 4 | # 5 | 6 | require 'spec_helper' 7 | 8 | describe 'dcos::default' do 9 | context 'Default behavior, assume eth0' do 10 | let(:chef_run) do 11 | ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611') do |node| 12 | node.override['network']['interfaces']['eth0']['addresses'] = 13 | { 14 | '1.2.3.4' => 15 | { 16 | 'family' => 'inet', 17 | 'netmask' => '255.255.255.0', 18 | 'broadcast' => '192.168.1.255', 19 | }, 20 | } 21 | stub_command(/ping -c1 /).and_return(false) 22 | end.converge(described_recipe) 23 | end 24 | 25 | it 'sets SELinux to permissive' do 26 | expect(chef_run).to permissive_selinux_state('SELinux Permissive') 27 | end 28 | 29 | %w( 30 | firewalld 31 | rsyslog 32 | ).each do |svc| 33 | it "stops and disables #{svc}" do 34 | expect(chef_run).to stop_service(svc) 35 | expect(chef_run).to disable_service(svc) 36 | end 37 | end 38 | 39 | it 'installs %w(curl ipset tar unzip xz)' do 40 | expect(chef_run).to install_package(%w(curl ipset tar unzip xz)) 41 | end 42 | 43 | it 'installs net-tools' do 44 | expect(chef_run).to install_package('net-tools') 45 | end 46 | 47 | it 'creates group[nogroup]' do 48 | expect(chef_run).to create_group('nogroup') 49 | end 50 | 51 | it 'creates docker service' do 52 | expect(chef_run).to create_docker_service('default') 53 | end 54 | 55 | it 'creates remote_file[dcos_generate_config.sh]' do 56 | expect(chef_run).to create_remote_file('/usr/src/dcos/dcos_generate_config.sh').with(mode: '0755') 57 | end 58 | 59 | it 'creates directory[genconf]' do 60 | expect(chef_run).to create_directory('/usr/src/dcos/genconf').with(mode: '0755') 61 | end 62 | 63 | it 'creates template[config.yaml]' do 64 | expect(chef_run).to create_template('/usr/src/dcos/genconf/config.yaml') 65 | end 66 | 67 | it 'creates /usr/src/dcos/genconf/ip-detect from template' do 68 | expect(chef_run).to create_template('/usr/src/dcos/genconf/ip-detect') 69 | end 70 | 71 | it 'creates /usr/src/dcos/genconf/ip-detect-public from file' do 72 | expect(chef_run).to create_cookbook_file('/usr/src/dcos/genconf/ip-detect-public') 73 | end 74 | 75 | it 'executes[dcos-genconf]' do 76 | expect(chef_run).to run_execute('dcos-genconf').with(user: 'root') 77 | end 78 | 79 | it 'ensures /usr/src/dcos/genconf/serve/dcos_install.sh is executable' do 80 | expect(chef_run).to create_file('/usr/src/dcos/genconf/serve/dcos_install.sh').with(mode: '0755') 81 | end 82 | 83 | it 'executes[preflight-check]' do 84 | expect(chef_run).to run_execute('preflight-check') 85 | end 86 | 87 | it 'executes[dcos_install]' do 88 | expect(chef_run).to run_execute('dcos_install').with(user: 'root') 89 | end 90 | 91 | %w( 92 | mesos 93 | marathon 94 | ).each do |svc| 95 | it "executes[check-#{svc}-up]" do 96 | expect(chef_run).to run_execute("check-#{svc}-up") 97 | end 98 | end 99 | 100 | it 'converges successfully' do 101 | expect { chef_run }.to_not raise_error 102 | end 103 | end 104 | 105 | context 'DC/OS Enterprise 1.11' do 106 | let(:chef_run) do 107 | ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611') do |node| 108 | node.override['dcos']['dcos_enterprise'] = true 109 | node.override['dcos']['dcos_version'] = '1.11.1' 110 | node.override['dcos']['dcos_license_text'] = 'STUB' 111 | stub_command(/ping -c1 /).and_return(false) 112 | end.converge(described_recipe) 113 | end 114 | 115 | it 'creates genconf/license.txt' do 116 | expect(chef_run).to create_file('/usr/src/dcos/genconf/license.txt') 117 | end 118 | 119 | it 'creates genconf/fault-domain-detect' do 120 | expect(chef_run).to create_cookbook_file('/usr/src/dcos/genconf/fault-domain-detect') 121 | end 122 | 123 | it 'converges successfully' do 124 | expect { chef_run }.to_not raise_error 125 | end 126 | end 127 | end 128 | -------------------------------------------------------------------------------- /recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: dcos 3 | # Recipe:: default 4 | # 5 | # Copyright 2016, Chef Software, Inc. 6 | # Copyright 2017-2018 Chris Gianelloni 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | 21 | # Prereqs 22 | include_recipe 'selinux::permissive' 23 | 24 | %w( 25 | firewalld 26 | rsyslog 27 | ).each do |svc| 28 | service svc do 29 | action %i(stop disable) 30 | end 31 | end 32 | 33 | package %w( 34 | curl 35 | ipset 36 | tar 37 | unzip 38 | xz 39 | ) 40 | 41 | # Hard-coded `ifconfig` means we have to include this 42 | # https://github.com/apache/mesos/blob/a741b15e889de3242e3aa7878105ab9d946f6ea2/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp#L2106 43 | package 'net-tools' 44 | 45 | group 'nogroup' 46 | 47 | # Install docker with overlayfs 48 | docker_service 'default' do 49 | storage_driver node['dcos']['docker_storage_driver'] 50 | version node['dcos']['docker_version'] if node['dcos']['docker_version'] 51 | install_method 'package' if node['dcos']['docker_version'] 52 | action %i(create start) 53 | only_if { node['dcos']['manage_docker'] } 54 | end 55 | 56 | directory '/usr/src/dcos/genconf' do 57 | mode '0755' 58 | recursive true 59 | end 60 | 61 | # Only used on DC/OS Enterprise 1.11+ 62 | file '/usr/src/dcos/genconf/license.txt' do 63 | content node['dcos']['dcos_license_text'] 64 | sensitive true 65 | only_if { dcos_enterprise? && node['dcos']['dcos_version'].to_f >= 1.11 } 66 | end 67 | 68 | template '/usr/src/dcos/genconf/config.yaml' do 69 | source 'config.yaml.erb' 70 | variables config: node['dcos']['config'] 71 | end 72 | 73 | # Only supported on DC/OS Enterprise 1.11+ 74 | cookbook_file '/usr/src/dcos/genconf/fault-domain-detect' do 75 | # Pull latest from GitHub 76 | cookbook node['dcos']['fault-domain-detect']['cookbook'] 77 | source node['dcos']['fault-domain-detect']['source'] 78 | mode '0755' 79 | only_if { dcos_enterprise? && node['dcos']['dcos_version'].to_f >= 1.11 } 80 | not_if { node['dcos']['fault-domain-detect']['source'].nil? } 81 | end 82 | 83 | remote_file '/usr/src/dcos/dcos_generate_config.sh' do 84 | source dcos_generate_config_url 85 | mode '0755' 86 | end 87 | 88 | # generate the genconf/ip-detect script 89 | include_recipe 'dcos::_ip-detect' 90 | 91 | execute 'dcos-genconf' do 92 | command '/usr/src/dcos/dcos_generate_config.sh --genconf' 93 | user 'root' 94 | cwd '/usr/src/dcos' 95 | creates '/usr/src/dcos/genconf/cluster_packages.json' 96 | end 97 | 98 | file '/usr/src/dcos/genconf/serve/dcos_install.sh' do 99 | mode '0755' 100 | end 101 | 102 | # We're going to poll this up to 30 times, to prevent issues where a port may temporarily be in use 103 | execute 'preflight-check' do 104 | command "/usr/src/dcos/genconf/serve/dcos_install.sh --preflight-only #{node['dcos']['dcos_role']}" 105 | retry_delay 1 106 | retries 30 107 | action :run 108 | not_if { ::File.exist?('/opt/mesosphere/environment') } # assume DC/OS is installed 109 | end 110 | 111 | execute 'dcos_install' do 112 | command "/usr/src/dcos/genconf/serve/dcos_install.sh #{node['dcos']['dcos_role']}" 113 | creates '/opt/mesosphere/environment' 114 | user 'root' 115 | cwd '/usr/src/dcos' 116 | action :run 117 | end 118 | 119 | # Poll for leader.mesos to ensure we're up before finishing converge 120 | execute 'check-mesos-up' do 121 | command 'ping -c1 leader.mesos' 122 | retry_delay 1 123 | retries node['dcos']['leader_check_retries'] 124 | action :run 125 | not_if 'ping -c1 leader.mesos' 126 | end 127 | 128 | execute 'check-marathon-up' do 129 | command 'ping -c1 marathon.mesos' 130 | retry_delay 1 131 | retries node['dcos']['leader_check_retries'] 132 | action :run 133 | not_if 'ping -c1 marathon.mesos' 134 | end 135 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/chef-partners/dcos-cookbook.svg?branch=master)](https://travis-ci.org/chef-partners/dcos-cookbook) 2 | 3 | Description 4 | =========== 5 | 6 | Manage deployment and configuration of underlying Mesosphere DC/OS installation. This cookbook supports both DC/OS 7 | OSS installations (default) and DC/OS Enterprise. 8 | 9 | Note: The default username and password for DC/OS Enterprise is `bootstrapuser`/`deleteme` and can be changed by setting 10 | `node['dcos']['config']['superuser_username']` and `node['dcos']['config']['superuser_password_hash']`, respectively. 11 | 12 | Requirements 13 | ------------ 14 | 15 | Only Red Hat or CentOS 7.x are currently supported. 16 | 17 | Usage 18 | ========== 19 | 20 | The behavior of this cookbook is managed by attributes documented in the [attributes file](attributes/default.rb). 21 | The `node['dcos']['dcos_role']` attribute controls the DC/OS role to apply to the node (default is `master`). The 22 | `node['dcos']['config']['master_list']` must be set when `node['dcos']['config']['master_discovery']` is set to 23 | `static` to specify the list of DC/OS master node IPv4 addresses to connect at startup (this must be an odd number 24 | of masters and cannot be changed, later). 25 | 26 | This cookbook uses the stable channel, by default. Setting `node['dcos']['dcos_version']` to `earlyaccess` will 27 | install the latest EarlyAccess version of DC/OS OSS. Enterprise support can be enabled by setting 28 | `node['dcos']['dcos_enterprise']` to `true` and providing a license key in `node['dcos']['dcos_license_text']` 29 | via whichever manner you prefer. 30 | 31 | Roles 32 | ---------- 33 | 34 | You can create a Chef Role and apply it to nodes as necessary to specify `master`, `slave` and `slave_public`, as 35 | appropriate. Any additional configuration should be set as override attributes in an Environment to ensure that 36 | all nodes receive those global settings. 37 | 38 | ### Example Role dcos_master.rb ### 39 | ````ruby 40 | name "dcos_master" 41 | description "DC/OS master role" 42 | run_list "recipe[dcos]" 43 | default_attributes "dcos" => { 44 | "dcos_role" => "master", 45 | "config" => { 46 | "master_list" => [ "10.0.2.10" ] 47 | } 48 | } 49 | ```` 50 | 51 | ### Example Role dcos_slave.rb ### 52 | ````ruby 53 | name "dcos_slave" 54 | description "DC/OS slave role" 55 | run_list "recipe[dcos]" 56 | default_attributes "dcos" => { 57 | "dcos_role" => "slave", 58 | "config" => { 59 | "master_list" => [ "10.0.2.10" ] 60 | } 61 | } 62 | ```` 63 | 64 | Recipe 65 | ======= 66 | 67 | default 68 | ------- 69 | 70 | Installs the prerequisites for the Mesosphere DC/OS installation, including packages, and groups. 71 | Docker with OverlayFS is installed and enabled if `node['dcos']['manage_docker']` is set to true, 72 | which is the default. Next, the recipe downloads and runs the installation package with the 73 | settings configured by the attributes under `node['dcos']['config']`. 74 | 75 | 76 | Resource 77 | ======== 78 | 79 | dcos_user 80 | --------- 81 | 82 | Defines a DC/OS user. 83 | 84 | ### Example dcos_user ### 85 | ````ruby 86 | dcos_user 'user@domain.com' do 87 | email 'user@domain.com' 88 | end 89 | ```` 90 | 91 | It's possible Zookeeper is not up and running at the time you attempt to 92 | provision a DC/OS user. If that is the case, you should add an 93 | `ignore_failure` set to `true` in the used declaration: 94 | 95 | ### Example dcos_user with ignore_failure ### 96 | ````ruby 97 | dcos_user 'user@domain.com' do 98 | ignore_failure true 99 | email 'user@domain.com' 100 | end 101 | ```` 102 | 103 | Testing 104 | ======= 105 | 106 | ChefSpec 107 | -------- 108 | There is basic coverage for the default recipe. 109 | 110 | InSpec 111 | ------ 112 | There is basic functional testing of the DC/OS OSS setup for a single master node. 113 | 114 | Test Kitchen 115 | ------------ 116 | The included [.kitchen.yml](.kitchen.yml) runs the default master deployment in a generic fashion. 117 | The included [.kitchen.local.yml.example](.kitchen.local.yml.example) shows alternate settings for 118 | running multi-master with slaves on GCE (you will have to rename and update accordingly). 119 | 120 | License and Author 121 | ================== 122 | 123 | Author:: Matt Ray () 124 | 125 | Copyright 2016-2018 Chef Software, Inc. 126 | 127 | Licensed under the Apache License, Version 2.0 (the "License"); 128 | you may not use this file except in compliance with the License. 129 | You may obtain a copy of the License at 130 | 131 | http://www.apache.org/licenses/LICENSE-2.0 132 | 133 | Unless required by applicable law or agreed to in writing, software 134 | distributed under the License is distributed on an "AS IS" BASIS, 135 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 136 | See the License for the specific language governing permissions and 137 | limitations under the License. 138 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [v3.0.1](https://github.com/chef-partners/dcos-cookbook/tree/v3.0.1) 4 | 5 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v3.0.0...v3.0.1) 6 | 7 | **Merged pull requests:** 8 | 9 | - Simplify download URL generation [\#31](https://github.com/chef-partners/dcos-cookbook/pull/31) ([wolf31o2](https://github.com/wolf31o2)) 10 | 11 | ## [v3.0.0](https://github.com/chef-partners/dcos-cookbook/tree/v3.0.0) 12 | 13 | **BREAKING CHANGES** 14 | 15 | This cookbook has dropped support for DC/OS versions prior to 1.10.0, which are no longer supported by Mesosphere. 16 | 17 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v2.2.0...v3.0.0) 18 | 19 | **Merged pull requests:** 20 | 21 | - Drop support for DC/OS older than 1.10 [\#29](https://github.com/chef-partners/dcos-cookbook/pull/29) ([wolf31o2](https://github.com/wolf31o2)) 22 | - Support DC/OS 1.12.2, 1.11.10, and 1.10.11 [\#30](https://github.com/chef-partners/dcos-cookbook/pull/30) ([wolf31o2](https://github.com/wolf31o2)) 23 | 24 | ## [v2.2.0](https://github.com/chef-partners/dcos-cookbook/tree/v2.2.0) 25 | 26 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v2.1.0...v2.2.0) 27 | 28 | **Merged pull requests:** 29 | 30 | - Support DC/OS 1.12.1, 1.11.8, and 1.11.9 [\#28](https://github.com/chef-partners/dcos-cookbook/pull/28) ([wolf31o2](https://github.com/wolf31o2)) 31 | 32 | ## [v2.1.0](https://github.com/chef-partners/dcos-cookbook/tree/v2.1.0) 33 | 34 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v2.0.2...v2.1.0) 35 | 36 | **Merged pull requests:** 37 | 38 | - Support DC/OS 1.12.0 and 1.11.7 [\#27](https://github.com/chef-partners/dcos-cookbook/pull/27) ([wolf31o2](https://github.com/wolf31o2)) 39 | 40 | ## [v2.0.2](https://github.com/chef-partners/dcos-cookbook/tree/v2.0.2) 41 | 42 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v2.0.1...v2.0.2) 43 | 44 | **Merged pull requests:** 45 | 46 | - Support DC/OS 1.11.5 and 1.11.6 [\#26](https://github.com/chef-partners/dcos-cookbook/pull/26) ([wolf31o2](https://github.com/wolf31o2)) 47 | 48 | ## [v2.0.1](https://github.com/chef-partners/dcos-cookbook/tree/v2.0.1) 49 | 50 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v2.0.0...v2.0.1) 51 | 52 | **Merged pull requests:** 53 | 54 | - Support DC/OS 1.11.4, and latest 1.9 and 1.10 [\#25](https://github.com/chef-partners/dcos-cookbook/pull/25) ([wolf31o2](https://github.com/wolf31o2)) 55 | 56 | ## [v2.0.0](https://github.com/chef-partners/dcos-cookbook/tree/v2.0.0) 57 | 58 | **BREAKING CHANGES** 59 | 60 | This cookbook has upgraded its dependencies and now requires at least Chef 12.15+ 61 | 62 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.3.2...v2.0.0) 63 | 64 | **Merged pull requests:** 65 | 66 | - Use latest docker cookbook [\#24](https://github.com/chef-partners/dcos-cookbook/pull/24) ([wolf31o2](https://github.com/wolf31o2)) 67 | 68 | ## [v1.3.2](https://github.com/chef-partners/dcos-cookbook/tree/v1.3.2) 69 | 70 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.3.1...v1.3.2) 71 | 72 | **Merged pull requests:** 73 | 74 | - Support DC/OS 1.11.3 [\#23](https://github.com/chef-partners/dcos-cookbook/pull/23) ([wolf31o2](https://github.com/wolf31o2)) 75 | 76 | ## [v1.3.1](https://github.com/chef-partners/dcos-cookbook/tree/v1.3.1) 77 | 78 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.3.0...v1.3.1) 79 | 80 | **Merged pull requests:** 81 | 82 | - Support DC/OS 1.11.2 [\#22](https://github.com/chef-partners/dcos-cookbook/pull/22) ([wolf31o2](https://github.com/wolf31o2)) 83 | 84 | ## [v1.3.0](https://github.com/chef-partners/dcos-cookbook/tree/v1.3.0) 85 | 86 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.2.3...v1.3.0) 87 | 88 | **Merged pull requests:** 89 | 90 | - Recipe for DC/OS CLI [\#17](https://github.com/chef-partners/dcos-cookbook/pull/17) ([wolf31o2](https://github.com/wolf31o2)) 91 | - Updates from session w/ Justin Lee [\#20](https://github.com/chef-partners/dcos-cookbook/pull/20) ([wolf31o2](https://github.com/wolf31o2)) ([justinrlee](https://github.com/justinrlee)) 92 | - Allow disabling scripts using nil source [\#21](https://github.com/chef-partners/dcos-cookbook/pull/21) ([wolf31o2](https://github.com/wolf31o2)) 93 | 94 | ## [v1.2.3](https://github.com/chef-partners/dcos-cookbook/tree/v1.2.3) 95 | 96 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.2.2...v1.2.3) 97 | 98 | **Merged pull requests:** 99 | 100 | - Guard cloud fault-domain-detect script when onprem [\#16](https://github.com/chef-partners/dcos-cookbook/pull/16) ([wolf31o2](https://github.com/wolf31o2)) 101 | - Helper: dcos_cluster_address [\#18](https://github.com/chef-partners/dcos-cookbook/pull/18) ([wolf31o2](https://github.com/wolf31o2)) 102 | - Support DC/OS 1.10.6 and 1.11.1 [\#19](https://github.com/chef-partners/dcos-cookbook/pull/19) ([wolf31o2](https://github.com/wolf31o2)) 103 | 104 | ## [v1.2.2](https://github.com/chef-partners/dcos-cookbook/tree/v1.2.2) 105 | 106 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.2.1...v1.2.2) 107 | 108 | **Merged pull requests:** 109 | 110 | - Create a preflight-check execute block [\#15](https://github.com/chef-partners/dcos-cookbook/pull/15) ([wolf31o2](https://github.com/wolf31o2)) 111 | 112 | ## [v1.2.1](https://github.com/chef-partners/dcos-cookbook/tree/v1.2.1) 113 | 114 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.2.0...v1.2.1) 115 | 116 | **Merged pull requests:** 117 | 118 | - Remove zookeeper Gem requirements [\#14](https://github.com/chef-partners/dcos-cookbook/pull/14) ([wolf31o2](https://github.com/wolf31o2)) 119 | 120 | ## [v1.2.0](https://github.com/chef-partners/dcos-cookbook/tree/v1.2.0) 121 | 122 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.1.0...v1.2.0) 123 | 124 | **Merged pull requests:** 125 | 126 | - Add dcos_user custom resource [\#10](https://github.com/chef-partners/dcos-cookbook/pull/10) ([rbanffy](https://github.com/rbanffy)) 127 | - Support DC/OS Enterprise [\#13](https://github.com/chef-partners/dcos-cookbook/pull/13) ([wolf31o2](https://github.com/wolf31o2)) 128 | 129 | ## [v1.1.0](https://github.com/chef-partners/dcos-cookbook/tree/v1.1.0) 130 | 131 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v1.0.0...v1.1.0) 132 | 133 | **Merged pull requests:** 134 | 135 | - Support latest DC/OS 1.9 and 1.10 versions [\#9](https://github.com/chef-partners/dcos-cookbook/pull/9) ([wolf31o2](https://github.com/wolf31o2)) 136 | 137 | ## [v1.0.0](https://github.com/chef-partners/dcos-cookbook/tree/v1.0.0) (2017-11-13) 138 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v0.3.1...v1.0.0) 139 | 140 | **Merged pull requests:** 141 | 142 | - Support multiple versions of DC/OS [\#8](https://github.com/chef-partners/dcos-cookbook/pull/8) ([wolf31o2](https://github.com/wolf31o2)) 143 | 144 | ## [v0.3.1](https://github.com/chef-partners/dcos-cookbook/tree/v0.3.1) (2017-08-21) 145 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/v0.3.0...v0.3.1) 146 | 147 | **Closed issues:** 148 | 149 | - Add option for Stable release [\#5](https://github.com/chef-partners/dcos-cookbook/issues/5) 150 | 151 | **Merged pull requests:** 152 | 153 | - Update cookbook to modern standards [\#7](https://github.com/chef-partners/dcos-cookbook/pull/7) ([wolf31o2](https://github.com/wolf31o2)) 154 | 155 | ## [v0.3.0](https://github.com/chef-partners/dcos-cookbook/tree/v0.3.0) (2017-04-13) 156 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/0.2.0...v0.3.0) 157 | 158 | **Merged pull requests:** 159 | 160 | - Added earlyaccess flip [\#6](https://github.com/chef-partners/dcos-cookbook/pull/6) ([jjasghar](https://github.com/jjasghar)) 161 | - Correction to Attribute Value for Public Slave [\#4](https://github.com/chef-partners/dcos-cookbook/pull/4) ([jparten](https://github.com/jparten)) 162 | 163 | ## [0.2.0](https://github.com/chef-partners/dcos-cookbook/tree/0.2.0) (2016-05-10) 164 | [Full Changelog](https://github.com/chef-partners/dcos-cookbook/compare/0.1...0.2.0) 165 | 166 | **Merged pull requests:** 167 | 168 | - Updates source URL for the dcos\_generate\_config.sh to match dcos.io docs [\#3](https://github.com/chef-partners/dcos-cookbook/pull/3) ([mattray](https://github.com/mattray)) 169 | 170 | ## [0.1](https://github.com/chef-partners/dcos-cookbook/tree/0.1) (2016-04-19) 171 | **Merged pull requests:** 172 | 173 | - Initial release [\#1](https://github.com/chef-partners/dcos-cookbook/pull/1) ([mattray](https://github.com/mattray)) 174 | 175 | 176 | 177 | \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* 178 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------