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

[Bug][SG][Fix] Guided Exercise: Managing Ansible Configuration Files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • RH294 - RHEL9.0-en-2-20221117
    • RH294
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 2
    • ILT, ROLE, VT
    • Hide

      Run through the exercise and enter an incorrect password or even leave the password blank for step 7 (just make sure the password is wrong or missing) and you will see that it succeeds as it doesn't use a user that requires a SUDO password. 

      The easiest thing to do is to put in "student" in the ansible.cfg file as the remote user and it will fail or succeed correctly depending on the password entered.

      Show
      Run through the exercise and enter an incorrect password or even leave the password blank for step 7 (just make sure the password is wrong or missing) and you will see that it succeeds as it doesn't use a user that requires a SUDO password.  The easiest thing to do is to put in "student" in the  ansible.cfg file as the remote user and it will fail or succeed correctly depending on the password entered.
    • en-US (English)

      Please fill in the following information:


      URL: https://rol.redhat.com/rol/app/courses/rh294-9.0/pages/ch02s04
      Reporter RHNID: rhn-gps--tmichett
      Section Title:

      Guided Exercise: Managing Ansible Configuration Files                                                                    

      Issue description

      Negative testing didn't occur for this exercise and it works (appears to work) when it shouldn't an an incorrect password has been entered. The exercise should fail if an incorrect password has been entered for the SUDO password in Step 7.

      Currently the exercise will run without complaints even when an incorrect password has been given.

      https://learn.redhat.com/t5/RH294-Red-Hat-Linux-Automation/Ch2-section-2-4-guided-exercise-step-7-not-working-as-expected/m-p/42240/emcs_t/S2h8ZW1haWx8YW5zd2VyX2FjY2VwdGVkX2FzX3NvbHV0aW9ufExUWUpENFlYMlRaODMwfDQyMjQwfEFDQ0VQVEVEX1NPTFVUSU9OU3xoSw#M182

       

       

      Steps to reproduce:

      Run through the exercises and leave the password "Blank" or type anything you want in there for the password as it isn't used to SUDO since there isn't a user defined in the ansible.cfg file.

       

      Workaround:

      Modify the book instructions to create a remote_user = student in the ansible.cfg file as shown below.

      [student@workstation playbook-manage]$ cat ansible.cfg
      [defaults]
      inventory = ./inventory
      remote_user = student
      
      [privilege_escalation]
      become = true
      become_method = sudo
      become_user = root
      become_ask_pass = true 

       

      Expected result:

      If incorrect password is entered, the ansible-navigator command should fail.

       

      TASK [Ping internetweb] *******************************************************************************************************************
      fatal: [serverb.lab.example.com]: FAILED! => {"msg": "Incorrect sudo password"}
       

              shasingh01 Shashi Singh
              rhn-gps--tmichett Travis Michette
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 hour
                  1h
                  Remaining:
                  Remaining Estimate - 1 hour
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified