Skip to content
This repository was archived by the owner on Apr 15, 2020. It is now read-only.

Commit d5b1ff9

Browse files
committed
Init
0 parents  commit d5b1ff9

File tree

18 files changed

+624
-0
lines changed

18 files changed

+624
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.idea/
2+
.terraform/
3+
terraform.tfstate
4+
terraform.tfstate.backup
5+
/terraform.tfvars
6+
/.kitchen/
7+
/terraform.test.tfvars
8+
/terraform.tfstate.d/
9+
/id_rsa_test
10+
/id_rsa_test.pub
11+
/test_data.zip
12+
/.terraform.tfstate.lock.info

.kitchen.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
driver:
3+
name: terraform
4+
variable_files:
5+
- terraform.test.tfvars
6+
7+
provisioner:
8+
name: terraform
9+
10+
platforms:
11+
- name: centos-7
12+
13+
transport:
14+
name: ssh
15+
ssh_key: ./id_rsa_test
16+
17+
verifier:
18+
name: terraform
19+
groups:
20+
- name: jenkins-server
21+
hostnames: jenkins_server_dns
22+
username: centos
23+
24+
suites:
25+
- name: jenkins-server

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
sudo: enabled
2+
3+
language: ruby
4+
5+
rvm:
6+
- 2.4.1
7+
8+
cache: bundler
9+
10+
before_install:
11+
- sudo apt-get install wget unzip
12+
- wget https://releases.hashicorp.com/terraform/0.11.5/terraform_0.11.5_linux_amd64.zip
13+
- unzip terraform_0.11.5_linux_amd64.zip -d ~/bin
14+
- source ~/.profile
15+
16+
install:
17+
- bundle install
18+
19+
before_script:
20+
- openssl aes-256-cbc -K $encrypted_097192a4cd4d_key -iv $encrypted_097192a4cd4d_iv -in test_data.zip.enc -out test_data.zip -d
21+
- unzip test_data.zip -d .
22+
23+
script:
24+
- bundle exec kitchen create
25+
- bundle exec kitchen converge
26+
- bundle exec kitchen setup
27+
- bundle exec kitchen verify
28+
29+
after_script:
30+
- bundle exec kitchen destroy

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org/' do
2+
gem 'test-kitchen'
3+
gem 'kitchen-terraform'
4+
end

Gemfile.lock

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.5.2)
5+
public_suffix (>= 2.0.2, < 4.0)
6+
aws-sdk (2.11.27)
7+
aws-sdk-resources (= 2.11.27)
8+
aws-sdk-core (2.11.27)
9+
aws-sigv4 (~> 1.0)
10+
jmespath (~> 1.0)
11+
aws-sdk-resources (2.11.27)
12+
aws-sdk-core (= 2.11.27)
13+
aws-sigv4 (1.0.2)
14+
azure_mgmt_resources (0.16.0)
15+
ms_rest_azure (~> 0.10.0)
16+
builder (3.2.3)
17+
coderay (1.1.2)
18+
concurrent-ruby (1.0.5)
19+
diff-lcs (1.3)
20+
docker-api (1.34.2)
21+
excon (>= 0.47.0)
22+
multi_json
23+
domain_name (0.5.20170404)
24+
unf (>= 0.0.5, < 1.0.0)
25+
dry-configurable (0.7.0)
26+
concurrent-ruby (~> 1.0)
27+
dry-container (0.6.0)
28+
concurrent-ruby (~> 1.0)
29+
dry-configurable (~> 0.1, >= 0.1.3)
30+
dry-core (0.4.5)
31+
concurrent-ruby (~> 1.0)
32+
dry-equalizer (0.2.0)
33+
dry-logic (0.4.2)
34+
dry-container (~> 0.2, >= 0.2.6)
35+
dry-core (~> 0.2)
36+
dry-equalizer (~> 0.2)
37+
dry-types (0.12.2)
38+
concurrent-ruby (~> 1.0)
39+
dry-configurable (~> 0.1)
40+
dry-container (~> 0.3)
41+
dry-core (~> 0.2, >= 0.2.1)
42+
dry-equalizer (~> 0.2)
43+
dry-logic (~> 0.4, >= 0.4.2)
44+
inflecto (~> 0.0.0, >= 0.0.2)
45+
dry-validation (0.11.1)
46+
concurrent-ruby (~> 1.0)
47+
dry-configurable (~> 0.1, >= 0.1.3)
48+
dry-core (~> 0.2, >= 0.2.1)
49+
dry-equalizer (~> 0.2)
50+
dry-logic (~> 0.4, >= 0.4.0)
51+
dry-types (~> 0.12.0)
52+
erubis (2.7.0)
53+
excon (0.62.0)
54+
faraday (0.14.0)
55+
multipart-post (>= 1.2, < 3)
56+
faraday-cookie_jar (0.0.6)
57+
faraday (>= 0.7.4)
58+
http-cookie (~> 1.0.0)
59+
ffi (1.9.23)
60+
gssapi (1.2.0)
61+
ffi (>= 1.0.1)
62+
gyoku (1.3.1)
63+
builder (>= 2.1.2)
64+
hashie (3.5.7)
65+
htmlentities (4.3.4)
66+
http-cookie (1.0.3)
67+
domain_name (~> 0.5)
68+
httpclient (2.8.3)
69+
inflecto (0.0.2)
70+
inifile (3.0.0)
71+
inspec (2.1.0)
72+
addressable (~> 2.4)
73+
faraday (>= 0.9.0)
74+
hashie (~> 3.4)
75+
htmlentities
76+
json (>= 1.8, < 3.0)
77+
method_source (~> 0.8)
78+
mixlib-log
79+
parallel (~> 1.9)
80+
parslet (~> 1.5)
81+
pry (~> 0)
82+
rspec (~> 3)
83+
rspec-its (~> 1.2)
84+
rubyzip (~> 1.1)
85+
semverse
86+
sslshake (~> 1.2)
87+
thor (~> 0.19)
88+
tomlrb (~> 1.2)
89+
train (~> 1.2)
90+
jmespath (1.3.1)
91+
json (2.1.0)
92+
kitchen-inspec (0.23.1)
93+
hashie (~> 3.4)
94+
inspec (>= 0.34.0, < 3.0.0)
95+
test-kitchen (~> 1.6)
96+
kitchen-terraform (3.3.0)
97+
dry-types (~> 0.9)
98+
dry-validation (~> 0.10)
99+
kitchen-inspec (~> 0.18)
100+
mixlib-shellout (~> 2.2)
101+
test-kitchen (~> 1.16)
102+
little-plugger (1.1.4)
103+
logging (2.2.2)
104+
little-plugger (~> 1.1)
105+
multi_json (~> 1.10)
106+
method_source (0.9.0)
107+
mixlib-install (3.9.3)
108+
mixlib-shellout
109+
mixlib-versioning
110+
thor
111+
mixlib-log (2.0.3)
112+
mixlib-shellout (2.3.2)
113+
mixlib-versioning (1.2.2)
114+
ms_rest (0.7.2)
115+
concurrent-ruby (~> 1.0)
116+
faraday (~> 0.9)
117+
timeliness (~> 0.3)
118+
ms_rest_azure (0.10.3)
119+
concurrent-ruby (~> 1.0)
120+
faraday (~> 0.9)
121+
faraday-cookie_jar (~> 0.0.6)
122+
ms_rest (~> 0.7.2)
123+
multi_json (1.13.1)
124+
multipart-post (2.0.0)
125+
net-scp (1.2.1)
126+
net-ssh (>= 2.6.5)
127+
net-ssh (4.2.0)
128+
net-ssh-gateway (1.3.0)
129+
net-ssh (>= 2.6.5)
130+
nori (2.6.0)
131+
parallel (1.12.1)
132+
parslet (1.8.2)
133+
pry (0.11.3)
134+
coderay (~> 1.1.0)
135+
method_source (~> 0.9.0)
136+
public_suffix (3.0.2)
137+
rspec (3.7.0)
138+
rspec-core (~> 3.7.0)
139+
rspec-expectations (~> 3.7.0)
140+
rspec-mocks (~> 3.7.0)
141+
rspec-core (3.7.1)
142+
rspec-support (~> 3.7.0)
143+
rspec-expectations (3.7.0)
144+
diff-lcs (>= 1.2.0, < 2.0)
145+
rspec-support (~> 3.7.0)
146+
rspec-its (1.2.0)
147+
rspec-core (>= 3.0.0)
148+
rspec-expectations (>= 3.0.0)
149+
rspec-mocks (3.7.0)
150+
diff-lcs (>= 1.2.0, < 2.0)
151+
rspec-support (~> 3.7.0)
152+
rspec-support (3.7.1)
153+
rubyntlm (0.6.2)
154+
rubyzip (1.2.1)
155+
semverse (2.0.0)
156+
sslshake (1.2.0)
157+
test-kitchen (1.20.0)
158+
mixlib-install (~> 3.6)
159+
mixlib-shellout (>= 1.2, < 3.0)
160+
net-scp (~> 1.1)
161+
net-ssh (>= 2.9, < 5.0)
162+
net-ssh-gateway (~> 1.2)
163+
thor (~> 0.19, < 0.19.2)
164+
winrm (~> 2.0)
165+
winrm-elevated (~> 1.0)
166+
winrm-fs (~> 1.1.0)
167+
thor (0.19.1)
168+
timeliness (0.3.8)
169+
tomlrb (1.2.6)
170+
train (1.3.0)
171+
aws-sdk (~> 2)
172+
azure_mgmt_resources (~> 0.15)
173+
docker-api (~> 1.26)
174+
inifile
175+
json (>= 1.8, < 3.0)
176+
mixlib-shellout (~> 2.0)
177+
net-scp (~> 1.2)
178+
net-ssh (>= 2.9, < 5.0)
179+
winrm (~> 2.0)
180+
winrm-fs (~> 1.0)
181+
unf (0.1.4)
182+
unf_ext
183+
unf_ext (0.0.7.5)
184+
winrm (2.2.3)
185+
builder (>= 2.1.2)
186+
erubis (~> 2.7)
187+
gssapi (~> 1.2)
188+
gyoku (~> 1.0)
189+
httpclient (~> 2.2, >= 2.2.0.2)
190+
logging (>= 1.6.1, < 3.0)
191+
nori (~> 2.0)
192+
rubyntlm (~> 0.6.0, >= 0.6.1)
193+
winrm-elevated (1.1.0)
194+
winrm (~> 2.0)
195+
winrm-fs (~> 1.0)
196+
winrm-fs (1.1.1)
197+
erubis (~> 2.7)
198+
logging (>= 1.6.1, < 3.0)
199+
rubyzip (~> 1.1)
200+
winrm (~> 2.0)
201+
202+
PLATFORMS
203+
ruby
204+
205+
DEPENDENCIES
206+
kitchen-terraform!
207+
test-kitchen!
208+
209+
BUNDLED WITH
210+
1.16.1

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Rodion Fedorov
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Terraform-aws-centos-jenkins
2+
======
3+
4+
[![Build Status](https://travis-ci.org/sorenrix/terraform-aws-centos-jenkins.svg?branch=master)](https://travis-ci.org/sorenrix/terraform-aws-centos-jenkins)
5+
6+
Installs Jenkins and Nginx on EC2 CentOS.
7+
8+
Nginx works as a proxy from 80 to 8080 port
9+
10+
CentOS AMI details: [CentOS AMI on AWS Marketplace](https://aws.amazon.com/marketplace/pp/B00O7WM7QW?ref=cns_1clkPro)
11+
12+
Resources
13+
------
14+
Creates next resources on AWS:
15+
1. EC2 instance (jenkins-server)
16+
2. security group for jenkins-server
17+
3. key_pair for ssh access to jenkins-server
18+
19+
Variables
20+
------
21+
Variables that are used by this module:
22+
1. aws_access_key - AWS account public key
23+
2. aws_secret_key - AWS account private key
24+
3. aws_region - AWS region
25+
4. aws_instance_ami - AMI ID (example: ami-194cdc76)
26+
5. aws_instance_type - EC2 instance Type (example: t2.micro)
27+
6. aws_instance_name - EC2 instance name
28+
7. aws_security_group_name - name of new security group
29+
8. aws_key_pair_name - name of new key_pair
30+
9. aws_key_pair_public_key_path - path to ssh public key (example: /home/admin/.ssh/id_rsa.pub)
31+
10. aws_key_pair_private_key_path - path to ssh private key (example: /home/admin/.ssh/id_rsa)
32+
11. show_jenkins_password - show initialAdminPassword eventually (default: 0 - false)
33+
12. attach_test_uids - attach uniq hash to resources' names (default: 0 - false)

files/conf.nginx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
worker_processes auto;
2+
3+
events {
4+
use epoll;
5+
worker_connections 1024;
6+
multi_accept on;
7+
}
8+
9+
http {
10+
server {
11+
listen 80;
12+
13+
access_log /var/log/nginx/access.log;
14+
error_log /var/log/nginx/error.log;
15+
16+
location / {
17+
proxy_pass http://127.0.0.1:8080;
18+
proxy_http_version 1.1;
19+
20+
proxy_set_header Host $host:$server_port;
21+
proxy_set_header X-Real-IP $remote_addr;
22+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
23+
proxy_set_header X-Forwarded-Proto $scheme;
24+
25+
}
26+
27+
client_header_timeout 60;
28+
client_body_timeout 60;
29+
keepalive_timeout 60;
30+
gzip off;
31+
gzip_comp_level 4;
32+
33+
}
34+
35+
}

0 commit comments

Comments
 (0)