Skip to content

Re-integrate work from 20181205 demo to master #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 116 commits into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
4d0ebf7
Ansible installs CodeDeploy through cloud-init
obscurerichard Dec 5, 2018
5d9da7b
Fix format of Terraform variable
obscurerichard Dec 5, 2018
294ceaa
Fix shell idiom
obscurerichard Dec 5, 2018
278fc42
Install git before using a git ansible source
obscurerichard Dec 5, 2018
b2d15fa
Fix up prepEnv call
obscurerichard Dec 5, 2018
6f78d88
Attempt to run Ansible another way
obscurerichard Dec 5, 2018
58d9490
Change instance size and ssh security
obscurerichard Dec 5, 2018
0bf9836
Use ansible-playbook, not ansible for running locally
obscurerichard Dec 5, 2018
c8bf6b2
Switch to centos user to install codedeploy
obscurerichard Dec 5, 2018
e5b8fed
Start breaking out CodeDeploy scripts and roles
obscurerichard Dec 5, 2018
17f50ed
Fix directory
obscurerichard Dec 5, 2018
d7002f9
Do not cd - it caused a regression
obscurerichard Dec 5, 2018
e0fd2c4
Attempt to get CodeDeploy policies in place
obscurerichard Dec 5, 2018
f0bd308
Make names unique
obscurerichard Dec 5, 2018
176d785
Expand permissions
obscurerichard Dec 5, 2018
1141ee9
Match up role and policy
obscurerichard Dec 5, 2018
ba7fe6a
Fix up AfterInstall script
obscurerichard Dec 5, 2018
4b81e19
Fix up directory
obscurerichard Dec 5, 2018
37a7679
Use Ansible for StartServer, fix filename
obscurerichard Dec 5, 2018
9a2934a
Fix up ValidateService
obscurerichard Dec 5, 2018
fc1f642
Add auto scaling policy
obscurerichard Dec 5, 2018
5546dd5
Add dev tools. Build python virtualenv at install time.
invalid-email-address Dec 5, 2018
e83258f
Take CodeDeploy training wheels off
obscurerichard Dec 5, 2018
ac857cb
Build CodeDeploy archive on every commit
obscurerichard Dec 5, 2018
bee0a23
Fix archive name
obscurerichard Dec 5, 2018
46e1207
Put directories back where they are in Vagrant
obscurerichard Dec 5, 2018
4929e83
Rip out cooldown
obscurerichard Dec 5, 2018
4580d5f
Extend timeouts
obscurerichard Dec 5, 2018
19824f0
Add debug - why is ansible_bios_version not right
obscurerichard Dec 5, 2018
a364d9f
Add debug - why is ansible_bios_version not right
obscurerichard Dec 5, 2018
c52f182
Fix ec2 fact expression
obscurerichard Dec 6, 2018
3aa516f
Merge branch 'demo-20181205' of github.com:ModusCreateOrg/devops-infr…
obscurerichard Dec 6, 2018
8be9a25
Switch instance type
obscurerichard Dec 6, 2018
a1f9c25
guarantee that nginx will be restarted regardless
sdbruder Dec 10, 2018
964e476
Merge pull request #11 from ModusCreateOrg/fix/troubleshoot
sdbruder Dec 10, 2018
295dc81
initial codedeploy infra
sdbruder Dec 11, 2018
0dd683b
aws_iam_role_policy_attachment fix
sdbruder Dec 11, 2018
33381cd
thats an AWS managed policy, no renaming of it
sdbruder Dec 11, 2018
9c5bb18
jenkinsfile format fix
sdbruder Dec 11, 2018
78257b0
minimum health = 1
sdbruder Dec 11, 2018
7a584b8
jenkinsfile
sdbruder Dec 11, 2018
5bbc719
Jenkinsfile fix
sdbruder Dec 11, 2018
c7328d1
ignoring capacity changes
sdbruder Dec 12, 2018
e7ee091
dependency
sdbruder Dec 12, 2018
762ad0d
no need for config
sdbruder Dec 12, 2018
dcf15a7
no need for a particular config
sdbruder Dec 12, 2018
7cb2b8a
terraform linting
sdbruder Dec 12, 2018
23659a4
naming
sdbruder Dec 12, 2018
cf79917
testing using default adjustment_type
sdbruder Dec 12, 2018
246ad1f
Merge pull request #12 from ModusCreateOrg/feature/terraform-codedeploy
sdbruder Dec 12, 2018
9716999
docker container to build a python virtual environment
sdbruder Dec 13, 2018
f172cfe
shellcheck build.sh
sdbruder Dec 13, 2018
7e207ad
build.sh
sdbruder Dec 13, 2018
5cf688d
Dockerfile
sdbruder Dec 13, 2018
9572b4b
Dockerfile
sdbruder Dec 13, 2018
efa3b4f
starting and stopping it with codedeploy
sdbruder Dec 14, 2018
a617ae4
cleaning
sdbruder Dec 14, 2018
8e3b2a0
cleaning
sdbruder Dec 14, 2018
e60d968
shellchecked
sdbruder Dec 14, 2018
b200d8b
nobody owns /app/socket
sdbruder Dec 14, 2018
5aa36ac
stopit is fine
sdbruder Dec 14, 2018
2cbb31a
ansible
sdbruder Dec 14, 2018
40eb886
/app/socket still
sdbruder Dec 14, 2018
0dd61b3
now using emperor systemd service instead of startit.sh and stopit.sh
sdbruder Dec 17, 2018
10c93f8
uwsgi nginx config
sdbruder Dec 17, 2018
da9504d
fixing /api/something to /something
sdbruder Dec 17, 2018
57621b2
s/nobody/nginx/g
sdbruder Dec 17, 2018
7b305f1
typo
sdbruder Dec 17, 2018
796e432
allow nginx to network connect / relay
sdbruder Dec 17, 2018
1f1d678
moving wsgi app from socket to port
sdbruder Dec 17, 2018
fbc1a68
Merge pull request #13 from ModusCreateOrg/feature/wsgi
sdbruder Dec 20, 2018
9ffab82
bin/spin.sh - stupid simple ab test
sdbruder Dec 20, 2018
0233bc0
removing a tag filter from codedeploy
sdbruder Dec 20, 2018
4983f21
just a NOOP commit
sdbruder Dec 20, 2018
f06a6c8
another NOOP
sdbruder Dec 20, 2018
c9318d2
no need for that comment
sdbruder Dec 20, 2018
bb141ae
instead of relying on tags, associate codedeploy directly with the ASG
sdbruder Dec 20, 2018
002b547
shebang for spin.sh
sdbruder Dec 20, 2018
e0f7ff9
ab tests
sdbruder Dec 21, 2018
a634994
jmeter config
sdbruder Dec 21, 2018
e8d9cd0
jenkins option to run jmeter
sdbruder Dec 21, 2018
414e598
runJmeter.sh
sdbruder Dec 21, 2018
3bc80d6
shellcheck
sdbruder Dec 21, 2018
3bed7a0
chmod a+x runJmeter.sh
sdbruder Dec 21, 2018
d80b950
requires captcha for JMeter
sdbruder Dec 21, 2018
4f4cc39
no -i
sdbruder Dec 21, 2018
5896810
what is going on
sdbruder Dec 21, 2018
f957f1a
fixing path to jmx
sdbruder Dec 21, 2018
3a3b13e
parametrized with -Jusers=, -Jrampup= and -Jtime= (defaults to 2, 0 a…
sdbruder Dec 21, 2018
3b3a510
jmeter parametrized
sdbruder Dec 21, 2018
fca96fe
Tweak jmeter parameters, documentation, scripts
obscurerichard Jan 27, 2019
a61cbee
Redirect more stuff to stderr
obscurerichard Jan 27, 2019
380d52f
Fix up Jenkinsfile quoting
obscurerichard Jan 27, 2019
8e88b66
Escape the Right Way
obscurerichard Jan 27, 2019
b4212d9
Fix shellcheck lint issue
obscurerichard Jan 27, 2019
23868cb
Keep Terraform related parameters together
obscurerichard Jan 27, 2019
08cacef
Fix shell syntax, tweak terraform for deprecation
obscurerichard Jan 27, 2019
1e069ab
Make variable names line up with their jmeter defs
obscurerichard Jan 27, 2019
0116201
Improve docs
obscurerichard Jan 27, 2019
9078434
Add more docs, ignore .ini files, simplify paths
obscurerichard Jan 27, 2019
c2c6622
Archive JMeter jtl file
obscurerichard Jan 27, 2019
7d88d83
Fix host declaration
obscurerichard Jan 27, 2019
0797aca
Ignore jmeter.log file
obscurerichard Jan 28, 2019
a4c5974
Customize JMeter reports more
obscurerichard Jan 28, 2019
7a19cbc
Archive more artifacts
obscurerichard Jan 28, 2019
1ab7b08
Separate patterns with commas
obscurerichard Jan 28, 2019
18ae634
Show build dir before archiving
obscurerichard Jan 28, 2019
49a2ac3
Quiet down zip output for codedeploy
obscurerichard Jan 28, 2019
9dc6a78
Quiet down s3 transfer also
obscurerichard Jan 28, 2019
9ea52cb
Merge pull request #15 from ModusCreateOrg/feature/scale-test
obscurerichard Jan 28, 2019
20f94b3
Add CIS hardening and openscap reporting back in
obscurerichard Jan 28, 2019
1a9437f
Let openscap get network resources
obscurerichard Jan 28, 2019
0efa96e
Use Modus fork of ansible-aws-codedeploy-agent
obscurerichard Jan 28, 2019
fac028b
Punt on CIS hardening until after next preso
obscurerichard Jan 28, 2019
9fb8d7c
Since we are being quiet on S3 cp, echo S3 URL
obscurerichard Jan 28, 2019
cd6c98d
Quiet terraform provider version warnings
obscurerichard Jan 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.ini
*.pyc
*.retry
*.tmp
*~
Expand All @@ -7,4 +9,7 @@
/terraform/.terraform*
/terraform/terraform.tfstate*
/terraform/tf.plan
__pycache__
build/
jmeter.log
venv/
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

FROM centos:latest AS infra-demo

# setup rpm repos, install base packages and create virtual env in a single step
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm \
&& yum update -y \
&& yum install -y \
python36u python36u-libs python36u-devel \
python36u-pip uwsgi-plugin-python36u uwsgi \
gcc make glibc-devel kernel-headers \
pcre pcre-devel pcre2 pcre2-devel \
postgresql-devel \
&& yum clean all \
&& mkdir /app \
&& python3.6 -m venv --copies --clear /app/venv

# Copy in your requirements file
ADD src/requirements.txt /app/requirements.txt

# setup python packages
RUN /app/venv/bin/pip install -U pip \
&& /bin/sh -c "/app/venv/bin/pip install --no-cache-dir -r /app/requirements.txt"
110 changes: 78 additions & 32 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Use the Scripted style of Jenkinsfile in order to
* write more Groovy functions and use variables to
* control the workflow.
*/
*/

import java.util.Random

Expand All @@ -18,7 +18,7 @@ def get_captcha(Long hash_const) {
Random rand = new Random()
def op1 = rand.nextInt(MAX+1)
def op2 = rand.nextInt(MAX+1) + MAX
def op3 = rand.nextInt(MAX+1)
def op3 = rand.nextInt(MAX+1)
def captcha_problem = "CAPTCHA problem: What is the answer to this problem: ${op1} + ${op2} - ${op3}"
Long captcha_answer = op1 + op2 - op3
Long captcha_hash = captcha_answer ^ hash_const
Expand Down Expand Up @@ -46,58 +46,81 @@ final Long XOR_CONST = 3735928559 // 0xdeadbeef
properties([
parameters([
booleanParam(
name: 'Run_Packer',
defaultValue: false,
name: 'Run_Packer',
defaultValue: false,
description: 'Run Packer for this build?'
),
booleanParam(
name: 'Apply_Terraform',
defaultValue: false,
name: 'Apply_Terraform',
defaultValue: false,
description: 'Apply Terraform plan on this build?'
),
booleanParam(
name: 'Destroy_Terraform',
defaultValue: false,
name: 'Destroy_Terraform',
defaultValue: false,
description: 'Destroy Terraform resources?'
),
string(
name: 'Terraform_Targets',
defaultValue: '',
description: '''Specific Terraform resource or resource names to target
(Use this to modify or delete less than the full set of resources'''
),
text(
name: 'Extra_Variables',
defaultValue: '',
description: '''Terraform Variables to define for this run.
Allows you to override declared variables.
Put one variable per line, in JSON or HCL like this:
associate_public_ip_address = "true"'''
),
booleanParam(
name: 'Rotate_Servers',
defaultValue: false,
name: 'Rotate_Servers',
defaultValue: false,
description: """Rotate server instances in Auto Scaling Group?
You should do this if you changed ASG size or baked a new AMI.
"""
"""
),
booleanParam(
name: 'Run_JMeter',
defaultValue: false,
description: "Execute a JMeter load test against the stack"
),
string(
name: 'JMETER_threads',
defaultValue: '2',
description: """number of jmeter threads. Resulting ASG stable sizes for t2.large instances are:
- 2 threads, 3 instances;
- 4 threads, 7 instances;
"""
),
string(
name: 'JMETER_ramp_duration',
defaultValue: '900',
description: 'period in seconds of ramp-up time.'
),
string(
name: 'JMETER_duration',
defaultValue: '1800',
description: 'time in seconds to the whole Jmeter test'
),
string(
name: 'CAPTCHA_Guess',
defaultValue: '',
name: 'CAPTCHA_Guess',
defaultValue: '',
description: captcha_problem
),
string(
name: 'CAPTCHA_Hash',
defaultValue: captcha_hash,
description: 'Hash for CAPTCHA answer (DO NOT modify)'
),
string(
name: 'Terraform_Targets',
defaultValue: '',
description: '''Specific Terraform resource or resource names to target
(Use this to modify or delete less than the full set of resources'''
),
text(
name: 'Extra_Variables',
defaultValue: '',
description: '''Terraform Variables to define for this run.
Allows you to override declared variables.
Put one variable per line, in JSON or HCL like this:
associate_public_ip_address = "true"'''
),
])
])

stage('Preflight') {

// Check CAPTCHA
def should_validate_captcha = params.Run_Packer || params.Apply_Terraform || params.Destroy_Terraform
def should_validate_captcha = params.Run_Packer || params.Apply_Terraform || params.Destroy_Terraform || params.Run_JMeter

if (should_validate_captcha) {
if (params.CAPTCHA_Guess == null || params.CAPTCHA_Guess == "") {
Expand Down Expand Up @@ -155,6 +178,15 @@ if (params.Run_Packer) {
}
}

stage('Build CodeDeploy Archive') {
node {
unstash 'src'
wrap.call({
sh ("./codedeploy/bin/build.sh")
})
}
}

def terraform_prompt = 'Should we apply the Terraform plan?'


Expand Down Expand Up @@ -200,11 +232,25 @@ if (params.Rotate_Servers) {
stage('Rotate Servers') {
node {
unstash 'src'
ansiColor('xterm') {
prepEnv()
wrap.call({
sh ("./bin/rotate-asg.sh infra-demo-asg")
}
})
}
}
}

if (params.Run_JMeter) {
stage('Run JMeter') {
node {
unstash 'src'
wrap.call({
sh ("""
HOST=\$(./bin/terraform.sh output route53-dns)
./bin/jmeter.sh -Jthreads=${params.JMETER_threads} -Jramp_duration=${params.JMETER_ramp_duration} -Jduration=${params.JMETER_duration} -Jhost=\$HOST
ls -l build
""")
archiveArtifacts artifacts: 'build/*.jtl, build/*.xml, build/*.csv, build/*.html', fingerprint: true
})
}
}
}
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,9 @@ In order to make developing the Ansible playbooks faster, a Vagrantfile is provi

Install [Vagrant](https://www.vagrantup.com/). Change directory into the root of the repository at the command line and issue the command `vagrant up`. You can add or edit Ansible playbooks and support scripts then re-run the provisioning with `vagrant provision` to refine the remediations. This is more efficient that re-running packer and baking new AMIs for every change.

### Jenkins

A `Jenkinsfile` is provided that will allow Jenkins to execute Packer and Terraform. In order for Jenkins to do this, it needs to have AWS credentials set up, preferably through an IAM role, granting full control of EC2 and VPC resources in that account. Packer needs this in order to create AMIs, key pairs, etc, and Terraform needs this to create a VPC and EC2 resources. This could be pared down further through some careful logging and role work.

The scripts here assume that Jenkins is running on EC2 and uses instance data from the Jenkins executor to infer what VPC and subnet to launch the new EC2 instance into. The AWS profile IAM user associated with your Jenkins instance or the Jenkins user's AWS credentials should have full control of EC2 in the account you are using.

This script relies on Jenkins having a secret file containing the Google application credentials in JSON with the id "terraform-demo.json". You will need to add that to your Jenkins server's credentials.

### Terraform

This Terraform setup stores its state in Amazon S3 and uses DynamoDB for locking. There is a bit of setup required to bootstrap that configuration. Yu can use [this repository](https://github.com/monterail/terraform-bootstrap-example) to use Terraform to do that bootstrap process. The `backend.tfvars` file in that repo should be modified as follows to work with this project:
This Terraform setup stores its state in Amazon S3 and uses DynamoDB for locking. There is a bit of setup required to bootstrap that configuration. You can use [this repository](https://github.com/monterail/terraform-bootstrap-example) to use Terraform to do that bootstrap process. The `backend.tfvars` file in that repo should be modified as follows to work with this project:

(Replace us-east-1 and XXXXXXXXXXXX with the AWS region and your account ID)
```
Expand All @@ -97,10 +89,34 @@ These commands will then set up cloud resources using terraform:
# check to see if everything worked - use the same variables here as above
terraform destroy -var 'domain=example.net'

Alternatively, use the wrapper script in `bin/terraform.sh` which will work interactively or from CI:

bin/terraform.sh plan
bin/terraform.sh apply
bin/terraform.sh plan-destroy
bin/terraform.sh destroy

This assumes that you already have a Route 53 domain in your AWS account created.
You need to either edit variables.tf to match your domain and AWS zone or specify these values as command line `var` parameters.

The application loads an image from Google storage. To get it loading correctly, look in the X file and replace `example-media-website-storage.storage.googleapis.com` with a DNS reference for your Google storage location.
The application loads an image from Google storage. To get it loading correctly, edit the `application/assets/css/main.css` file and replace `example-media-website-storage.storage.googleapis.com` with a DNS reference for your Google storage location.

### CodeDeploy

The application enclosed in this demo is packaged and deployed using [AWS CodeDeploy](https://aws.amazon.com/codedeploy/). The script `codedeploy/bin/build.sh` will package the application so that it can be deployed on the AMI built with Ansible and Packer.

The application contains both a simple HTML web site, and a Python app that has an API endpoint of `/api/spin` that spins the CPU of the server, in order to more easily test CPU-sensing auto scaling scale-out operations.

### JMeter

A JMeter test harness that will allow testing of a the application
### Jenkins

A `Jenkinsfile` is provided that will allow Jenkins to execute Packer and Terraform, package a CodeDeploy application, and even run JMeter performance tests. In order for Jenkins to do this, it needs to have AWS credentials set up, preferably through an IAM role, granting full control of EC2 and VPC resources in that account, and write access to the S3 bucket used for storing CodeDeploy applications. Packer needs this in order to create AMIs, key pairs, etc, Terraform needs this to create a VPC and EC2 resources, and CodeDeploy needs this to store the artifact it creates. This could be pared down further through some careful logging and role work.

The scripts here assume that Jenkins is running on EC2 and uses instance data from the Jenkins executor to infer what VPC and subnet to launch the new EC2 instance into. The AWS profile IAM user associated with your Jenkins instance or the Jenkins user's AWS credentials should have full control of EC2 in the account you are using.

This script relies on Jenkins having a secret file containing the Google application credentials in JSON with the id "terraform-demo.json". You will need to add that to your Jenkins server's credentials.

# Modus Create

Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Vagrant.configure("2") do |config|
config.vm.box = "bento/centos-7.5"
config.vm.synced_folder ".", "/app"
config.vm.provision "shell", inline: "/app/bin/install-ansible.sh", upload_path: "/home/vagrant/install-ansible.sh"
config.vm.provision "shell", inline: "ansible-playbook -l localhost /app/ansible/local.yml", upload_path: "/home/vagrant/apl.sh"
config.vm.provision "shell", inline: "cd /app/ansible && ansible-playbook -l localhost bakery.yml app-AfterInstall.yml app-StartServer.yml", upload_path: "/home/vagrant/apl.sh"
config.vm.network "forwarded_port", guest: 80, host: 6080, auto_correct: true
end
15 changes: 15 additions & 0 deletions ansible/app-AfterInstall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Use ansible to install the codedeploy agent at boot time through cloudinit

# Because AWS updates the CodeDeploy agent somewhat frequently, baking it into
# the image is an antipattern. It can cause instances to fail to register with
# a CodeDeploy deployment group if the version of CodeDeploy is too old.

# Thanks https://www.tricksofthetrades.net/2017/10/02/ansible-local-playbooks/ for
# the trick on installing locally using "hosts: 127.0.0.1" and "connection:local"
- name: Perform CodeDeploy AfterInstall hook
hosts: 127.0.0.1
connection: local
become: yes
roles:
- app-AfterInstall
10 changes: 10 additions & 0 deletions ansible/app-StartServer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---

# Thanks https://www.tricksofthetrades.net/2017/10/02/ansible-local-playbooks/ for
# the trick on installing locally using "hosts: 127.0.0.1" and "connection:local"
- name: Perform CodeDeploy StartServer hook
hosts: 127.0.0.1
connection: local
become: yes
roles:
- app-StartServer
3 changes: 2 additions & 1 deletion ansible/local.yml → ansible/bakery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
roles:
- nginxinc.nginx
- prepare-web-content
- prepare-codedeploy

- name: Harden Server
hosts: 127.0.0.1
connection: local
become: yes
roles:
- extra-cis-remediation
- MindPointGroup.RHEL7-CIS
#- MindPointGroup.RHEL7-CIS
- scan-openscap
15 changes: 15 additions & 0 deletions ansible/cloudinit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Use ansible to install the codedeploy agent at boot time through cloudinit

# Because AWS updates the CodeDeploy agent somewhat frequently, baking it into
# the image is an antipattern. It can cause instances to fail to register with
# a CodeDeploy deployment group if the version of CodeDeploy is too old.

# Thanks https://www.tricksofthetrades.net/2017/10/02/ansible-local-playbooks/ for
# the trick on installing locally using "hosts: 127.0.0.1" and "connection:local"
- name: Install CodeDeploy agent
hosts: 127.0.0.1
connection: local
become: yes
roles:
- ansible-aws-codedeploy-agent
15 changes: 15 additions & 0 deletions ansible/codedeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Use ansible to install the codedeploy agent at boot time through cloudinit

# Because AWS updates the CodeDeploy agent somewhat frequently, baking it into
# the image is an antipattern. It can cause instances to fail to register with
# a CodeDeploy deployment group if the version of CodeDeploy is too old.

# Thanks https://www.tricksofthetrades.net/2017/10/02/ansible-local-playbooks/ for
# the trick on installing locally using "hosts: 127.0.0.1" and "connection:local"
- name: Install CodeDeploy agent
hosts: 127.0.0.1
connection: local
become: yes
roles:
- ansible-aws-codedeploy-agent
9 changes: 9 additions & 0 deletions ansible/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
# NGINX web server
- src: nginxinc.nginx

# AWS CodeDeploy agent
# The original version of this role in Ansible Galaxy
# is telus/ansible-aws-codedeploy-agent
#
# It has not been updated for Ansible 2.7 :(
# However CareerBuilder's fork of it works with 2.7 :)
# And the ModusCreateOrg fork has been fixed to avoid running stuff from /tmp
- src: https://github.com/ModusCreateOrg/ansible-aws-codedeploy-agent

Loading