Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-25183

Satellite cannot execute playbook containing "mount" module

XMLWordPrintable

    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • 0
    • Phoenix - Subscriptions
    • To Do
    • Yes

      Description of problem:

      Satellite cannot execute a playbook from Insights Remediations containing a reference to the "mount" module. When asked to do so, Satellite will log the following in /var/log/foreman/production.log:

      ERROR! couldn't resolve module/action 'mount'. This often indicates a misspelling, missing collection, or incorrect module path.
      The error appears to be in '/tmp/d20240425-994257-1u6udd0/project/playbook.yml': line 3311, column 7, but may
      be elsewhere in the file depending on the exact syntax problem.
      The offending line appears to be:
          - name: 'Add nodev Option to /dev/shm: Ensure /dev/shm is mounted with nodev option'
      

      This was encountered in: https://access.redhat.com/support/cases/#/case/03777706

      How reproducible:

      Always.

      Is this issue a regression from an earlier version:

      Yes. Satellite running on RHEL 8.6+ or 9.0+ is affected.

      Steps to Reproduce:

      Ideally, we'd create a playbook in Insights Remediations that uses the mount module, then execute it ourselves. Unfortunately, I'm unsure how to do this.

      As a second-best, given a Satellite, create a file playbook.yaml containing the following:

      - name: Test playbook
        hosts: localhost
        become: true
        vars: 
          insights_signature_exclude: /hosts,/vars/insights_signature
        tasks: 
          - name: Unmount a mounted volume
            mount: 
              path: /mnt/test
              state: unmounted
      

      Then, execute it:

      ansible-playbook my-playbook.yaml
      

      This will fail in the same way as described by the customer:

      [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
      ERROR! couldn't resolve module/action 'mount'. This often indicates a misspelling, missing collection, or incorrect module path.
      
      The error appears to be in '/root/mount-playbook.yaml': line 7, column 7, but may
      be elsewhere in the file depending on the exact syntax problem.
      
      The offending line appears to be:
      
        tasks:
          - name: Unmount a mounted volume
            ^ here
      

      Actual behavior:

      rhc-worker-playbook, used by RHC-connected systems, provides this module:

      # find / -regex '.*ansible.posix'
      /usr/share/rhc-worker-playbook/ansible/collections/ansible_collections/ansible/posix
      

      Satellite doesn't provide this module:

      # find / -regex '.*ansible.posix'
      

      Additionally, one can kinda-sorta work around this issue on a Satellite by executing ansible-galaxy collection install ansible.posix, which will install the necessary Ansible modules into a directory like /root/.ansible. From this point on, root will be able to execute this playbook.

      To me, all of this suggests that Satellite doesn't bundle all necessary modules for executing playbooks.

      Expected behavior:

      Ansible playbooks referencing mount should be executable. So should any Ansible playbook referencing any other module provided by rhc-worker-playbook.

      Business Impact / Additional info:

       Customers can't remediate certain issues using Satellite.

              Unassigned Unassigned
              jaudet@redhat.com Jeremy Audet
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated: