Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-5397

DO447-79: ch15s03 (Comp Review 2) - error in grading script

XMLWordPrintable

    • ILT, ROLE, VT
    • en-US (English)

      URL:
      Reporter RHNID:
      Section: -
      Language: en-US (English)
      Workaround:

      Description: The grading playbook for CR2 is wrong.
      Specifically, it looks for a single task in pre_tasks or post_tasks.

      However, the requirement is not that. The requirement is to add a line in the log file by using a specific module and a specific lookup. How we utilize them it's up to the reader.
      Thus, the following code is perfectly fine and covers the requirements:

      post_tasks: 
        - block:   
          - name: Get current date/time
            set_fact: 
              cur_dt: "{{ lookup('pipe', 'date') }}"
          
          - name: Add a line in the log
            lineinfile: 
              path: /tmp/times.txt
              line: "{{ cur_dt }} Deployment complete {{ webapp_version}} to {{ inventory_hostname }}"
        delegate_to: localhost
      

      However, the grade will fail.

      If I use one task, it succeeds.

            rht-sbonnevi Steven Bonneville
            p.tselios Petros Tselios (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: