Setup
sudo yum -y install python-pip
pip install --upgrade pip
pip install boto3 botocore
sudo yum install -y firewalld
sudo yum install -y ansible
Shell
복사
Create keypair
aws ec2 create-key-pair --key-name ansible-key --query 'KeyMaterial' --output text > ansible-key.pem
chmod 400 ansible-key.pem
Shell
복사
Create Secuirty Group and EC2 deploy
ec2_instance.yaml
security_group.yaml
ansible-playbook /home/ec2-user/ansible/security_group.yaml
ansible-playbook /home/ec2-user/ansible/ec2_instance.yaml
Shell
복사
Nginx Install
nginx_setup.yaml
inventory
ansible-playbook -i /home/ec2-user/ansible/inventory /home/ec2-user/ansible/nginx_setup.yaml
Shell
복사
