- hosts: all
  name: Autoconverted job legacy-infra-puppet-apply-4-centos-7 from old job gate-infra-puppet-apply-4-centos-7
  tasks:

    - name: Ensure legacy workspace directory
      file:
        path: '{{ ansible_user_dir }}/workspace'
        state: directory

    - shell:
        cmd: |
          set -e
          set -x
          /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
            git://git.openstack.org openstack-infra/system-config
        executable: /bin/bash
        chdir: '{{ ansible_user_dir }}/workspace'
      environment: '{{ zuul | zuul_legacy_vars }}'

    - shell:
        cmd: |
          set -e
          set -x
          cd openstack-infra/system-config
          /usr/local/jenkins/slave_scripts/install-distro-packages.sh
          if [ "4" == "4" ]; then
              # TODO:
              echo "TODO: add logic to deploy puppet4"
          fi
          ./tools/apply-test.sh
        executable: /bin/bash
        chdir: '{{ ansible_user_dir }}/workspace'
      environment: '{{ zuul | zuul_legacy_vars }}'