티스토리 뷰
반응형
request - version check!!!
- #yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
- #yum install terraform
- #yum install ansible
- #pip install --upgrade awscli
- #packer plugins install github.com/hashicorp/amazon
- #packer plugins install github.com/hashicorp/ansible
###### ami-update.json
#### use packer build ami-update.json
{
"_comment": "AMI using Amazon Linux2",
"variables": {
"name": "ami-packer-build"
},
"builders": [
{
"type": "amazon-ebs",
"region": "ap-northeast-2",
"source_ami": "ami-id",
"vpc_id": "vpc-id",
"subnet_id": "subnet-id",
"security_group_id": "sg-id",
"instance_type": "t2.small",
"ssh_interface": "private_ip",
"ssh_username": "ec2-user",
"ami_description": " AMI using Amazon Linux2",
"ami_name": "ami-packer-build-{{timestamp}}",
"tags":
{
"Name": "ami-packer-buil"
},
"ami_users": ["account id"]
}
],
"provisioners": [
{
"type": "ansible",
"user": "ec2-user",
"use_proxy": false,
"keep_inventory_file": true,
"playbook_file": "../playbook/ami-awslinux2-update.yml",
"extra_arguments": [
"--extra-vars",
"\"ansible_user=ec2-user ansible_become_method=sudo ansible_become_user=root ansible_host={{ build `Host` }} ansible_port=22 ansible_ssh_common_args='-o StrictHostKeyChecking=no'\""
],
"ansible_env_vars": [
"ANSIBLE_HOST_KEY_CHECKING=False"
]
}
]
}
##### ami-awslinux2-update.yml
- name: Build Amazon Linux Base Image
hosts: all
roles:
- set_cpsible
############ set_cpsible main.yml
---
# tasks file for set_cfendys
- name: useradd fendys
become: yes
shell: sudo useradd -u 1001 fendys
- name: fendys .ssh
become: yes
file:
path: /home/fendys/.ssh
state: directory
owner: nike
group: nike
mode: '0700'
.
.
.
반응형
'linux' 카테고리의 다른 글
"grubby" 커널 변경 명령어 (0) | 2024.07.10 |
---|---|
sed 활용 (0) | 2024.04.05 |
grub2 설정 변경 (0) | 2023.11.30 |
linux 유저 생성 스크립트 (0) | 2023.11.01 |
linux bash user 90 day no login chshell nologin! (0) | 2023.11.01 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- nutanix rac
- 윈도우서버 계정 관려
- ansible network
- dl20 centos7
- chrony
- shell connmad log
- 특정 문구 치환
- ipmi
- 특정 라인삭제
- nxos ansible
- dl20 g9 centos7 설치
- 리눅스 커맨드 로그남기기
- vm rac
- cmd로 윈도우 계정 관리
- cgroup
- CentOS 7 GUI
- ISCSI 볼륨 RAC
- windows.old 강제삭제
- kernel 변경
- ansible ios
- 윈도우 cmd 계정 관리
- centos7 ntp
- DL20 GEN9 장비에 CentOS 7
- ILO
- linux command log
- oracle linux8 kernel
- cisco ansible
- cmd로 계정 생성
- dl20
- ios ansible
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함