This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# $1 will be `whoami` for current user who has logged in | |
current_user=$1 | |
echo "Verify logged in $current_user is compromised or not?" | |
echo "Check for /home/$current_user/.systemd-login file" | |
if [ -f /home/$current_user/.systemd-login ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"builders": [ | |
{ | |
"ami_description": "{{user `ami-description`}}", | |
"ami_name": "{{user `ami-name`}}", | |
"ami_regions": [ | |
"us-east-1" | |
], | |
"ami_users": [ | |
"XXXXXXXXXX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
# For Node | |
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash - | |
# For xmlstarlet | |
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Security Group: | |
resource "aws_security_group" "jenkins_server" { | |
name = "jenkins_server" | |
description = "Jenkins Server: created by Terraform for [dev]" | |
# legacy name of VPC ID | |
vpc_id = "${data.aws_vpc.default_vpc.id}" | |
tags { | |
Name = "jenkins_server" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AMI lookup for this Jenkins Server | |
data "aws_ami" "jenkins_server" { | |
most_recent = true | |
owners = ["self"] | |
filter { | |
name = "name" | |
values = ["amazon-linux-for-jenkins*"] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
function wait_for_jenkins() | |
{ | |
while (( 1 )); do | |
echo "waiting for Jenkins to launch on port [8080] ..." | |
nc -zv 127.0.0.1 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_security_group" "dev_jenkins_worker_linux" { | |
name = "dev_jenkins_worker_linux" | |
description = "Jenkins Server: created by Terraform for [dev]" | |
# legacy name of VPC ID | |
vpc_id = "${data.aws_vpc.default_vpc.id}" | |
tags { | |
Name = "dev_jenkins_worker_linux" | |
env = "dev" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "aws_ami" "jenkins_worker_linux" { | |
most_recent = true | |
owners = ["self"] | |
filter { | |
name = "name" | |
values = ["amazon-linux-for-jenkins*"] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
function wait_for_jenkins () | |
{ | |
echo "Waiting jenkins to launch on 8080..." | |
while (( 1 )); do | |
echo "Waiting for Jenkins" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"ami-description": "Windows Server for Jenkins Slave ({{isotime \"2006-01-02-15-04-05\"}})", | |
"ami-name": "windows-slave-for-jenkins-{{isotime \"2006-01-02-15-04-05\"}}", | |
"aws_access_key": "", | |
"aws_secret_key": "" | |
}, | |
"builders": [ | |
{ |
OlderNewer