Hi, All!
My code:
- name: ===== Блок отримання інформації про виділену RAM
==========================================
block:
- name: ===== Вівід інформації про виділену, використану та залишок памяті
====================
ansible.builtin.debug:
msg: "Виділена пам'ять: {{ ansible_memory_mb.real.total }} | Використана:
{{ ansible_memory_mb.real.used }} | Залишилось: {{
ansible_memory_mb.real.total - ansible_memory_mb.real.used }} ({{
((1-ansible_memory_mb.real.used/ansible_memory_mb.real.total)*100)|int }}%)"
вторник, 8 февраля 2022 г. в 19:16:40 UTC+2, Rilindo Foster:
> Hi Dip!
>
> Assuming that you are referring to this code, note that that Ansible will
> run python on the target node - Python the interpreter itself will consume
> memory. And then if you run the shell module under Ansible, it will spawn a
> shell which itself will consume memory as well.
>
> - Rilindo
>
> On Feb 8, 2022, at 8:46 AM, Dip Giri <[email protected]> wrote:
>
> Whatever ansible give a memory info in ansible_fact it doesn't match with
> memory info
> that we get from *free -m *command. Why this problem happened for that if
> have any solution plz give me
>
> ---
> - name: Setup server
> hosts: localhost
> tasks:
>
> - name: test
> shell: free -m
> register: xyz
>
> - name: Print service status
> debug:
> msg: "{{ansible_memory_mb.real}}"
>
> - name: Print service status
> debug:
> msg: "{{xyz.stdout.split('\n')}}"
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/74109954-cb3c-4b72-a5b0-34f9e425f16fn%40googlegroups.com
>
> <https://groups.google.com/d/msgid/ansible-project/74109954-cb3c-4b72-a5b0-34f9e425f16fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/41d02f4e-e790-49da-92d6-8e900386be0bn%40googlegroups.com.