Skip to main content

RHCE Certification Guide

Red Hat Certified Engineer — Ansible 자동화 기반 실기 엔지니어 자격증


🎯 RHCE란?

Red Hat Certified Engineer (RHCE) 는 Red Hat이 운영하는 고급 실기(performance-based) 자격증. 현재 EX294 시험은 100% Ansible 자동화에 초점을 맞추며, Red Hat Ansible Automation Platform을 사용하여 시스템 관리 태스크를 자동화하는 능력을 평가.

RHCE 취득 시 RHCA(Red Hat Certified Architect) 를 향한 크레딧으로도 인정.

시험 요약

항목내용
시험 코드EX294
주관Red Hat
형태온라인 원격 감독 또는 테스트 센터, 실기(performance-based)
시간4시간
합격 기준210/300 (70%)
비용$500 USD (리트라이 1회 포함)
유효기간3년
선수 조건RHCSA (EX200) 취득 필수
배포판RHEL (최신 버전 기반)

시험 환경

  • 여러 대의 시스템이 제공됨 (Control Node + Managed Nodes)
  • Ansible Automation Platform을 구성하고 시스템 관리 태스크 자동화
  • Playbook을 작성하여 시스템을 특정 상태로 구성
  • 평가 방식: 작성한 Playbook을 새로 설치된 시스템에 적용하여 검증
  • VS Code 에디터 사용 환경
  • 허용 리소스: 제품 내장 문서 (ansible-doc, ansible-navigator doc)
  • 비허용: 외부 웹사이트, 인터넷 접속, 메모, 별도 문서

RHCSA → RHCE 경로


📊 시험 도메인 (출제 범위)


선행 조건: RHCSA 전 범위

RHCE 응시자는 RHCSA 수준의 모든 태스크를 수행할 수 있어야 한다:

  • Essential tools (파일, 권한, 리다이렉션)
  • Running systems 운영 (프로세스, 서비스, 부팅)
  • Local storage 구성 (파티션, LVM)
  • File systems 설정 (NFS, autofs)
  • 시스템 배포/유지보수 (패키지, 스케줄링)
  • Users/Groups 관리
  • Security 관리 (SELinux, firewalld)
  • 간단한 shell script 분석

💡 RHCE 시험에서도 기본 Linux 관리 태스크가 출제될 수 있으므로 RHCSA 실력을 유지해야 한다.


1. VS Code & Git 사용

주제핵심 내용
Git 클론VS Code에서 Git 저장소 클론
Playbook 작성VS Code에서 Playbook 작성 및 Git push
ansible-navigator 설정VS Code 내에서 설정
Playbook 실행Ansible 개발 컨테이너로 실행

연습 포인트:

# Git 기본 조작
git clone https://git.example.com/playbooks.git
cd playbooks
git add .
git commit -m "Add web server playbook"
git push origin main

# VS Code 터미널에서 ansible-navigator 실행
ansible-navigator run site.yml -m stdout

2. Ansible 핵심 구성요소 이해

주제핵심 내용
Inventories정적 인벤토리 파일 작성
Modules모듈 사용법 및 문서 조회
Variables변수 정의 및 우선순위
Facts시스템 정보 수집 및 활용
Loops반복 처리
Conditional Tasks조건부 실행 (when)
PlaysPlay 구성
Task Failure에러 처리
PlaybooksPlaybook 작성
Configuration Filesansible.cfg 설정
RolesRole 구조 및 사용
문서 활용ansible-doc, ansible-navigator doc

연습 포인트:

# 모듈 문서 조회 (시험 중 핵심 리소스)
ansible-doc -l # 모듈 전체 목록
ansible-doc -l | grep firewall # 검색
ansible-doc firewalld # 상세 문서
ansible-doc -s firewalld # 스니펫 (예시)

# ansible-navigator로 문서 조회
ansible-navigator doc firewalld -m stdout

3. Ansible 설치 및 설정

주제핵심 내용
패키지 설치필수 패키지 설치
ansible.cfg설정 파일 생성/수정
ansible-navigator.ymlNavigator 설정
정적 인벤토리호스트/그룹 정의

연습 포인트:

# 패키지 설치
dnf install -y ansible-core ansible-navigator

# ansible.cfg 설정
cat > ansible.cfg << 'EOF'
[defaults]
inventory = ./inventory
remote_user = automation
ask_pass = false

[privilege_escalation]
become = true
become_method = sudo
become_user = root
become_ask_pass = false
EOF

# ansible-navigator.yml
cat > ansible-navigator.yml << 'EOF'
ansible-navigator:
execution-environment:
image: ee-supported-rhel9:latest
pull:
policy: missing
mode: stdout
playbook-artifact:
enable: false
EOF

# 정적 인벤토리
cat > inventory << 'EOF'
[web]
web1.example.com
web2.example.com

[db]
db1.example.com

[all:vars]
ansible_user=automation
ansible_become=true
EOF

4. Managed Node 구성

주제핵심 내용
SSH 키SSH 키 생성 및 배포
권한 상승sudo 설정 (privilege escalation)
파일 배포파일을 managed node에 배포

연습 포인트:

# SSH 키 생성 및 배포
ssh-keygen -t ed25519 -f ~/.ssh/ansible_key -N ""
ssh-copy-id -i ~/.ssh/ansible_key.pub automation@web1.example.com

# Managed node에서 sudo 설정
# /etc/sudoers.d/automation
# automation ALL=(ALL) NOPASSWD: ALL

# 연결 테스트
ansible all -m ping

5. ansible-navigator로 Playbook 실행

주제핵심 내용
Playbook 실행ansible-navigator run
모듈 탐색Content Collections에서 새 모듈 찾기
인벤토리/환경 설정navigator를 통한 설정

연습 포인트:

# Playbook 실행
ansible-navigator run site.yml -m stdout

# 특정 인벤토리로 실행
ansible-navigator run site.yml -i production -m stdout

# Dry run (체크 모드)
ansible-navigator run site.yml --check -m stdout

# 특정 태그만 실행
ansible-navigator run site.yml --tags "install" -m stdout

# 콘텐츠 컬렉션 내 모듈 탐색
ansible-navigator collections -m stdout

6. Play & Playbook 작성

주제핵심 내용
모듈 사용자주 쓰는 Ansible 모듈 활용
register명령 실행 결과를 변수에 저장
조건문when으로 실행 제어
에러 처리ignore_errors, block/rescue/always
상태 구성시스템을 특정 상태로 구성하는 Playbook

연습 포인트:

---
- name: Web Server 구성
hosts: web
become: yes

vars:
http_port: 80
packages:
- httpd
- mod_ssl
- firewalld

tasks:
- name: 패키지 설치
ansible.builtin.dnf:
name: "{{ packages }}"
state: present

- name: httpd 서비스 시작
ansible.builtin.systemd:
name: httpd
state: started
enabled: yes

- name: 방화벽에 HTTP 허용
ansible.posix.firewalld:
service: http
permanent: yes
state: enabled
immediate: yes

- name: 버전 확인
ansible.builtin.command: httpd -v
register: httpd_version
changed_when: false

- name: 버전 출력
ansible.builtin.debug:
msg: "{{ httpd_version.stdout }}"

# 에러 처리
- name: 안전한 배포
block:
- name: 새 설정 배포
ansible.builtin.template:
src: httpd.conf.j2
dest: /etc/httpd/conf/httpd.conf
notify: Restart httpd

rescue:
- name: 기본 설정 복원
ansible.builtin.copy:
src: /etc/httpd/conf/httpd.conf.bak
dest: /etc/httpd/conf/httpd.conf
remote_src: yes

always:
- name: httpd 상태 확인
ansible.builtin.systemd:
name: httpd
state: started

handlers:
- name: Restart httpd
ansible.builtin.systemd:
name: httpd
state: restarted

7. Role & Content Collections

주제핵심 내용
Role 생성Role 디렉토리 구조 생성 및 작성
Role 설치ansible-galaxy role install
Role 사용Playbook에서 Role 호출
Content Collections 설치ansible-galaxy collection install
Collections 사용Playbook에서 Collection 모듈 사용

연습 포인트:

# Role 생성
ansible-galaxy role init roles/webserver

# requirements.yml로 Role/Collection 설치
cat > requirements.yml << 'EOF'
roles:
- name: geerlingguy.nginx
version: "3.1.0"

collections:
- name: ansible.posix
- name: community.general
EOF

ansible-galaxy install -r requirements.yml
ansible-galaxy collection install -r requirements.yml
# Role 구조
# roles/webserver/
# ├── tasks/main.yml
# ├── handlers/main.yml
# ├── templates/
# ├── defaults/main.yml
# └── meta/main.yml

# roles/webserver/defaults/main.yml
---
webserver_port: 80
webserver_docroot: /var/www/html

# roles/webserver/tasks/main.yml
---
- name: 패키지 설치
ansible.builtin.dnf:
name: httpd
state: present

- name: 설정 배포
ansible.builtin.template:
src: httpd.conf.j2
dest: /etc/httpd/conf/httpd.conf
notify: Restart httpd

- name: 서비스 시작
ansible.builtin.systemd:
name: httpd
state: started
enabled: yes

# roles/webserver/handlers/main.yml
---
- name: Restart httpd
ansible.builtin.systemd:
name: httpd
state: restarted
# Playbook에서 Role 사용
---
- name: Web Server 구성
hosts: web
become: yes
roles:
- role: webserver
vars:
webserver_port: 8080

8. RHCSA 태스크 Ansible 자동화

Ansible 모듈을 사용하여 일반적인 RHCSA 관리 태스크를 자동화:

RHCSA 태스크Ansible 모듈
패키지/저장소ansible.builtin.dnf, ansible.builtin.yum_repository
서비스ansible.builtin.systemd, ansible.builtin.service
방화벽ansible.posix.firewalld
파일시스템community.general.filesystem, ansible.posix.mount
스토리지community.general.lvg, community.general.lvol
파일 내용ansible.builtin.copy, ansible.builtin.template, ansible.builtin.lineinfile
아카이브community.general.archive, ansible.builtin.unarchive
작업 스케줄링ansible.builtin.cron, ansible.builtin.at
보안 (SELinux)ansible.posix.seboolean, community.general.sefcontext
사용자/그룹ansible.builtin.user, ansible.builtin.group

연습 포인트:

---
- name: RHCSA 태스크 자동화 예시
hosts: all
become: yes

tasks:
# 사용자/그룹 관리
- name: 그룹 생성
ansible.builtin.group:
name: developers
state: present

- name: 사용자 생성
ansible.builtin.user:
name: "{{ item.name }}"
groups: "{{ item.groups }}"
shell: /bin/bash
state: present
loop:
- { name: jay, groups: "developers,wheel" }
- { name: deploy, groups: "developers" }

# 패키지 관리
- name: 패키지 설치
ansible.builtin.dnf:
name:
- httpd
- mariadb-server
- firewalld
state: present

# 서비스 관리
- name: 서비스 시작 및 활성화
ansible.builtin.systemd:
name: "{{ item }}"
state: started
enabled: yes
loop:
- httpd
- mariadb
- firewalld

# 방화벽
- name: 방화벽 규칙
ansible.posix.firewalld:
service: "{{ item }}"
permanent: yes
state: enabled
immediate: yes
loop:
- http
- https

# 파일 관리
- name: 설정 파일 배포 (Template)
ansible.builtin.template:
src: httpd.conf.j2
dest: /etc/httpd/conf/httpd.conf
owner: root
group: root
mode: '0644'

# cron 스케줄링
- name: 백업 크론 설정
ansible.builtin.cron:
name: "Daily backup"
minute: "0"
hour: "3"
job: "/opt/scripts/backup.sh"
user: root

# SELinux boolean
- name: SELinux boolean 설정
ansible.posix.seboolean:
name: httpd_can_network_connect
state: yes
persistent: yes

# LVM 관리
- name: VG 생성
community.general.lvg:
vg: vg_data
pvs: /dev/sdb1

- name: LV 생성
community.general.lvol:
vg: vg_data
lv: lv_data
size: 5G

9. 콘텐츠 관리

주제핵심 내용
TemplateJinja2 템플릿으로 동적 설정 파일 생성
Ansible Vault민감 데이터 암호화

연습 포인트:

{# templates/httpd.conf.j2 #}
# Managed by Ansible - Do not edit
ServerRoot "/etc/httpd"
Listen {{ http_port | default(80) }}
ServerName {{ ansible_fqdn }}

<VirtualHost *:{{ http_port | default(80) }}>
DocumentRoot {{ docroot | default('/var/www/html') }}
ServerName {{ server_name | default(ansible_fqdn) }}
</VirtualHost>
# Ansible Vault - 암호화된 변수 파일 생성
ansible-vault create vars/secrets.yml
ansible-vault edit vars/secrets.yml
ansible-vault view vars/secrets.yml

# 암호화된 변수 파일 내용 예시:
# db_password: "s3cr3t_p@ss"
# api_key: "abc123def456"

# Vault 사용하여 Playbook 실행
ansible-navigator run site.yml --vault-password-file ~/.vault_pass -m stdout
# 또는
ansible-navigator run site.yml --ask-vault-pass -m stdout

# 기존 파일 암호화/복호화
ansible-vault encrypt vars/plain.yml
ansible-vault decrypt vars/secrets.yml

# 문자열 단위 암호화
ansible-vault encrypt_string 'secret_value' --name 'db_password'
# Playbook에서 Vault 변수 사용
---
- name: DB 서버 구성
hosts: db
become: yes
vars_files:
- vars/secrets.yml

tasks:
- name: DB 패스워드 설정
ansible.builtin.lineinfile:
path: /etc/myapp/config.ini
regexp: '^password='
line: "password={{ db_password }}"

⚖️ RHCSA vs RHCE 비교

항목RHCSA (EX200)RHCE (EX294)
초점Linux 시스템 관리Ansible 자동화
시간3시간4시간
작업 방식직접 CLI에서 수동 작업Playbook 작성으로 자동화
비용$500$500
선수 조건없음RHCSA 필수
SELinux직접 설정Ansible 모듈로 설정
LVM직접 명령어Ansible 모듈로 자동화
에디터vimVS Code
커리어시스템 관리자자동화 엔지니어, DevOps

📖 학습 리소스

공식 교육 과정

과정설명
RH294 — Red Hat Enterprise Linux Automation with AnsibleRHCE 시험 대비 공식 과정, 시험 범위의 90% 커버
Red Hat Learning Subscription전체 교육 과정 무제한 접근 (~$5,000/년)

추천 학습 자료

리소스설명
Sander van Vugt — RHCE EX294 (O'Reilly/Udemy)실습 중심, 각 레슨 랩 포함
Lisenet.com — RHCE EX294 Sample Exam무료 모의시험 18문제, VM 5대 환경
Ansible 공식 문서모듈 레퍼런스, Best Practices
GitHub — RHCE EX294 Study Guide도메인별 학습 노트 및 예제

블로그 내 관련 시리즈

설명
Ansible OverviewAnsible 아키텍처, 설치, Ad-hoc 기본
Ansible Playbook변수, 조건문, 반복문, Handler, Template
Ansible RoleRole 구조, Galaxy, 프로젝트 구조

🗓️ 학습 계획 (8~12주, RHCSA 취득 후)


💡 시험 팁

ansible-doc 활용 — 최고의 무기

시험 중 인터넷은 차단되지만 ansible-doc은 사용 가능. 모듈 사용법을 모를 때 생명줄:

# 모듈 검색
ansible-doc -l | grep -i firewall
ansible-doc -l | grep -i user
ansible-doc -l | grep -i lvol

# 모듈 상세 문서 (EXAMPLES 섹션이 핵심)
ansible-doc ansible.builtin.user
ansible-doc ansible.posix.firewalld
ansible-doc community.general.lvol

# 스니펫 (바로 복사 가능한 예시)
ansible-doc -s ansible.builtin.user
ansible-doc -s ansible.posix.firewalld

💡 -s 옵션의 스니펫을 복사해서 수정하면 빠르게 태스크를 작성할 수 있다.

FQCN (Fully Qualified Collection Name) 사용

시험에서 모듈을 FQCN으로 사용하는 것이 안전:

# 짧은 이름 (동작하지만 경고 가능)
- name: 패키지 설치
dnf:
name: httpd

# FQCN (권장)
- name: 패키지 설치
ansible.builtin.dnf:
name: httpd
카테고리FQCN 예시
내장 모듈ansible.builtin.dnf, ansible.builtin.user, ansible.builtin.systemd
POSIXansible.posix.firewalld, ansible.posix.seboolean, ansible.posix.mount
Communitycommunity.general.lvol, community.general.lvg, community.general.filesystem

Playbook 작성 시 주의

# 1. 항상 멱등하게 작성
# 나쁜 예: shell/command → 멱등성 없음
- name: 사용자 추가
ansible.builtin.shell: useradd jay

# 좋은 예: 전용 모듈 → 멱등성 보장
- name: 사용자 추가
ansible.builtin.user:
name: jay
state: present

# 2. changed_when으로 정확한 상태 표시
- name: 버전 확인
ansible.builtin.command: httpd -v
register: result
changed_when: false # 정보 조회는 변경 아님

# 3. handler는 notify로만 호출
# changed 상태일 때만 실행됨

시간 관리

  • 4시간은 넉넉해 보이지만 Playbook 디버깅에 시간 소요
  • 문법 검증을 자주 수행: ansible-navigator run --check
  • ansible-lint로 문법 오류 사전 방지
  • 쉬운 태스크부터 완료하여 점수 확보
  • Vault 관련 문제는 비교적 간단하므로 빨리 끝내기

랩 환경 구성 (학습용)

최소 VM 구성:
├── control.example.com (Control Node — Ansible 설치)
├── web1.example.com (Managed Node — Web)
├── web2.example.com (Managed Node — Web)
├── db1.example.com (Managed Node — DB)
└── utility.example.com (Managed Node — 기타)

요구사항:
- RHEL 9 (개발자 구독 무료)
- Control Node: 2GB RAM
- Managed Nodes: 1GB RAM 각각
- 네트워크: 동일 서브넷, SSH 연결 가능

🔗 관련 문서