Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ pipeline {
}
}
steps {
sh 'ansible-playbook ec2-user/tasks/main.yml -e name:dev
sh '''
ansible-playbook ec2-Jenkins/tasks/main.yml -e name=dev
'''
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# jenkins
an ec2 server with a new security group attached and jenkins installed
an ec2 server with a new security group attached and jenkins installed
creating a new record set and attach it to the new created ec2-server.
name of ec2, security group, and record set have variable name while running ANSIBLE-PLAYBOOK EC2-JENKINS/TASKS/MAIN/YML add an enviroment variable that is "-e name=dept or whatever is required"
10 changes: 5 additions & 5 deletions ec2-Jenkins/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
tasks:
# create a security group
- ec2_group:
vpc_id: vpc-03b63bf99652de6a0
region: ap-southeast-1
vpc_id: vpc-0988be901ef00bb64
region: ap-south-1
name: "{{ name }}-jenkins-sg"
description: security group with all traffic allow
rules:
Expand All @@ -24,13 +24,13 @@
instance_type: t2.micro
instance_tags:
Name: "{{ name }}-jenkins-server"
image: ami-0ff89c4ce7de192ea
image: ami-i-0189e229a8fb9bb9c
group_id: "{{ sg_info.group_id }}"
region: ap-southeast-1
region: ap-south-1
count_tag:
Name: "{{ name }}-jenkins-server"
exact_count: 1
vpc_subnet_id: subnet-02ce50a9cc336f6ed
vpc_subnet_id: subnet-0e527232c3edba061
assign_public_ip: yes
wait: yes
user_data: |
Expand Down