Skip to content

Commit e61622a

Browse files
change region and add user in ansible
1 parent 4bd247b commit e61622a

File tree

8 files changed

+15
-13
lines changed

8 files changed

+15
-13
lines changed

01-jenkins-setup/ansible/scripts/get-ssh-pub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
import json
33
import sys
44

5-
client = boto3.client('ssm', region_name='us-east-1')
5+
client = boto3.client('ssm', region_name='us-west-2')
66
response = client.get_parameter(Name=sys.argv[1], WithDecryption=True)
77
print(response['Parameter']['Value'])

01-jenkins-setup/jenkins-agent.pkr.hcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ locals {
1515
source "amazon-ebs" "jenkins" {
1616
ami_name = "${local.app_name}"
1717
instance_type = "t2.micro"
18-
region = "us-east-1"
19-
availability_zone = "us-east-1c"
18+
region = "us-west-2"
19+
availability_zone = "us-west-2b"
2020
source_ami = "${var.ami_id}"
2121
ssh_username = "ubuntu"
2222
iam_instance_profile = "jenkins-instance-profile"
@@ -31,6 +31,7 @@ build {
3131

3232
provisioner "ansible" {
3333
playbook_file = "ansible/jenkins-agent.yaml"
34+
user = "ubuntu"
3435
extra_arguments = [ "--extra-vars", "public_key_path=${var.public_key_path}", "--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa" ]
3536
}
3637

01-jenkins-setup/jenkins-controller.pkr.hcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ locals {
1515
source "amazon-ebs" "jenkins" {
1616
ami_name = "${local.app_name}"
1717
instance_type = "t2.micro"
18-
region = "us-east-1"
19-
availability_zone = "us-east-1d"
18+
region = "us-west-2"
19+
availability_zone = "us-west-2b"
2020
source_ami = "${var.ami_id}"
2121
ssh_username = "ubuntu"
2222
tags = {
@@ -30,6 +30,7 @@ build {
3030

3131
provisioner "ansible" {
3232
playbook_file = "ansible/jenkins-controller.yaml"
33+
ssh_username = "ubuntu"
3334
extra_arguments = [ "--extra-vars", "ami-id=${var.ami_id} efs_mount_point=${var.efs_mount_point}", "--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa" ]
3435
}
3536

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
provider "aws" {
2-
region = "us-east-1"
2+
region = "us-west-2"
33
}
44

55
module "ec2_instance" {
66
source = "../modules/ec2"
77
instance_name = "jenkins-agent"
88
ami_id = "ami-0fe5ed92a8c77d79f"
99
instance_type = "t2.small"
10-
key_name = "jenkinskey"
10+
key_name = "techiescamp"
1111
subnet_ids = ["subnet-046c3f4390fc51b7e", "subnet-02727435b393c516c", "subnet-0ed1c80066f1be7ed"]
1212
instance_count = 1
1313
}

01-jenkins-setup/terraform/efs/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
provider "aws" {
2-
region = "us-east-1"
2+
region = "us-west-2"
33
}
44

55
module "efs_module" {

01-jenkins-setup/terraform/iam/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
provider "aws" {
2-
region = "us-east-1"
2+
region = "us-west-2"
33
}
44

55
module "jenkins_iam" {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
provider "aws" {
2-
region = "us-east-1"
2+
region = "us-west-2"
33
}
44

55
module "lb-asg" {
66
source = "../modules/lb-asg"
77
subnets = ["subnet-046c3f4390fc51b7e", "subnet-02727435b393c516c", "subnet-0ed1c80066f1be7ed"]
88
ami_id = "ami-0e9419006a1fc1387"
99
instance_type = "t2.small"
10-
key_name = "jenkinskey"
10+
key_name = "techiescamp"
1111
environment = "dev"
1212
vpc_id = "vpc-0872a2ffd55e763ca"
1313
}

01-jenkins-setup/terraform/modules/ec2/variable.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
provider "aws" {
2-
region = "us-east-1"
2+
region = "us-west-2"
33
}
44

55
variable "instance_name" {
@@ -19,7 +19,7 @@ variable "instance_type" {
1919

2020
variable "key_name" {
2121
type = string
22-
default = "jenkinskey"
22+
default = "techiescamp"
2323
}
2424

2525
variable "security_group_ids" {

0 commit comments

Comments
 (0)