Ansible - String

> Infrastructure as code > Ansible

1 - About

string data type in Ansible

3 - Management

3.1 - Lower

ansible_facts['os_family']|lower == 'redhat'

3.2 - Split

{{ msg.split('\n') }}

3.3 - Concat

  • Python concat operator
{{ stringVar + (integerVar|string) }}
  • Concat with pipe
{{ (var1 + var2 + var3) | hash('sha512') }}
Advertising

3.4 - To String

(integerVar | string)
infra/ansible/string.txt · Last modified: 2019/10/07 13:10 by gerardnico