Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petersonwsantos/puppet-control-repo
PUPPET - Control Repository
https://github.com/petersonwsantos/puppet-control-repo
aws codecommit puppetlabs serverless
Last synced: about 15 hours ago
JSON representation
PUPPET - Control Repository
- Host: GitHub
- URL: https://github.com/petersonwsantos/puppet-control-repo
- Owner: petersonwsantos
- Created: 2017-07-01T17:42:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-08T14:14:02.000Z (about 7 years ago)
- Last Synced: 2024-05-31T04:42:39.417Z (6 months ago)
- Topics: aws, codecommit, puppetlabs, serverless
- Language: Ruby
- Homepage:
- Size: 532 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
AWS(EC2 userdata / CodeCommit ) and Puppet Serverless
======================================================EC2 Userdata
---------------
When you launch an instance in Amazon EC2, you have the option of passing user data to the instance that can be used to perform common automated configuration tasks and even run scripts after the instance starts.The script **userdata-puppetagent.bash** install puppet-agent and applies the settings according with tag **puppet_profile** of instance EC2.
**Step 1:** Create an AWS CodeCommit Repository
**Step 2:** Create Role for clone CodeCommit repository and get tag EC2
**IAM RoLe** (for clone CodeCommit repository and get tag EC2):
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1497632792000",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeTags"
],
"Resource": [
"*"
]
},
{
"Sid": "Stmt1497632920000",
"Effect": "Allow",
"Action": [
"codecommit:BatchGetRepositories",
"codecommit:Get*",
"codecommit:List*"
],
"Resource": [
"arn:aws:codecommit:us-east-2:210177016610:aws-puppet-masterless-distribuited"
]
}
]
}
```
**Step 3:** Launch EC2 Instance (with IAM Role and tag name=puppet_profile/key=essential_linux )**Userdata:**
```bash
#!/bin/bash# 'Y' to AWS code commit and "N" to other public git repo
CODE_COMMIT="Y"
# Repository Puppet Serverless
REPO_PUPPET="https://git-codecommit.us-east-2.amazonaws.com/v1/repos/aws-puppet-serverless-distribuited"curl https://raw.githubusercontent.com/petersonwsantos/puppet-repo-aws/master/bootstrap-puppetagent.bash | bash -s -- $CODE_COMMIT $REPO_PUPPET
```