Can you please assist me with a role where I wish to gather mount details of ansible client and then compare it with expected value provided by client

17 views
Skip to first unread message

Marian Saldhana

unread,
Jan 11, 2022, 12:52:24 PM1/11/22
to Ansible Project
Hi All,

I have a role to check the partition ( mount ) details of ansible client and then compare its value with the values provided by the customer, however the output of ansible_mounts is too huge once I playbook executes the role and its can't be compared with the values provided by the customer. Any advise or suggestion.
+++
---

  - name: show file contents
    debug:
      msg: "{{ lookup('file', 'customer-expects.txt') }}"

  - name: Partition details
    set_fact:
      # These dashes matter.
      expectation: |-
        {%- if lookup('file', 'customer-expects.txt')
              is regex([ansible_mounts]|join(' ')|regex_escape()) -%}
        matches
        {%- else -%}
        missed
        {%- endif -%}

Antony Stone

unread,
Jan 11, 2022, 1:10:00 PM1/11/22
to ansible...@googlegroups.com
On Tuesday 11 January 2022 at 18:52:24, Marian Saldhana wrote:

> Hi All,
>
> I have a role to check the partition ( mount ) details of ansible client
> and then compare its value with the values provided by the customer,
> however the output of ansible_mounts is too huge

What do you mean by "huge"?

Can you give an example of at least some of the output you get, and explain in
what way it is too large?

I can only think of two ways in which the output is bigger than you
want/expect:

1. More partitions are being reported than you expected

2. Each partition is reporting more detail than you expected

Which is the problem?


Antony.

--
This is not a rehearsal.
This is Real Life.

Please reply to the list;
please *don't* CC me.
Reply all
Reply to author
Forward
0 new messages