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
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.
TCP IP by Todd Lammle(2642)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2315)
The KCNA Book by Nigel Poulton(2000)
Red Hat Certified Specialist in Services Management and Automation EX358 Exam Guide by Eric McLeroy(1995)
Networking A Beginner's Guide by Bruce Hallberg(1936)
31 Days Before Your CompTIA A+ Exams (Shanette Luellen's Library) by Benjamin Patrick Conry(1665)
Unity Certified Programmer: Exam Guide by Philip Walker(1492)
MCSA Windows Server 2016 Study Guide: Exam 70-741 by William Panek(1480)
PHP 7 Zend Certification Study Guide by Andrew Beak(1453)
Healthcare Information Security and Privacy (All-In-One) by Sean Murphy(1372)
CompTIA A+ Certification Guide (220-901 and 220-902) by Matthew Bennett(1339)
Microsoft Security, Compliance, and Identity Fundamentals Exam Ref SC-900 by Dwayne Natwick(1332)
Designing and Implementing Microsoft Azure Networking Solutions by David Okeyode(1321)
RHCSA & RHCE Red Hat Enterprise Linux 7: Training and Exam Preparation Guide (EX200 and EX300), Third Edition by Asghar Ghori(1304)
Essential Office 2016 by Wilson Kevin(1254)
Mobile Computing Deployment and Management by Robert J. Bartz(1254)
Essential Office 2016 (Computer Essentials) by Kevin Wilson(1229)
The Tao of Network Security Monitoring by Richard Bejtlich(1195)
CCNA Cisco Certified Network Associate Practice Labs and Simulations by Shwergho Smith(1149)