반응형

IAC 5

Ansible 사용하여 WordPress, Haproxy 설정 해보기

Ansible 설치 및 설정에 이어서 진행 해보도록 하겠습니다. 우선 wordpress를 2번 서버에 설치하고 설정하는 작업을 ansible을 사용하여 해보겠습니다. 처음 작성한 코드 --- - name: wordpress down and start hosts: web tasks: - name: wget, httpd install yum: name: "{{ item }}" state: latest loop: - wget - httpd - epel-release - yum-utils - http://rpms.remirepo.net/enterprise/remi-release-7.rpm - php - php-common - php-opcache - php-mcrypt - php-cli - php-gd - ph..

Ansible 2024.02.11

Ansible 모듈 사용해보기 (shell, user, file, copy ...등)

오늘은 모듈 shell, user, file, copy, fetch, yum, service, lineinfile에 대해 알아보았습니다. Ad-hoc 명령어 module: user ansible all -m user -a "name=a" => 모든 서버에 'a'라는 이름의 유저 생성 ansible all -m user -a "name=a state=absent" => 모든 서버에 'a'라는 이름의 유저 삭제 => 다만 user 모듈로 유저 생성 후 삭제하면 /home, /var/spool/mail 디렉토리에 생성된 유저 디렉토리는 삭제 되지 않는다. ansible all -m user -a "name=a update_password=always password={{ 'It1' | password_hash..

Ansible 2024.02.05

Ansible 설치 및 설정

Ansible 체계 구성도 HOSTC7-1C7-2C7-3C7-4 Hostname cont ma1 ma2 ma3 IP 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 SM 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 Default-gateway 10.0.0.254 10.0.0.254 10.0.0.254 10.0.0.254 DNS 168.126.63.1 168.126.63.1 168.126.63.1 168.126.63.1 Roles Controller manage1 manage2 manage3 1. 설치 및 설정 ansible은 SSH를 이용하여 통신을 합니다. 따라서 SSH 통신이 되도록 설정을 해줍니다. 저희는 테스트하는 경우라 ss..

Ansible 2024.01.18

Terraform 실습 해보기 - 2

오늘은 1일차에 이어 진행해보도록 하겠습니다. 12. wordpress rds 연결 스크립트 작성 우선 user_data에 사용할 wordpress와 rds 연결하는 스크립트를 먼저 만들어 줍니다. => install.sh #! /bin/bash wget https://ko.wordpress.org/wordpress-5.7.8-ko_KR.tar.gz tar -xvf wordpress-5.7.8-ko_KR.tar.gz yum install -y httpd cp -r wordpress/* /var/www/html/ amazon-linux-extras enable php8.0 yum install -y php php-fpm php-pdo php-mysqlnd cp /var/www/html/wp-config-s..

Terraform 2023.12.22

Terraform 실습 해보기 - 1

Terraform 실습 목표 WordPress + RDS 3Tier 연결 해보기 AWS EKS 클러스터 구축 1. AWS CLI 설치 및 설정 AWS CLI v2 다운로드 => 구글에 검색해서 다운로드 하면 됨. AWS console 접속 -> IAM -> 엑세스 키 발급 => 엑세스 키 발급 받을 때 꼭 저장해둘 것, 나중에 엑세스 키를 다시 볼 수 없음. Window cmd 창에서 명령어를 입력하여 AWS 로그인 Terraform으로 인프라 구성하기 전, 위와 같은 순서로 먼저 사전 준비를 해준다. 2. Terraform 설치 및 환경변수에 설정 https://developer.hashicorp.com/terraform/downloads?product_intent=terraform Install | ..

Terraform 2023.12.13
반응형