Ansible - Use default if a variable is not defined

The Solution to Ansible - Use default if a variable is not defined is


You can use Jinja's default:

- name: Create user
  user:
    name: "{{ my_variable | default('default_value') }}"

~ Answered on 2016-01-30 22:06:43


Most Viewed Questions: