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
Sur cette page du site, vous pouvez voir la vidéo en ligne RHCE 8 - Deploy Apache Web Server durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur theurbanpenguin 02 septembre 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 6,372 fois et il a aimé 145 téléspectateurs. Bon visionnage!