Skip to content

Commit

Permalink
updating stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed May 28, 2024
1 parent 4f0d0e0 commit 428d179
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 47 deletions.
50 changes: 25 additions & 25 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions examples/build.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
packer {
required_plugins {
amazon = {
version = ">= 1.2.8"
source = "github.com/hashicorp/amazon"
}
ansible = {
version = "v1.1.1"
source ="github.com/hashicorp/ansible"
}
}
}

variable subnet_id {}
variable security_group_id {}

source "amazon-ebs" "ubuntu" {
ami_name = "learn-packer-linux-aws"
instance_type = "t2.micro"
source_ami = "ami-07e218d88f8f9c4db"
ssh_username = "ec2-user"
subnet_id = var.subnet_id
security_group_ids = [
var.security_group_id
]
}

build {
name = "learn-packer"
sources = [
"source.amazon-ebs.ubuntu"
]
provisioner "ansible" {
playbook_file = "./playbook.yml"
roles_path = "./ansible/roles"
}
}
7 changes: 7 additions & 0 deletions examples/playbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# playbook.yml
- name: 'Provision Image'
hosts: default
become: true
roles:
- hello_world
49 changes: 27 additions & 22 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
module "network" {
source = "HappyPathway/network/aws"
network_name = "csvd-infra-automation"
region = "us-gov-west-1"
key_name = "csvd-dev-ew-public-network"
private_subnet_cidrs = [
"10.0.5.0/24",
"10.0.6.0/24"
]
public_subnet_cidrs = [
"10.0.7.0/24",
"10.0.8.0/24"
]
availability_zones = [
"us-gov-west-1a",
"us-gov-west-1b",
"us-gov-west-1c"
]
}
#module "network" {
# source = "HappyPathway/network/aws"
# network_name = "csvd-infra-automation"
# region = "us-gov-west-1"
# key_name = "csvd-dev-ew-public-network"
# private_subnet_cidrs = [
# "10.0.5.0/24",
# "10.0.6.0/24"
# ]
# public_subnet_cidrs = [
# "10.0.7.0/24",
# "10.0.8.0/24"
# ]
# availability_zones = [
# "us-gov-west-1a",
# "us-gov-west-1b",
# "us-gov-west-1c"
# ]
#}

#locals {
# proxy_env_vars = {
Expand All @@ -36,7 +36,7 @@ data "aws_iam_policy_document" "s3_access" {


locals {
vpc_id = module.network.vpc_id
vpc_id = "vpc-00576a396ec570b94"
}

resource "aws_codecommit_repository" "ansible" {
Expand Down Expand Up @@ -67,8 +67,13 @@ module "main" {
ansible_repo = aws_codecommit_repository.ansible
vpc_config = {
vpc_id = local.vpc_id
security_group_ids = module.network.admin_sgs
subnets = module.network.private_subnets
security_group_ids = [
"sg-0d828d223df9834a6",
"sg-098633a3b32ea82f4"
]
subnets = [
"subnet-062189d742937204e"
]
}
}

Expand Down

0 comments on commit 428d179

Please sign in to comment.