Skip to content

Unsure what sap_swap does and how swap is decided #45

@rdvansloten

Description

@rdvansloten

Hi,

I want to configure my swap per type of machine, and came upon a block of code I do not quite understand:

- include_tasks: swap.yml
  loop: "{{ sap_swap }}"
  when: item.tier == "HANA" or item.tier == "all"

I investigated sap_swap, which is an array with all/HANA, with 2 different swap sizes.

sap_swap:
  - { tier: 'all',  swap_size_mb: '20480' }
  - { tier: 'HANA', swap_size_mb: '2048' }

How does this script differentiate between machine "tiers"? Won't the linked swap.yml that is being looped always apply the last value of this array? I don't see a reference to tiers anywhere.

- name:         "Ensure swapfile size"
  lineinfile:
    state:      present
    dest:       /etc/waagent.conf
    regexp:     'ResourceDisk.SwapSizeMB='
    line:       'ResourceDisk.SwapSizeMB={{ item.swap_size_mb }}'

I am probably missing something, but where is tier coming from and how is a VM identified as having one tier or another?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions