Looking at deploying the web server on RHEL 8 it is more than just installed the httpd package. Se need to to install httpd-manual for documentation and we may need to install firewalld if we want to protect the system. We also will need to configure the web server, even if it to listen just on IPv4. We will need web content before starting the services and enabling the port in the firewall. More than you at first think. This is where Ansible comes and why RH294 and the EX294 exam now are part of your RHCE certification. This practical demonstration of Ansible shows how to install multiple yum packages and how to use loops to start services. We also use variable from Ansible facts to set the List address on each web server.
---
name: Deploy Apache
hosts: redhat
gather_facts: true
tasks:
name: Install Apache
yum:
name:
httpd
httpd-manual
firewalld
state: latest
name: Don't Listen All Interfaces
lineinfile:
path: /etc/httpd/conf/httpd.conf
regexp: '^Listen 80'
state: absent
name: Listen Single Interface
lineinfile:
path: /etc/httpd/conf/httpd.conf
insertafter: '^#Listen'
line: 'Listen {{ ansible_default_ipv4.address }}:80'
name: Default Page
copy:
dest: /var/www/html/index.html
content: |
Welcome to my page
This is from devops
name: Start Services
service:
name: "{{ item }}"
state: started
enabled: true
loop:
httpd
firewalld
name: Open Firewall
firewalld:
service: http
state: enabled
permanent: true
immediate: true
...
Additionally you can find my video courses on Pluralsight: http://pluralsight.com/training/Autho... and take time to see my own site http://www.theurbanpenguin.com
Nesta página do site você pode assistir ao vídeo on-line RHCE 8 - Deploy Apache Web Server duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário theurbanpenguin 02 Setembro 2019, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 6,372 vezes e gostou 145 espectadores. Boa visualização!