Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-94033

Show detailed output when "ansible_roles_check_mode" is set to "true"

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • No
    • Low
    • rhel-se-display
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?

      The output we are getting is the same/limited with or without "ansible_roles_check_mode"; need a detailed output when "ansible_roles_check_mode" is set to "true".

      What is the impact of this issue to you?

      We use the network role on hundreds of production hosts. Are change control processes cannot reliably show the pending changes with check-mode.

      Please provide the package NVR for which the bug is seen:

      How reproducible is this bug?:

      Steps to reproduce

      following below documentation:

      https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/automating_system_administration_by_using_rhel_system_roles/assembly_configuring-network-settings-by-using-rhel-system-roles_automating-system-administration-by-using-rhel-system-roles#assembly_configuring-network-settings-by-using-rhel-system-roles_automating-system-administration-by-using-rhel-system-roles

       

      The default output for the role is very limited (both with and without checkmode). Expected the role to provide details on the intended changes. 

      For example the below will add route 192.168.100.120/24 via 192.168.1.129 on eno2:

           - name: network_connections
              parameter_type: array
              value:
                - name: eno2
                  interface_name: eno2
                  type: ethernet
                  ip:
                    address:
                      - 192.168.1.130/26
                    route:
                      - network: 192.168.100.120
                        prefix: 26
                        gateway: 192.168.1.129
                      - network: 192.168.100.120
                        prefix: 26
                        gateway: 192.168.1.129
                      - network: 192.168.100.120
                        prefix: 26
                        gateway: 192.168.1.129
                      - network: 192.168.100.120
                        prefix: 26
                        gateway: 192.168.1.129
                  state: up

      Expected results

      This is not enough information to reliably tell what's being changed in the remote host. Expected to see details of the change in the output when using "ansible_roles_check_mode true" with this role. For example, the desired output would look something like this:

      example output:

      TASK [rhel-system-roles.network : Show stderr messages] *******************************************************************
      ok: [test01.test.com] => {
          "__network_connections_result.stderr_lines": [
              "[001] <info>  #0, state:up persistent_state:present, 'eno2': update connection eno2, cea93b93-c22c-4393-bdfe-xxxxxxxxxxxxx", 
              "[002] <info>  #0, state:up persistent_state:present, 'eno2': up connection eno2, cea93b93-c22c-4393-bdfe-xxxxxxxxxxxxx (is-modified)"
              "[003] <info>  #0, state:up persistent_state:present, 'eno2':  add static route 192.168.100.120/24 via 192.168.1.129, cea93b93-c22c-4393-bdfe-xxxxxxxxxxxxx (is-modified)"
          ]
      }

      Actual results

      The output shows the below changes with ansible_roles_check_mode true:

       

      TASK [rhel-system-roles.network : Show stderr messages] *******************************************************************
      ok: [test01.test.com] => {
          "__network_connections_result.stderr_lines": [
              "[001] <info>  #0, state:up persistent_state:present, 'eno2': update connection eno2, cea93b93-c22c-4393-bdfe-xxxxxxxxxxxxx", 
              "[002] <info>  #0, state:up persistent_state:present, 'eno2': up connection eno2, cea93b93-c22c-4393-bdfe-xxxxxxxxxxxxx (is-modified)"
          ]
      }

              se-desktop@redhat.com SE Desktop
              rhn-support-amahindr Aniket Mahindrakar
              SE Desktop SE Desktop
              SE Desktop SE Desktop
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: