Red Hat Certified Specialist in Services Management and Automation EX358 Exam Guide by Eric McLeroy

Red Hat Certified Specialist in Services Management and Automation EX358 Exam Guide by Eric McLeroy

Author:Eric McLeroy
Language: eng
Format: epub
Publisher: Packt
Published: 2023-12-15T00:00:00+00:00


Figure 5.41 – Creating the playbook directory

We are then going to create the inventory inside the new directory. This inventory example can be seen in the following screenshot:

Figure 5.42 – Example of an inventory

First, we will start writing our playbook and then move on to creating the Jinja2 templates. As always, we will begin our playbook as follows:

--- - name: DNS server playbook hosts: rhel1.example.com become: true become_method: sudo

Next, we will move on to the tasks that we need to complete in order to install bind, which installs named.service, which runs the DNS server. We will then copy over the configuration files for named.conf and the zones. Then, we will update the firewall and test the name resolution. Please keep in mind that you will want to substitute any IP addresses for those of your systems and your DNS server for this playbook. The tasks are as follows:

tasks: - name: Install dns service package: name: bind state: latest - name: Copy dns main config template: src: "{{ playbook_dir }}/named.conf.j2" dest: /etc/named.conf - name: Copy dns forward zone configs template: src: "{{ playbook_dir }}/example.com.zone.j2" dest: /var/named/example.com.zone - name: Copy dns reverse zone configs template: src: "{{ playbook_dir }}/1.168.192.zone.j2" dest: /var/named/1.168.192.zone - name: Start and enable DNS service: name: named state: restarted enabled: true - name: Enable DNS firewall rule command: cmd: firewall-cmd --permanent --add-service=dns - name: Reload firewall command: cmd: firewall-cmd --reload - name: Install DIG to check configuration package: name: bind-utils state: latest - name: Run dig to test configuration command: cmd: "dig rhel2.example.com @192.168.1.198"

Once that is complete, we will create our named.conf and zone files as .j2 templates.

The named.conf file can be seen in the following screenshot:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Popular ebooks
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9754)
Red Hat Certified Specialist in Services Management and Automation EX358 Exam Guide by Eric McLeroy(5825)
The KCNA Book by Nigel Poulton(4074)
Microsoft Security, Compliance, and Identity Fundamentals Exam Ref SC-900 by Dwayne Natwick(3437)
Designing and Implementing Microsoft Azure Networking Solutions by David Okeyode(3336)
Microsoft Security Operations Analyst Exam Ref SC-200 Certification Guide by Trevor Stuart and Joe Anich(3295)
Microsoft Security Operations Analyst Exam Ref SC-200 Certification Guide by Trevor Stuart & Joe Anich(3198)
TCP IP by Todd Lammle(2956)
Microsoft Power BI Data Analyst Certification Guide by Ed Corcoran Orrin Edenfield(2906)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2505)
Unity Certified Programmer: Exam Guide by Philip Walker(2381)
Networking A Beginner's Guide by Bruce Hallberg(2191)
Microsoft Power Platform Solution Architect's Handbook by Hugo Herrera(2011)
31 Days Before Your CompTIA A+ Exams (Shanette Luellen's Library) by Benjamin Patrick Conry(1844)
CompTIA A+ Practice Tests Core 1 (220-1101) and Core 2 (220-1102) by Ian Neil and Mark Birch(1768)
MCSA Windows Server 2016 Study Guide: Exam 70-741 by William Panek(1652)
PHP 7 Zend Certification Study Guide by Andrew Beak(1627)
Healthcare Information Security and Privacy (All-In-One) by Sean Murphy(1535)
CompTIA A+ Certification Guide (220-901 and 220-902) by Matthew Bennett(1512)
RHCSA & RHCE Red Hat Enterprise Linux 7: Training and Exam Preparation Guide (EX200 and EX300), Third Edition by Asghar Ghori(1469)