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/sh | |
#接続するESXiのIPアドレスを設定 | |
servers=" | |
192.168.1.XXX | |
" | |
#接続するESXiのユーザーのパスワードを設定 | |
#今回は全台共通にて存在するrootユーザーにて接続 | |
#接続先のESXiにてrootユーザーのパスワードが全て同じ事が前提 | |
password=******* |
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
rm /tmp/vmsvc.summary* ; vim-cmd vmsvc/getallvm | awk -v esxi=`uname -n` '($1~/^[0-9]+$/){print $2;command = sprintf("vim-cmd vmsvc/get.summary %s > /tmp/vmsvc.summary,%s,%s",$1,esxi,$1);buf = system(command);close(command)}' |
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/sh | |
ps aux | gawk -v time=`date '+%Y/%m/%d_%H:%M:%S'` '{ mem[$11] += $6 }END{for (i in mem){if(mem[i]!~/^0$/){printf("\"%s\",\"%s\",\"%s\"\n",time,i,mem[i])}}}' |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
import logging | |
import requests | |
# logging | |
formatter = '%(asctime)s %(levelname)s %(name)s %(message)s' |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import ast | |
import glob | |
import json | |
import os | |
def dict_to_json(filename): |
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
terraform { | |
backend "s3" { | |
bucket = "<bucket name>" | |
key = "terraform.tfstate" | |
region = "us-east-1" | |
} | |
} | |
provider "aws" { | |
region = "us-east-1" | |
} |
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
module "ec2_test" { | |
source = "terraform-aws-modules/ec2-instance/aws" | |
version = "1.21.0" | |
name = "ec2-test" | |
instance_count = 1 | |
ami = "ami-0b8d0d6ac70e5750c" #amzn2-ami-hvm-2.0.20181114-x86_64-ebs | |
instance_type = "t2.micro" | |
key_name = "test-key" | |
monitoring = false | |
vpc_security_group_ids = ["<vpc_security_group_ids>"] |
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
version: 2.1 | |
executors: | |
default: | |
working_directory: ~/aws-terraform | |
docker: | |
- image: hashicorp/terraform:light | |
commands: | |
install_tfnotify: |
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
version: 2 | |
defaults: &defaults | |
docker: | |
- image: hashicorp/terraform:0.11.13 | |
environment: | |
AWS_DEFAULT_REGION: ap-northeast-1 | |
tfnotify_install: &tfnotify_install | |
name: tfnotify install |
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
name: 'Terraform GitHub Actions apply' | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
terraform: | |
name: 'Terraform' | |
runs-on: ubuntu-latest | |
steps: |
OlderNewer