Chapter 12 - Performing Routine Maintenance with Ansible

  1. The df command can be provided with a path and it will work out the mount point on which that path lives and give you the free disk space. Ansible Facts provide disk usage statistics, but only by mount point, and so you must figure out which mount point your path lives on.
  2. The find module is used to locate files.
  3. Changes to configuration files might get made accidentally, maliciously, or as a result of an emergency change to fix an issue. In all cases, it is important to identify the changes and ensure that they are either removed or the playbooks updated to reflect the new configuration (especially when they were made to resolve an issue).
  4. You could use the template module or copy module to copy over the file and run Ansible in check mode. You could also checksum the file and see whether that matches a known value.
  5. Use the service module in a task with the appropriate parameters.
  6. Jinja2 provides the filtering as well as templating in Ansible.
  7. Use the split operator on the variable—for example, {{ item.split(,) }}.
  8. If you change all of the server content in one go, you might accidentally take the whole service offline—it is better to take a small number of servers out of service at a time, make and validate the changes, and then reintroduce them.
  9. Set max_fail_percentage to an appropriate value for your environment to stop the play if more than a given percentage of failures occur.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset