так тоже не работает
число пишет, числовую переменную нет
cat cpu.yaml
---
- name: "Show cpu"
hosts: localhost
gather_facts: true
vars:
cf_cpu_num: "{{ ansible_facts.processor_count }}"
tasks:
- debug:
msg: |-
"cf_cpu_num = {{ cf_cpu_num}} type = {{ cf_cpu_num | type_debug }}"
"ansible_facts.processor_count = {{ ansible_facts.processor_count }} type = {{ ansible_facts.processor_count | type_debug }}"
"cf_cpu_num convert to int, cf_cpu_num | int = {{ cf_cpu_num | int }}"
TASK [debug] *********************************************************************************************************************************************************************************
ok: [localhost] => {
"msg": "\"cf_cpu_num = 1 type = AnsibleUnsafeText\"\n\"ansible_facts.processor_count = 1 type = int\"\n\"cf_cpu_num convert to int, cf_cpu_num | int = 1\" "
}