---
- hosts: cloud
  gather_facts: yes
  vars_files:
    - variables.yaml
  roles:
    - gather_host_info
    - fix_etc_hosts
    - fix_disk_layout
    - create_base_folder
    - start_fresh_logging
    - setup_stack_user
    - setup_tempest_user
  tasks:
    - name: Clone all git repos
      become: true
      become_user: stack
      git:
        repo: "https://git.openstack.org/{{ item }}"
        dest: "{{ BASE }}/{{ item | basename }}"
      with_items:
      - openstack-dev/devstack
      - openstack/requirements
      - openstack/tempest
      - openstack/keystone
      - openstack/keystonemiddleware
      - openstack/nova
      - openstack/glance
      - openstack/glance_store
      - openstack/neutron
      - openstack/designate
      - openstack/heat
      - openstack/heat-cfntools
      - openstack/heat-templates
    - name: Pre-install required packages
      become: true
      apt:
        name: "{{ item }}"
        state: present
      with_items: "{{ bin_packages }}"
    - name: Install pip using devstack tool
      become: true
      become_user: stack
      command: ./tools/install_pip.sh
      args:
        chdir: "{{ BASE }}/devstack"

---
- hosts: cloud
  gather_facts: yes
  vars_files:
    - variables.yaml
  roles:
    - gather_host_info
    - fix_etc_hosts
    - fix_disk_layout
    - create_base_folder
    - start_fresh_logging
    - setup_stack_user
    - setup_tempest_user
  tasks:
    - name: Clone all git repos from stable/pike
      become: true
      become_user: stack
      git:
        repo: "https://git.openstack.org/{{ item }}"
        dest: "{{ BASE }}/{{ item | basename }}"
        reference: stable/pike
      with_items:
      - openstack-dev/devstack
      - openstack/requirements
      - openstack/keystone
      - openstack/keystonemiddleware
      - openstack/nova
      - openstack/glance
      - openstack/glance_store
      - openstack/neutron
      - openstack/designate
      - openstack/heat
      - openstack/heat-cfntools
      - openstack/heat-templates
    - name: Clone all branchless git repos
      become: true
      become_user: stack
      git:
        repo: "https://git.openstack.org/{{ item }}"
        dest: "{{ BASE }}/{{ item | basename }}"
      with_items:
      - openstack/tempest
    - name: Pre-install required packages
      become: true
      apt:
        name: "{{ item }}"
        state: present
      with_items: "{{ bin_packages }}"
    - name: Install pip using devstack tool
      become: true
      become_user: stack
      command: ./tools/install_pip.sh
      args:
        chdir: "{{ BASE }}/devstack"
    - name: Pre-run the fixup stuff script
      become: true
      become_user: stack
      command: ./tools/fixup_stuff.sh
      args:
        chdir: "{{ BASE }}/devstack"

Add the fixup script and use Pike
Add the fixup script and use Pike

Use Pike for all branched repos.
Also run the fixup_stuff script since it does not depend on g-r,
and saves a bit of time from stack.sh.
