Sha256: e934cb0fd066d3f004069ab4af844c9a081cceeb5b634a0432319c08d09fb7d9

Contents?: true

Size: 1.34 KB

Versions: 8

Compression:

Stored size: 1.34 KB

Contents

# installs Amazon's awscli tools
# mod by rpc to include epel

case node['platform']
  when 'debian', 'ubuntu'
    file = "/usr/local/bin/aws"
    cmd = "apt-get install -y python-pip && pip install awscli"
  when 'redhat', 'centos', 'fedora', 'amazon', 'scientific'
    # must include epel for centos.  For now do in roles until we fix egt-get-cookbooks.sh
    #include_recipe "mu-utility::epel"
    file = "/usr/bin/aws"
    cmd = "yum -y install python-pip && pip install awscli"
end
r = execute "install awscli" do
  command cmd
  not_if { ::File.exists?(file) }
  if node['awscli']['compile_time']
    action :nothing
  end
end
if node['awscli']['compile_time']
  r.run_action(:run)
end

if node['awscli']['config_profiles']
  config_file="/root/.aws/config"

  r = directory ::File.dirname(config_file) do
    recursive true
    owner 'root'
    group 'root'
    mode 00700
    not_if { ::File.exists?(::File.dirname(config_file)) }
    if node['awscli']['compile_time']
      action :nothing
    end
  end
  if node['awscli']['compile_time']
    r.run_action(:create)
  end

  r = template config_file do
    mode 00600
    owner 'root'
    group 'root'
    source 'config.erb'
    not_if { ::File.exists?(config_file) }
    if node['awscli']['compile_time']
      action :nothing
    end
  end
  if node['awscli']['compile_time']
    r.run_action(:create)
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cloud-mu-2.0.0.pre.alpha7 cookbooks/awscli/recipes/default.rb
cloud-mu-2.0.0.pre.alpha6 cookbooks/awscli/recipes/default.rb
cloud-mu-2.0.0.pre.alpha5 cookbooks/awscli/recipes/default.rb
cloud-mu-2.0.0.pre.alpha4 cookbooks/awscli/recipes/default.rb
cloud-mu-2.0.0.pre.alpha3 cookbooks/awscli/recipes/default.rb
cloud-mu-2.0.0.pre.alpha2 cookbooks/awscli/recipes/default.rb
cloud-mu-2.0.0.pre.alpha cookbooks/awscli/recipes/default.rb
cloud-mu-1.9.0.pre.beta cookbooks/awscli/recipes/default.rb