-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathknife-org.rb
123 lines (107 loc) · 4.16 KB
/
knife-org.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
# All of the below override settings in your knife.rb
#
# Put secrets in credentials.rb, not here.
#
Chef::Config.instance_eval do
#
# You must at a minimum set your organization
#
organization "organization"
#
# The chef server for this organization
# You must set this if you are not on opscode platform
#
# for localhost install
# chef_server_url "http://localhost:4000/"
# for vagrants
# chef_server_url "http://33.33.33.20:4000/"
# for opscode platform:
# chef_server_url "https://api.opscode.com/organizations/#{organization}"
# Override paths to Cluster definitions
#
# cluster_path [ "#{homebase}/clusters", "#{homebase}/vendor/internal/clusters" ]
# Override paths to Cookbooks
#
# cookbook_path [
# "#{homebase}/cookbooks",
# "#{homebase}/site-cookbooks",
# "#{homebase}/vendor/opscode/cookbooks",
# "#{homebase}/vendor/internal/cookbooks",
# ]
# # set the `knife cluster proxy` to capture traffic to the set_hostname (see the route53 cookbook):
# Chef::Config[:cluster_proxy_patterns] = ["*internal.YOUR-ROUTE53-DOMAIN.com*"]
# ===========================================================================
#
# Amazon EC2 Settings
#
# you can remove this section if not in EC2
#
# This is org-wide. No dashes or spaces please.
#
# Chef::Config.knife[:aws_account_id] = "XXXX"
# Best practice is to make per-user accounts w/ IAM, placed in knife-user-YOU.rb --
# but if you want to use an org-wide AWS key, place it here
#
# Chef::Config.knife[:aws_access_key_id] = "XXXX"
# Chef::Config.knife[:aws_secret_access_key] = "YYYY"
# Add your own AMIs to the hash below
#
# Change `NAME_FOR_AMI` to a helpful identifier. For example, our standard
# Ubuntu 11.04 AMI is `ironfan-natty`: it has lines for each permutation of
# bit and backing we use:
#
# %w[us-east-1 64-bit ebs ironfan-natty ] => { :image_id => 'ami-12345678', :ssh_user => 'ubuntu', :bootstrap_distro => "ubuntu11.04-ironfan", },
# %w[us-east-1 32-bit ebs ironfan-natty ] => { :image_id => 'ami-acbdef01', :ssh_user => 'ubuntu', :bootstrap_distro => "ubuntu11.04-ironfan", },
# %w[us-east-1 64-bit instance ironfan-natty ] => { :image_id => 'ami-98765432', :ssh_user => 'ubuntu', :bootstrap_distro => "ubuntu11.04-ironfan", },
# # ...
# %w[us-west-1 64-bit instance ironfan-natty ] => { :image_id => 'ami-ab12ab12', :ssh_user => 'ubuntu', :bootstrap_distro => "ubuntu11.04-ironfan", },
#
# Then a typical cluster definition file might specify
#
# cloud do
# image 'ironfan-natty'
# flavor 'c1.xlarge'
# backing 'ebs'
# image_name 'natty'
# availability_zones ['us-east-1d']
# # ...
# end
#
# ironfan knows that a c1.xlarge is 64-bit, and that the us-east-1d AZ
# is in the us-east-1 region, and so chooses the correct AMI.
#
Chef::Config[:ec2_image_info] ||= {}
#ec2_image_info.merge!({
# %w[us-east-1 64-bit ebs ironfan-natty ] => { :image_id => 'FIXME_IN_KNIFE-ORG.rb', :ssh_user => 'ubuntu', :bootstrap_distro => "ubuntu10.04-ironfan", },
# })
Chef::Log.debug("Loaded #{__FILE__}, now have #{ec2_image_info.size} ec2 images")
# For an AWS cloud, tell knife to use the public hostname not the fqdn
#
# knife[:ssh_address_attribute] = 'cloud.public_hostname'
# if set, uses the system account to log in
#
# knife[:ssh_user] = 'ubuntu'
# Don't complain about ssh known_hosts
knife[:host_key_verify] = false # yeah... so 0.10.7+ uses one, 0.10.4 the other.
knife[:no_host_key_verify] = true
# ===========================================================================
#
# Vagrant (VM) Settings
#
# you can remove this section if not using VMs
#
# Map of facet name to IP address.
# Final IP address is
#
# {host_network_base}.{host_network_ip_mapping + facet_index}
#
# For example, 'cocina-elasticsearch-6' would be '33.33.33.46'
#
# knife[:host_network_base] = '33.33.33'
# knife[:host_network_ip_mapping] = {
# :chef_server => 20,
# :sandbox => 30,
# :elasticsearch => 40,
# }
end