-
Notifications
You must be signed in to change notification settings - Fork 0
Home
kt@oyj:~$ sudo -i root@oyj:~# apt update
root@oyj:~# apt install -y ansible Reading package lists… Done
root@oyj:~# root@oyj:~# ansible –version ansible [core 2.14.3]
config file = None configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.11.2 (main, May 2 2024, 11:59:08) [GCC 12.2.0] (/usr/bin/python3) jinja version = 3.1.2 libyaml = True
kt@oyj:~$ ansible –version ansible [core 2.14.3]
config file = None configured module search path = ['/home/kt/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/kt/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.11.2 (main, May 2 2024, 11:59:08) [GCC 12.2.0] (/usr/bin/python3) jinja version = 3.1.2 libyaml = True
kt@oyj:~$
-
파워쉘 실행후 배포판 선택 방법
-
aws 연결 확인을 위한 curl 설치.
kt@oyj:~$ sudo apt install curl -y
….. …… kt@oyj:~$ sudo apt install unzip -y Reading package lists… Done Building dependency tree… Done Reading state information… Done Suggested packages:
zip
The following NEW packages will be installed:
unzip
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded. Need to get 166 kB of archives. After this operation, 388 kB of additional disk space will be used. Get:1 deb.debian.org/debian bookworm/main amd64 unzip amd64 6.0-28 [166 kB] Fetched 166 kB in 1s (310 kB/s) Selecting previously unselected package unzip. (Reading database … 35248 files and directories currently installed.) Preparing to unpack …/unzip_6.0-28_amd64.deb … Unpacking unzip (6.0-28) … Setting up unzip (6.0-28) … kt@oyj:~$ curl “awscli.amazonaws.com/awscli-exe-linux-x86_64.zip” -o “awscliv2.zip” unzip awscliv2.zip sudo ./aws/install
kt@oyj:~$ aws –version aws-cli/2.17.21 Python/3.11.9 Linux/5.15.90.1-microsoft-standard-WSL2 exe/x86_64.debian.12 kt@oyj:~$
kt aws 환경 설정 및 ansible setup for aws okta login(ktcorp.okta.com)
=> 모바일 인증후 kt aws console 접근
-
aws 인증 sso Access Keys 클릭
*아래 그림에서 SSO start URL , SSO Region 복사후 aws configur sso 응답창에 복사
아래 그림의 URL 클릭후 브라우저에서 코드 입력(LTLV-KCMV)
-
한번더 OKTA 인증.
위 계정에서 원하는 계정 선택. 아래와 같이 지역 profile 입력.
-
aws cli 명령어 테스트(인증되었는지 확인)
-
ansilbe로 인스턴스 생성하기.
kt@oyj:/mnt/c/Users/SDH$ mkdir ec2-run kt@oyj:/mnt/c/Users/SDH$ cd ec2-run/ kt@oyj:/mnt/c/Users/SDH/ec2-run$ vi start-vas-instances.sh kt@oyj:/mnt/c/Users/SDH/ec2-run$
*boto3 설치해야 인증이 됨. kt@oyj:/mnt/c/Users/SDH/ec2-run$ sudo apt install python3-boto3 Reading package lists… Done Building dependency tree… Done Reading state information… Done The following additional packages will be installed:
python3-botocore python3-dateutil python3-s3transfer
The following NEW packages will be installed:
python3-boto3 python3-botocore python3-dateutil python3-s3transfer
0 upgraded, 4 newly installed, 0 to remove and 30 not upgraded. Need to get 5,820 kB of archives. After this operation, 82.7 MB of additional disk space will be used. Do you want to continue? [Y/n]
kt@oyj:/mnt/c/Users/SDH/ec2-run$ vi start-vas-instances.yaml kt@oyj:/mnt/c/Users/SDH/ec2-run$ ansible-playbook -i hosts start-vas-instances.yaml
PLAY [provision aws ec2 instances for vas cluster -바스 클러스터용 ec2 프로비저닝] **************************************************************
TASK [start specific number of multiple instances] ********************************************************************************************** changed: [localhost] => (item={‘hname’: ‘master1’, ‘ip’: ‘10.71.164.200’})