Chapter 7 - Configuration Management with Ansible

  1. Commonly, these might be replace and lineinfile.
  2. In brief, a template file is created that contains a mix of plaintext (which will be replicated as is) and valid Jinja2 expressions, which will be parsed and turned into the appropriate text when the template is deployed. These might be simple variable substitutions or more complex constructs such as for loops or if..then..else statements.
  3. Many Linux configurations are now split across multiple files, and it is possible for someone to accidentally (or maliciously) override your configuration in another file that gets included later on.
  1. Regular expressions can easily be broken if not carefully designed—for example, a Linux service might accept a configuration directive if there is whitespace before it; however, if your regular expression does not take account of this, it might overlook valid configuration directives, which need changing.
  2. It is simply deployed as isalmost akin to the copy module in Ansible.
  3. Make use of the validate parameter with the template module.
  4. Run Ansible in check mode—if the playbook and roles are well written, any reported changed results means that the configuration has deviated from the desired state and might need to be addressed.
..................Content has been hidden....................

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