Using Variables within a YAML Task

Variables from any workflow task can be referred within the YAML task as part of the automation process. Use the following variable syntax in the YAML task to refer value from a previous task: <%variable_name%>

Following is an illustration for referring the ‘fqdn’ and ‘FreeIP’ values from an Infoblox task into a YAML task:

--
-
 name: Creating a virtual server in a F5 device
 hosts: local
 tasks:
        - name: Add virtual server
          bigip_virtual_server:
            server: <%device%>
            user: $$<%device%>.username$$
            password: $$<%device%>.password$$
            state: present
            partition: Common
            name: <%fqdn%>
            destination: <%free_ip%>
            port: 480
            snat: Automap
            description: Test Virtual Server
            validate_certs: no
            all_profiles:
              - http
              - tcp
          delegate_to: localhost