- name: Perform validation
  hosts: localhost
  gather_facts: yes
  any_errors_fatal: true
  tasks:
      - fail:
            msg: "Please provide either --version OR --images-task OR --quickstart-{backup|restore} OR --upgrade OR --update-undercloud"
        when:
            - not install.version|default('')
            - not install.images.task|default('')
            - not install.quickstart.backup|default('')
            - not install.quickstart.restore|default('')
            - not install.upgrade|default('')
            - not install.get('update', {}).undercloud|default('')

      - fail:
            msg: "Please provide either --version OR --upgrade OR --update-undercloud"
        when:
            - install.version|default('')
            - install.upgrade|default('')
            - install.get('update', {}).undercloud|default('')

      - fail:
            msg: "Image task 'rpm' is not supported for product version '{{ install.version }}'. Use another image task."
        when:
            - install.version|default('')
            - install.version|openstack_release < 8
            - install.images.task|default('')  == 'rpm'

      - name: validate director build
        vars:
            director_build: "{{ install.get('director', {}).build|default(False) }}"
        debug:
            msg: "No director puddle for release {{ install.version }}"
        when:
            - director_build
            - "install.version|openstack_release > 9"

- name: Perform validation
  hosts: localhost
  gather_facts: yes
  any_errors_fatal: true
  tasks:
      - fail:
            msg: "Please provide either --version OR --images-task OR --quickstart-{backup|restore} OR --upgrade OR --update-undercloud"
        when:
            - not install.version|default('')
            - not install.images.task|default('')
            - not install.quickstart.backup|default('')
            - not install.quickstart.restore|default('')
            - not install.upgrade|default('')
            - not install.get('update', {}).undercloud|default('')

      - fail:
            msg: "Please provide either --version OR --upgrade OR --update-undercloud"
        when:
            - install.version|default('')
            - install.upgrade|default('')
            - install.get('update', {}).undercloud|default('')

      - fail:
            msg: "Image task 'rpm' is not supported for product version '{{ install.version }}'. Use another image task."
        when:
            - install.version|default('')
            - install.version|openstack_release < 8
            - install.images.task|default('')  == 'rpm'

      - name: validate director build
        vars:
            director_build: "{{ install.get('director', {}).build|default(False) }}"
        debug:
            msg: "No director puddle for release {{ install.version }}"
        when:
            - director_build is defined and director_build
            - "install.version|openstack_release > 9"

Fix evaluation for director build parameter.
Fix evaluation for director build parameter.

When director-build is provided validation fails with message:
  msg: The conditional check 'director_build' failed.
  The error was: error while evaluating conditional (director_build):
   'GA' is undefined

Change-Id: I20ce676da8c91fbba13de6cf8dd325882dfa9628
