Skip to Content
Red Hat Enterprise Linux Server Cookbook
book

Red Hat Enterprise Linux Server Cookbook

by William Leemans
December 2015
Intermediate to advanced
250 pages
4h 41m
English
Packt Publishing
Content preview from Red Hat Enterprise Linux Server Cookbook

Creating a playbook to perform system configuration tasks

Changing a system's configuration with Ansible isn't much more difficult than provisioning a new system.

Getting ready

For this recipe, we will need the following facts for the new host:

  • ntp_servers
  • dns_servers
  • dns_search

We'll also need to have a couple of templates to provision the following files:

  • /etc/logrotate.d/syslog
  • /etc/ntp.conf
  • /etc/ntp/step-tickers
  • /etc/resolv.conf

How to do it…

Now, we'll create the playbook to configure the system. Perform the following steps:

  1. Create a ~/playbooks/config.yml playbook with the following content:
    - name: Configure system hosts: all handlers: - include: networking.handlers.yml - include: ntp-client.handlers.yml tasks: - include: networking.tasks.yml - include: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CentOS 7 Server Deployment Cookbook

CentOS 7 Server Deployment Cookbook

Timothy Boronczyk

Publisher Resources

ISBN: 9781784392017