loading...

using python method in ansible Jinja2 context

icy1900 profile image Roy ・1 min read
frpc_install: "{{ role_name.endswith('frpc') }}"

frpc_install is a bool, so you can use it in a when conditional statement like this

- name: Output frpc version
  debug:
    msg: '{{ frpc.stdout|trim if frpc.stdout is defined else "Not Installed" }}'
  when:
  - frpc_install

Discussion

pic
Editor guide