Skip to content

Commit

Permalink
performing the tasks in check mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Nov 22, 2024
1 parent 7906e10 commit 721fbfc
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions automation/roles/pre-checks/tasks/huge_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@
| first | default('128MB'))
}}
- name: "HugePages | Get Hugepagesize value from /proc/meminfo"
ansible.builtin.command: "awk '/Hugepagesize/ {print $2}' /proc/meminfo"
changed_when: false
register: huge_page_size

- name: "Debug | Hugepagesize command result"
ansible.builtin.debug:
var: huge_page_size

- name: "HugePages | Get HugePages_Total value from /proc/meminfo"
ansible.builtin.command: "awk '/HugePages_Total/ {print $2}' /proc/meminfo"
changed_when: false
register: huge_pages_total

- name: "Debug | HugePages_Total command result"
ansible.builtin.debug:
var: huge_pages_total

- name: "HugePages | Set variable: shared_buffers_gb"
ansible.builtin.set_fact:
shared_buffers_gb: "{{ (shared_buffers_value | int) // 1024 }}"
Expand All @@ -55,6 +37,22 @@
when:
- (shared_buffers_gb | default(0) | int) < (min_shared_buffers_gb | default(8) | int)

- name: "HugePages | Get Hugepagesize value from /proc/meminfo"
ansible.builtin.command: "awk '/Hugepagesize/ {print $2}' /proc/meminfo"
changed_when: false
check_mode: true
register: huge_page_size
when:
- shared_buffers_gb | default(0) | int >= (min_shared_buffers_gb | default(8))

- name: "HugePages | Get HugePages_Total value from /proc/meminfo"
ansible.builtin.command: "awk '/HugePages_Total/ {print $2}' /proc/meminfo"
changed_when: false
check_mode: true
register: huge_pages_total
when:
- shared_buffers_gb | default(0) | int >= (min_shared_buffers_gb | default(8))

- name: "HugePages | Calculate required HugePages"
ansible.builtin.set_fact:
huge_pages_required: >-
Expand Down

0 comments on commit 721fbfc

Please sign in to comment.