Sysctl

瀏覽次數:17 次
跳到第一則未讀訊息

Vino B

未讀,
2018年3月13日 凌晨4:48:192018/3/13
收件者:Ansible Project
Hi All,

   Request your help, on the below code, i wanted to check whether the sysctl paramater "vm.nr_hugepages" has any numeric value .

 - name: Check whether System Settings are Optimized
    command: sysctl -n {{ item.pname }}
    register: net_param
    failed_when: net_param.stdout != item.value
    with_items:
      - { pname: 'net.core.rmem_max', value: "16777216" }
      - { pname: 'vm.nr_hugepages', value: 'regex[0-9]' }  <==== Issue
    changed_when: false
    ignore_errors: True

From,
Vino.B

Vino B

未讀,
2018年3月13日 中午12:52:582018/3/13
收件者:Ansible Project
Hi All,

Any help is much appreciated.

Jean-Yves LENHOF

未讀,
2018年3月13日 下午1:06:452018/3/13
收件者:ansible...@googlegroups.com

Why reinventing the wheel, there's already a function for this in jinja... numeric

http://jinja.pocoo.org/docs/2.9/templates/#number

You probably have to do two different steps... It depends exactly on what you want (perhaps not what you write)

Regards,

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9960a0ec-e63b-4aa4-8c38-40275b393b34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vino B

未讀,
2018年3月14日 凌晨1:23:332018/3/14
收件者:Ansible Project
Hi Jeans,

  Thank you very much.
回覆所有人
回覆作者
轉寄
0 則新訊息