SlideShare a Scribd company logo
1 of 29
Download to read offline
IAC on OpenStack
(feat. ansible)
김용기 부장
Sr. Solution Architect
Red Hat
2
1900+
Ansible modules
31,000+
Stars on GitHub
500,000+
Downloads a month
3
SIMPLE POWERFUL AGENTLESS
애플리케이션 배포
설정 관리
워크플로우 오케스트레이션
네트워크 자동화
Orchestrate the app lifecycle
읽기 쉽고
코딩을 아주 잘 할 필요없이
순서대로 실행
모든 팀에 유용
Get productive quickly
에이전트 없이
OpenSSH & WinRM 사용
보안 강화
즉시 사용 가능
More efficient & more secure
WHY ANSIBLE?
4
Ansible 아키텍처
5
PLAYBOOK EXAMPLE
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
- name: latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/
- name: httpd is started
service:
name: httpd
state: started
---
- name: install and start apache
hosts: web
become: yes
vars:
http_port: 80
tasks:
- name: httpd package is present
yum:
name: httpd
state: latest
declarative, 선언형 방식
6
CLOUD
AWS
Azure
CenturyLink
CloudScale
Digital Ocean
Docker
Google
Linode
OpenStack
Rackspace
And more...
WINDOWS
ACLs
Files
Commands
Packages
IIS
Regedits
Shell
Shares
Services
DSC
Users
Domains
And more...
VIRT AND
CONTAINER
Docker
VMware
RHEV
OpenStack
OpenShift
Atomic
CloudStack
And more...
NETWORK
Arista
A10
Cumulus
Big Switch
Cisco
Cumulus
Dell
F5
Juniper
Palo Alto
OpenSwitch
And more...
NOTIFY
HipChat
IRC
Jabber
Email
RocketChat
Sendgrid
Slack
Twilio
And more...
ANSIBLE SHIPS WITH OVER 1250 MODULES
7
WHAT CAN I DO WITH ANSIBLE?
Automate the deployment and management of your entire IT footprint.
Orchestration
Do this...
Firewalls
Configuration
Management
Application
Deployment
Provisioning
Continuous
Delivery
Security and
Compliance
On these...
Load Balancers Applications Containers Clouds
Servers Infrastructure Storage And more...Network Devices
8
Open Stack Management
by Code
9
기본 인프라 생성
인프라 생성도
https://medium.com/@michalmedvecky/managing-your-openstack-infrastructure-with-hashicorp-terraform-8c93ade214b4
10
기본 인프라 설정
Network/Subnet/Router
• 테넌트별 별도 생성
• 입력값이 부정확할 때 통신 에러 발생
• 코드를 통해 기존 설정 확인
• 신속한 신규 네트워크 생성
매뉴얼 작업 경우
작업 자동화 경우
11
기본 인프라 설정
Security Group
• 기존 보안 그룹을 복사하여 생성 불가
• 새로운 SG마다 신규로 규칙 입력
필요
Security Group 코드를 복사/편집하여 SG 생성
매뉴얼 작업 경우 작업 자동화 경우
12
기본 인프라 설정
Flavor
• 기존 flavor 편집 불가
• 편집 필요시, 기존 스펙을 확인하고
재생성 필요
Flavor 코드를 복사/편집하여 생성
매뉴얼 작업 경우 작업 자동화 경우
13
인스턴스 배포
인스턴스 생성 코드 예제
• Heat 사용시
• Terraform 사용시
• Ansible 사용시
14
인스턴스 배포
Heat 코드
• YAML 형식
• stack 을 통한 서비스 구동
• ceilometer와 연동하여 auto scale
가능
• 필요파일:
- template.yaml
- environment.yaml
15
인스턴스 배포
Terraform 코드
참고: https://github.com/terraform-providers/terraform-provider-openstack/blob/master/examples/app-with-networking/main.tf
• 테라폼 전용
언어인 tf 형식
• 선언형 언어
• 쉬운 코드 및 적용
16
인스턴스 배포
Ansible 코드
• YAML 형식
• 선언형 언어
• 상대적으로
간단한 코드
• 인스턴스 배포
이후, OS 및 APP
관련 설정까지
일원화
17
인스턴스 설정
표준 OS 환경 설정
• cron 등록
• systemctl 설정
• ulimit 설정
• ntp 설정
• repo 등록
• 추가 패키지 설치
• 등등
18
인스턴스 설정
OpenScap +Ansible 을 통한 보안 점검
https://medium.com/@jackprice/ansible-openscap-for-compliance-automation-14200fe70663
19
인스턴스 설정
애플리케이션별 환경 설정
controller
Compute
OSD	
nodes
eap7-vol
mysql-
vol
Volumes
Service	Network	:1.1.x.x
Openstack	Storage	Network	:172.3.0.0/24
Nova
CinderGlance
Network
web1
Neutron
was1 db1
web2
1GB
automate
project
ansible_ssh
keypair
ansible user
automate
network
WEB1-2
httpd.conf 자동 설정 변경
mod_jk.conf
workers.properties
httpd 서비스 실행
WAS1
standalone.xml 의 DB연결
module.xml 에서 jdbc 등록
jboss eap 서비스 실행
DB1
my.conf 수정
mariadb 서비스 실행
<datasource jta="false" jndi-
name="java:jboss/postgresDS"
pool-name="postgresDS"
enabled="true" use-java-
context="true" use-
ccm="false">
<connection-
url>jdbc:postgresql://{{
hostvars['director']['dblb']
}}:{{ dbport }}/{{ dbsid|upper
}}</connection-url>
<driver-
class>org.postgresql.Driver</d
river-class>
<driver>postgresql</driver>
standalone.xml.template
20
애플리케이션 설정
Ansible Galaxy를 통한 패키지 설치 구성 자동화
https://galaxy.ansible.com/
21
애플리케이션 배포
git과 jenkins를 연동하여 App 자동 배포
22
IAC Best Practices
23
IAC Best Practices
How to be up to date
• Limited Direct Console Access
• Self-Documentation
• Code Versioning
• Continuous Test & Process
• Keep Services Available
24
IAC Best Practices
Limited Direct Console Access
코드를 통해서만 시스템 제어
SSH/Telnet
25
IAC Best Practices
Self-Documentation
26
IAC Best Practices
Code Versioning
장점:
• 변경 히스토리 관리
• 원복 가능
• 가시성 증대
27
IAC Best Practices
Continuous Test & Process
• 테스트 시나리오 현실화
• 테스트 자동화
• 프로세스 표준화
• 사람 간섭 최소화
28
PLAYBOOK EXAMPLES
이 문서에서 사용한 예제 사용 코드: HatSAri Github
https://github.com/hatsari/
LAMP + HAPROXY + NAGIOS
github.com/ansible/ansible-examples/tree/master/lamp_haproxy
WINDOWS
github.com/ansible/ansible-examples/tree/master/windows
SECURITY COMPLIANCE
github.com/ansible/ansible-lockdown
NETWORK
github.com/privateip/network-demo
MORE...
galaxy.ansible.com
github.com/ansible/ansible-examples
29
감사합니다

More Related Content

What's hot

What's hot (8)

500.JBoss Troubleshooting Essential
500.JBoss Troubleshooting Essential500.JBoss Troubleshooting Essential
500.JBoss Troubleshooting Essential
 
[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning[오픈소스컨설팅]Java Performance Tuning
[오픈소스컨설팅]Java Performance Tuning
 
톰캣 #10-모니터링
톰캣 #10-모니터링톰캣 #10-모니터링
톰캣 #10-모니터링
 
톰캣 운영 노하우
톰캣 운영 노하우톰캣 운영 노하우
톰캣 운영 노하우
 
DevOps 시대가 요구하는 품질확보 방법
DevOps 시대가 요구하는 품질확보 방법 DevOps 시대가 요구하는 품질확보 방법
DevOps 시대가 요구하는 품질확보 방법
 
톰캣 #01-소개
톰캣 #01-소개톰캣 #01-소개
톰캣 #01-소개
 
The log based event script (로그기반 이벤트스크립트)
The log based event script (로그기반 이벤트스크립트)The log based event script (로그기반 이벤트스크립트)
The log based event script (로그기반 이벤트스크립트)
 
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안
Final 07.컨테이너 환경에서 모니터링 이슈와 해결 방안
 

Similar to IAC on OpenStack(feat.ansible)

제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개
제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개
제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개
Tommy Lee
 
[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱
NAVER D2
 

Similar to IAC on OpenStack(feat.ansible) (20)

Kafka slideshare
Kafka   slideshareKafka   slideshare
Kafka slideshare
 
Toast cloud for beginners
Toast cloud for beginnersToast cloud for beginners
Toast cloud for beginners
 
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
[NDC18] 만들고 붓고 부수고 - 〈야생의 땅: 듀랑고〉 서버 관리 배포 이야기
 
Laravel로 스타트업 기술 스택 구성하기
Laravel로 스타트업 기술 스택 구성하기Laravel로 스타트업 기술 스택 구성하기
Laravel로 스타트업 기술 스택 구성하기
 
Terraform을 기반한 AWS 기반 대규모 마이크로서비스 인프라 운영 노하우 - 이용욱, 삼성전자 :: AWS Summit Seoul ...
Terraform을 기반한 AWS 기반 대규모 마이크로서비스 인프라 운영 노하우 - 이용욱, 삼성전자 :: AWS Summit Seoul ...Terraform을 기반한 AWS 기반 대규모 마이크로서비스 인프라 운영 노하우 - 이용욱, 삼성전자 :: AWS Summit Seoul ...
Terraform을 기반한 AWS 기반 대규모 마이크로서비스 인프라 운영 노하우 - 이용욱, 삼성전자 :: AWS Summit Seoul ...
 
Ansible introduction & demo
Ansible introduction & demoAnsible introduction & demo
Ansible introduction & demo
 
제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개
제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개
제2회 난공불락 오픈소스 인프라 세미나 zinst 관리툴 소개
 
KAFKA 3.1.0.pdf
KAFKA 3.1.0.pdfKAFKA 3.1.0.pdf
KAFKA 3.1.0.pdf
 
Machine Learning Model Serving with Backend.AI
Machine Learning Model Serving with Backend.AIMachine Learning Model Serving with Backend.AI
Machine Learning Model Serving with Backend.AI
 
[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱
 
03.Ansible 소개
03.Ansible 소개03.Ansible 소개
03.Ansible 소개
 
모두의 클라우드 딥러닝
모두의 클라우드 딥러닝모두의 클라우드 딥러닝
모두의 클라우드 딥러닝
 
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
 
[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf
 
Osc4.x installation v1-upload
Osc4.x installation v1-uploadOsc4.x installation v1-upload
Osc4.x installation v1-upload
 
02.실전! 시스템 관리자를 위한 Ansible
02.실전! 시스템 관리자를 위한 Ansible02.실전! 시스템 관리자를 위한 Ansible
02.실전! 시스템 관리자를 위한 Ansible
 
Private PaaS with Docker, spring cloud and mesos
Private PaaS with Docker, spring cloud and mesos Private PaaS with Docker, spring cloud and mesos
Private PaaS with Docker, spring cloud and mesos
 
Node.js 기본
Node.js 기본Node.js 기본
Node.js 기본
 
[오픈소스컨설팅]클라우드자동화 및 운영효율화방안
[오픈소스컨설팅]클라우드자동화 및 운영효율화방안[오픈소스컨설팅]클라우드자동화 및 운영효율화방안
[오픈소스컨설팅]클라우드자동화 및 운영효율화방안
 
Spark streaming tutorial
Spark streaming tutorialSpark streaming tutorial
Spark streaming tutorial
 

More from Opennaru, inc.

More from Opennaru, inc. (20)

머신 중심에서 애플리케이션 중심으로 불변의 인프라스트럭처 개념 이해
머신 중심에서 애플리케이션 중심으로 불변의 인프라스트럭처 개념 이해머신 중심에서 애플리케이션 중심으로 불변의 인프라스트럭처 개념 이해
머신 중심에서 애플리케이션 중심으로 불변의 인프라스트럭처 개념 이해
 
쿠버네티스를 이해하려면 반드시 알아야 하는 불변의 인프라스트럭처
쿠버네티스를 이해하려면 반드시 알아야 하는 불변의 인프라스트럭처쿠버네티스를 이해하려면 반드시 알아야 하는 불변의 인프라스트럭처
쿠버네티스를 이해하려면 반드시 알아야 하는 불변의 인프라스트럭처
 
컨테이너 기술의 역사와 발전 단계
컨테이너 기술의 역사와 발전 단계컨테이너 기술의 역사와 발전 단계
컨테이너 기술의 역사와 발전 단계
 
구글은 왜 쿠버네티스를 오픈소스로 공개했을까요?
구글은 왜 쿠버네티스를 오픈소스로 공개했을까요?구글은 왜 쿠버네티스를 오픈소스로 공개했을까요?
구글은 왜 쿠버네티스를 오픈소스로 공개했을까요?
 
컨테이너 기술과 가상화 기술의 주요한 차이점
컨테이너 기술과 가상화 기술의 주요한 차이점컨테이너 기술과 가상화 기술의 주요한 차이점
컨테이너 기술과 가상화 기술의 주요한 차이점
 
컨테이너 개념의 이해 - 물류 분야의 컨테이너와 다른점은?
컨테이너 개념의 이해 - 물류 분야의 컨테이너와 다른점은?컨테이너 개념의 이해 - 물류 분야의 컨테이너와 다른점은?
컨테이너 개념의 이해 - 물류 분야의 컨테이너와 다른점은?
 
VM과 컨테이너 상에서 Apache & Tomcat 설치, 실행 그리고 배포 데모
VM과 컨테이너 상에서 Apache & Tomcat 설치, 실행 그리고 배포 데모VM과 컨테이너 상에서 Apache & Tomcat 설치, 실행 그리고 배포 데모
VM과 컨테이너 상에서 Apache & Tomcat 설치, 실행 그리고 배포 데모
 
가상화 기술 VS 컨테이너의 집적도 비교 데모
가상화 기술 VS 컨테이너의 집적도 비교 데모가상화 기술 VS 컨테이너의 집적도 비교 데모
가상화 기술 VS 컨테이너의 집적도 비교 데모
 
PaaS 환경에서 기업 메신저 서비스 10분 만에 구축하기 데모
PaaS 환경에서 기업 메신저 서비스 10분 만에 구축하기 데모PaaS 환경에서 기업 메신저 서비스 10분 만에 구축하기 데모
PaaS 환경에서 기업 메신저 서비스 10분 만에 구축하기 데모
 
마이크로서비스 아키텍처 (MSA) 데모
마이크로서비스 아키텍처 (MSA) 데모마이크로서비스 아키텍처 (MSA) 데모
마이크로서비스 아키텍처 (MSA) 데모
 
클라우드 환경에서의 모니터링의 특징과 구현 방안 로그통합
클라우드 환경에서의 모니터링의 특징과 구현 방안 로그통합클라우드 환경에서의 모니터링의 특징과 구현 방안 로그통합
클라우드 환경에서의 모니터링의 특징과 구현 방안 로그통합
 
컨테이너 상에서의 서비스 무중단 배포 방법 비교 데모
컨테이너 상에서의 서비스 무중단 배포 방법 비교 데모컨테이너 상에서의 서비스 무중단 배포 방법 비교 데모
컨테이너 상에서의 서비스 무중단 배포 방법 비교 데모
 
자동 확장 자원 풀 – Auto Scaling 데모
자동 확장 자원 풀 – Auto Scaling 데모자동 확장 자원 풀 – Auto Scaling 데모
자동 확장 자원 풀 – Auto Scaling 데모
 
자동 장애 복구 데모 – Auto Healing 데모
자동 장애 복구 데모 – Auto Healing 데모자동 장애 복구 데모 – Auto Healing 데모
자동 장애 복구 데모 – Auto Healing 데모
 
멀티 애플리케이션 환경에서 부하에 따른 자동 자원 할당 데모
멀티 애플리케이션 환경에서 부하에 따른 자동 자원 할당 데모멀티 애플리케이션 환경에서 부하에 따른 자동 자원 할당 데모
멀티 애플리케이션 환경에서 부하에 따른 자동 자원 할당 데모
 
PaaS 환경에서 전자 정부 프레임워크 배포 데모
PaaS 환경에서 전자 정부 프레임워크 배포 데모PaaS 환경에서 전자 정부 프레임워크 배포 데모
PaaS 환경에서 전자 정부 프레임워크 배포 데모
 
PaaS 환경에서 워드프레스 구축하기 데모
PaaS 환경에서 워드프레스 구축하기 데모PaaS 환경에서 워드프레스 구축하기 데모
PaaS 환경에서 워드프레스 구축하기 데모
 
PaaS 환경에서 다중 사용자를 위한 머신 러닝 플랫폼 구축 데모
PaaS 환경에서 다중 사용자를 위한  머신 러닝 플랫폼 구축 데모PaaS 환경에서 다중 사용자를 위한  머신 러닝 플랫폼 구축 데모
PaaS 환경에서 다중 사용자를 위한 머신 러닝 플랫폼 구축 데모
 
16. understanding and implementing msa concepts pub
16. understanding and implementing msa concepts pub16. understanding and implementing msa concepts pub
16. understanding and implementing msa concepts pub
 
개발자가 PaaS 환경에서 반드시 알아야 하는 기술들
개발자가 PaaS 환경에서 반드시 알아야 하는 기술들개발자가 PaaS 환경에서 반드시 알아야 하는 기술들
개발자가 PaaS 환경에서 반드시 알아야 하는 기술들
 

IAC on OpenStack(feat.ansible)

  • 1. IAC on OpenStack (feat. ansible) 김용기 부장 Sr. Solution Architect Red Hat
  • 2. 2 1900+ Ansible modules 31,000+ Stars on GitHub 500,000+ Downloads a month
  • 3. 3 SIMPLE POWERFUL AGENTLESS 애플리케이션 배포 설정 관리 워크플로우 오케스트레이션 네트워크 자동화 Orchestrate the app lifecycle 읽기 쉽고 코딩을 아주 잘 할 필요없이 순서대로 실행 모든 팀에 유용 Get productive quickly 에이전트 없이 OpenSSH & WinRM 사용 보안 강화 즉시 사용 가능 More efficient & more secure WHY ANSIBLE?
  • 5. 5 PLAYBOOK EXAMPLE --- - name: install and start apache hosts: web become: yes vars: http_port: 80 tasks: - name: httpd package is present yum: name: httpd state: latest - name: latest index.html file is present copy: src: files/index.html dest: /var/www/html/ - name: httpd is started service: name: httpd state: started --- - name: install and start apache hosts: web become: yes vars: http_port: 80 tasks: - name: httpd package is present yum: name: httpd state: latest - name: latest index.html file is present copy: src: files/index.html dest: /var/www/html/ - name: httpd is started service: name: httpd state: started --- - name: install and start apache hosts: web become: yes vars: http_port: 80 tasks: - name: httpd package is present yum: name: httpd state: latest - name: latest index.html file is present copy: src: files/index.html dest: /var/www/html/ - name: httpd is started service: name: httpd state: started --- - name: install and start apache hosts: web become: yes vars: http_port: 80 tasks: - name: httpd package is present yum: name: httpd state: latest - name: latest index.html file is present copy: src: files/index.html dest: /var/www/html/ - name: httpd is started service: name: httpd state: started --- - name: install and start apache hosts: web become: yes vars: http_port: 80 tasks: - name: httpd package is present yum: name: httpd state: latest - name: latest index.html file is present copy: src: files/index.html dest: /var/www/html/ - name: httpd is started service: name: httpd state: started --- - name: install and start apache hosts: web become: yes vars: http_port: 80 tasks: - name: httpd package is present yum: name: httpd state: latest declarative, 선언형 방식
  • 6. 6 CLOUD AWS Azure CenturyLink CloudScale Digital Ocean Docker Google Linode OpenStack Rackspace And more... WINDOWS ACLs Files Commands Packages IIS Regedits Shell Shares Services DSC Users Domains And more... VIRT AND CONTAINER Docker VMware RHEV OpenStack OpenShift Atomic CloudStack And more... NETWORK Arista A10 Cumulus Big Switch Cisco Cumulus Dell F5 Juniper Palo Alto OpenSwitch And more... NOTIFY HipChat IRC Jabber Email RocketChat Sendgrid Slack Twilio And more... ANSIBLE SHIPS WITH OVER 1250 MODULES
  • 7. 7 WHAT CAN I DO WITH ANSIBLE? Automate the deployment and management of your entire IT footprint. Orchestration Do this... Firewalls Configuration Management Application Deployment Provisioning Continuous Delivery Security and Compliance On these... Load Balancers Applications Containers Clouds Servers Infrastructure Storage And more...Network Devices
  • 9. 9 기본 인프라 생성 인프라 생성도 https://medium.com/@michalmedvecky/managing-your-openstack-infrastructure-with-hashicorp-terraform-8c93ade214b4
  • 10. 10 기본 인프라 설정 Network/Subnet/Router • 테넌트별 별도 생성 • 입력값이 부정확할 때 통신 에러 발생 • 코드를 통해 기존 설정 확인 • 신속한 신규 네트워크 생성 매뉴얼 작업 경우 작업 자동화 경우
  • 11. 11 기본 인프라 설정 Security Group • 기존 보안 그룹을 복사하여 생성 불가 • 새로운 SG마다 신규로 규칙 입력 필요 Security Group 코드를 복사/편집하여 SG 생성 매뉴얼 작업 경우 작업 자동화 경우
  • 12. 12 기본 인프라 설정 Flavor • 기존 flavor 편집 불가 • 편집 필요시, 기존 스펙을 확인하고 재생성 필요 Flavor 코드를 복사/편집하여 생성 매뉴얼 작업 경우 작업 자동화 경우
  • 13. 13 인스턴스 배포 인스턴스 생성 코드 예제 • Heat 사용시 • Terraform 사용시 • Ansible 사용시
  • 14. 14 인스턴스 배포 Heat 코드 • YAML 형식 • stack 을 통한 서비스 구동 • ceilometer와 연동하여 auto scale 가능 • 필요파일: - template.yaml - environment.yaml
  • 15. 15 인스턴스 배포 Terraform 코드 참고: https://github.com/terraform-providers/terraform-provider-openstack/blob/master/examples/app-with-networking/main.tf • 테라폼 전용 언어인 tf 형식 • 선언형 언어 • 쉬운 코드 및 적용
  • 16. 16 인스턴스 배포 Ansible 코드 • YAML 형식 • 선언형 언어 • 상대적으로 간단한 코드 • 인스턴스 배포 이후, OS 및 APP 관련 설정까지 일원화
  • 17. 17 인스턴스 설정 표준 OS 환경 설정 • cron 등록 • systemctl 설정 • ulimit 설정 • ntp 설정 • repo 등록 • 추가 패키지 설치 • 등등
  • 18. 18 인스턴스 설정 OpenScap +Ansible 을 통한 보안 점검 https://medium.com/@jackprice/ansible-openscap-for-compliance-automation-14200fe70663
  • 19. 19 인스턴스 설정 애플리케이션별 환경 설정 controller Compute OSD nodes eap7-vol mysql- vol Volumes Service Network :1.1.x.x Openstack Storage Network :172.3.0.0/24 Nova CinderGlance Network web1 Neutron was1 db1 web2 1GB automate project ansible_ssh keypair ansible user automate network WEB1-2 httpd.conf 자동 설정 변경 mod_jk.conf workers.properties httpd 서비스 실행 WAS1 standalone.xml 의 DB연결 module.xml 에서 jdbc 등록 jboss eap 서비스 실행 DB1 my.conf 수정 mariadb 서비스 실행 <datasource jta="false" jndi- name="java:jboss/postgresDS" pool-name="postgresDS" enabled="true" use-java- context="true" use- ccm="false"> <connection- url>jdbc:postgresql://{{ hostvars['director']['dblb'] }}:{{ dbport }}/{{ dbsid|upper }}</connection-url> <driver- class>org.postgresql.Driver</d river-class> <driver>postgresql</driver> standalone.xml.template
  • 20. 20 애플리케이션 설정 Ansible Galaxy를 통한 패키지 설치 구성 자동화 https://galaxy.ansible.com/
  • 21. 21 애플리케이션 배포 git과 jenkins를 연동하여 App 자동 배포
  • 23. 23 IAC Best Practices How to be up to date • Limited Direct Console Access • Self-Documentation • Code Versioning • Continuous Test & Process • Keep Services Available
  • 24. 24 IAC Best Practices Limited Direct Console Access 코드를 통해서만 시스템 제어 SSH/Telnet
  • 26. 26 IAC Best Practices Code Versioning 장점: • 변경 히스토리 관리 • 원복 가능 • 가시성 증대
  • 27. 27 IAC Best Practices Continuous Test & Process • 테스트 시나리오 현실화 • 테스트 자동화 • 프로세스 표준화 • 사람 간섭 최소화
  • 28. 28 PLAYBOOK EXAMPLES 이 문서에서 사용한 예제 사용 코드: HatSAri Github https://github.com/hatsari/ LAMP + HAPROXY + NAGIOS github.com/ansible/ansible-examples/tree/master/lamp_haproxy WINDOWS github.com/ansible/ansible-examples/tree/master/windows SECURITY COMPLIANCE github.com/ansible/ansible-lockdown NETWORK github.com/privateip/network-demo MORE... galaxy.ansible.com github.com/ansible/ansible-examples