Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsure what sap_swap does and how swap is decided #45

Open
rdvansloten opened this issue Jun 20, 2022 · 1 comment
Open

Unsure what sap_swap does and how swap is decided #45

rdvansloten opened this issue Jun 20, 2022 · 1 comment

Comments

@rdvansloten
Copy link

rdvansloten commented Jun 20, 2022

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?

@mimergel
Copy link
Owner

mimergel commented Sep 7, 2022

Hi @rdvansloten , sorry for late reply. I overlooked the notification mail from github. The differentiation happens in the devops pipeline where the ansible tasks receives the inventory. Here the private IP is in the HANA sections, thus the deployed VM will receive the small swap space of 2 GB.

- task: Ansible@0
  displayName: 'OS Preparations RHEL8 / SLES 15(Ansible)'
  inputs:
    ansibleInterface: 'agentMachine'
    playbookPathOnAgentMachine: '$(System.DefaultWorkingDirectory)/Ansible/os-settings_playbook.yml'
    inventoriesAgentMachine: inlineContent
    inventoryInlineContentAgentMachine: |
      **[hana]**
      $(privateip)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants