How specify a list value as variable in ansible inventory file?

后端 未结 5 1177
栀梦
栀梦 2020-12-13 06:34

I need something like (ansible inventory file):

[example]
127.0.0.1 timezone=\"Europe/Amsterdam\" locales=\"en_US\",\"nl_NL\"

However, ansi

5条回答
  •  爱一瞬间的悲伤
    2020-12-13 06:44

    With complex variables, it's best to define them in a host_vars file rather than in the inventory file, since host_vars files support YAML syntax.

    Try creating a host_vars/127.0.0.1 file with the following content:

    timezone: Europe/Amsterdam
    locales:
        - en_US
        - nl_NL
    

提交回复
热议问题