Skip to content

Commit

Permalink
Merge pull request #5 from vladgh/dev
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
vladgh committed Oct 25, 2015
2 parents 9a9201b + be0ab02 commit 332158c
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 52 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This project is still in a prototype development stage.

## Overview
Controls Vlad's environments.
Vlad's Puppet Control Repo.

## Description
### Puppetfile
Expand All @@ -19,25 +19,23 @@ This file can override several settings whenever the Puppet master is serving
nodes assigned to that environment.
[Config Files: environment.conf](https://docs.puppetlabs.com/puppet/latest/reference/config_file_environment.html)

### data
### bin/
Contains various executable scripts.

### data/
Contains the hiera data files. It's intended to serve as a base only, for
public data, and it should be overwritten or ammended with data from private
public data, and it should be overwritten or amended with data from private
sources.

### dist/
Contains organization-specific roles and profiles.
This directory is specified as a modulepath in environment.conf
[Designing Puppet – Roles and Profiles.](http://www.craigdunn.org/2012/05/239/)

### hooks/
Contains GIT hooks.

### manifests/
Contains Puppet's main manifests:
- `site.pp`

### provision/
Contains the scripts and files that are used to spin up the nodes.
Contains Puppet's manifests:
- `bootstrap.pp`: the bootstrapping manifest
- `site.pp`: the main manifest

## License ##
Licensed under the Apache License, Version 2.0.
6 changes: 3 additions & 3 deletions dist/profile/manifests/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
} else {
$user = 'root'
}
$authorized_keys = hiera_hash('authorized_keys', undef)
if ($authorized_keys) {
$ssh_authorized_keys = hiera_hash('ssh_authorized_keys', undef)
if ($ssh_authorized_keys != undef) {
create_resources(
'ssh_authorized_key',
$authorized_keys,
$ssh_authorized_keys,
{ user => $user }
)
}
Expand Down
61 changes: 25 additions & 36 deletions dist/profile/manifests/ec2.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,39 @@
])

# AWS SDK for Ruby
package {'aws-sdk':
ensure => installed,
package {'AWS SDK CLI':
ensure => present,
name => 'aws-sdk',
provider => 'puppet_gem',
}

# AWS CloudFormation scripts
package {'AWS CloudFormation':
ensure => installed,
ensure => present,
name => 'aws-cfn-bootstrap',
source => 'https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz',
provider => 'pip',
}

# AWS CodeDeploy
# wget::fetch {'CodeDeploy Deb':
# source => 'https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/codedeploy-agent_all.deb',
# destination => '/tmp/codedeploy-agent_all.deb',
# }
# package {'CodeDeploy Agent':
# ensure => latest,
# name => 'codedeploy-agent',
# source => '/tmp/codedeploy-agent_all.deb',
# provider => dpkg,
# require => [
# Wget::Fetch['CodeDeploy Deb'],
# Package['ruby2.0', 'gdebi-core']
# ],
# }
# service {'CodeDeploy Service':
# ensure => running,
# enable => true,
# name => 'codedeploy-agent',
# require => Package['CodeDeploy Agent'],
# }

# Docker-Compose
# wget::fetch {'Docker-Compose':
# source => "https://github.com/docker/compose/releases/download/1.4.0/docker-compose-${::kernel}-${::os['hardware']}",
# destination => '/usr/local/bin/docker-compose',
# require => Class['Docker'],
# }
# file {'/usr/local/bin/docker-compose':
# mode => '0755',
# require => Wget::Fetch['Docker-Compose'],
# }
#AWS CodeDeploy
wget::fetch {'CodeDeploy Deb':
source => 'https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/codedeploy-agent_all.deb',
destination => '/tmp/codedeploy-agent_all.deb',
}
package {'CodeDeploy Agent':
ensure => present,
name => 'codedeploy-agent',
source => '/tmp/codedeploy-agent_all.deb',
provider => dpkg,
require => [
Wget::Fetch['CodeDeploy Deb'],
Package['ruby2.0', 'gdebi-core']
],
}
service {'CodeDeploy Service':
ensure => running,
enable => true,
name => 'codedeploy-agent',
require => Package['CodeDeploy Agent'],
}
}

2 changes: 2 additions & 0 deletions dist/profile/spec/classes/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

it { should contain_service('puppet').with_ensure('stopped').with_enable('false') }
it { should contain_service('mcollective').with_ensure('stopped').with_enable('false') }

it { is_expected.to contain_ssh_authorized_key('testkey') }
end
end
end
Expand Down
8 changes: 7 additions & 1 deletion dist/profile/spec/classes/ec2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
it { should contain_package('ruby2.0') }
it { should contain_package('gdebi-core') }

it { should contain_package('aws-sdk').with_provider('puppet_gem') }
it { should contain_package('AWS SDK CLI').with_name('aws-sdk').with_provider('puppet_gem') }

it { should contain_package('AWS CloudFormation').with_name('aws-cfn-bootstrap').with_provider('pip') }

it { should contain_package('wget') }
it { should contain_wget__fetch('CodeDeploy Deb') }
it { should contain_package('CodeDeploy Agent').with_name('codedeploy-agent').with_provider('dpkg') }
it { should contain_service('CodeDeploy Service').with_name('codedeploy-agent') }
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions dist/profile/spec/fixtures/hiera/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ classes:
- stdlib
- apt

ssh_authorized_keys:
testkey: {}
2 changes: 1 addition & 1 deletion manifests/bootstrap.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

# Install and configure R10K
# FIXME: Temporary fix until a new version of r10k (this is already in master)
# FIXME: Temporary fix until R10K > 2.0.3 (this is already in master)
file {'/etc/puppetlabs/r10k':
ensure => 'directory',
owner => 'root',
Expand Down

0 comments on commit 332158c

Please sign in to comment.