RHCE EX294 Examination – Preparations Drafts

Course: Red Hat Enterprise Linux Automation with Ansible

Exam Guide: https://www.youtube.com/watch?v=0HNuR1a6-9M&list=PLL_setXLS0tiYMipvQI4oUGkJwhOhn42J

Don’t waste your time remember each of the syntax. Instead, if you want just the parameters + what they do:

$ ansible-doc -s copy
- name: Copy files to remote locations
  copy:
      attributes:            # The attributes the resulting file or directory should have. To get supported flags look at the man page for `chattr' on the target system. This string should contain the attributes in the same order as the one displayed by `lsattr'. The `=' operator is assumed as default, otherwise `+' or `-' operators need to be included in the string.
      backup:                # Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
      checksum:              # SHA1 checksum of the file being transferred. Used to validate that the copy of the file was successful. If this is not provided, ansible will use the local calculated checksum of the src file.
      content:               # When used instead of `src', sets the contents of a file directly to the specified value. Works only when `dest' is a file. Creates the file if it does not exist. For advanced formatting or if `content' contains a variable, use the [template] module.
      decrypt:               # This option controls the autodecryption of source files using vault.
      dest:                  # (required) Remote absolute path where the file should be copied to. If `src' is a directory, this must be a directory too. If `dest' is a non-existent path and if either `dest' ends with "/" or `src' is a directory, `dest' is created. If `dest' is a relative path, the starting directory is determined by the remote host. If `src' and `dest' are files, the parent directory of `dest' is not created and the task fails if it does not already exist.
      ...

and if you want just the examples:

$ ansible-doc copy | grep EXAMPLES -A 100 | less

if you are using Vim, you can even redirect this to another buffer and quickly copy / paste:

:new
:r! ansible-doc ...

I’m also prepping for the EX294 and what I do is (within vim):

:!ansible-doc ${module} | grep -A 50 EXAMPLES | less

Leave a Reply

Your email address will not be published. Required fields are marked *