- hosts: all
  pre_tasks:
    - name: Ensure pip
      include_role:
        name: ensure-pip

    - name: Install git-review
      pip:
        name: git-review
        virtualenv: /opt/git-review
        virtualenv_command: '{{ ensure_pip_virtualenv_command }}'
      become: yes

    - name: Link git-review
      file:
        src: /opt/git-review/bin/git-review
        dest: /usr/local/bin/git-review
        owner: root
        group: root
        state: link
      become: yes

    - name: Copy scripts to the script dir on the node
      copy:
        dest: '{{ ansible_user_dir }}/scripts/'
        src: '{{ item }}'
        mode: 0755
      with_items:
        - generate_puppetfile.sh
        - propose_update.sh
        - sync_openstack_ansible_common_files.sh

  roles:
    - role: configure-git
      git_config:
        user.name: OpenStack Proposal Bot
        user.email: openstack-infra@lists.openstack.org
        gitreview.username: proposal-bot
    - copy-proposal-common-scripts
      # For propose-update-constraints
    - copy-release-tools-scripts
    - add-sshkey
    - bindep
    - ensure-python
    - role: ensure-tox
      ensure_global_symlinks: true

- hosts: all
  pre_tasks:
    - name: Ensure pip
      include_role:
        name: ensure-pip
      vars:
        ensure_pip_from_packages: True
        ensure_pip_from_upstream_interpreters:
          - python3.6
          - python3.7
          - python3.8

    - name: Install git-review
      pip:
        name: git-review
        virtualenv: /opt/git-review
        virtualenv_command: '{{ ensure_pip_virtualenv_command }}'
      become: yes

    - name: Link git-review
      file:
        src: /opt/git-review/bin/git-review
        dest: /usr/local/bin/git-review
        owner: root
        group: root
        state: link
      become: yes

    - name: Copy scripts to the script dir on the node
      copy:
        dest: '{{ ansible_user_dir }}/scripts/'
        src: '{{ item }}'
        mode: 0755
      with_items:
        - generate_puppetfile.sh
        - propose_update.sh
        - sync_openstack_ansible_common_files.sh

  roles:
    - role: configure-git
      git_config:
        user.name: OpenStack Proposal Bot
        user.email: openstack-infra@lists.openstack.org
        gitreview.username: proposal-bot
    - copy-proposal-common-scripts
      # For propose-update-constraints
    - copy-release-tools-scripts
    - add-sshkey
    - bindep
    - ensure-python
    - role: ensure-tox
      ensure_global_symlinks: true

Install pip for all versions
update-constraints: Install pip for all versions

Depends-on: https://review.opendev.org/739272

Change-Id: Ic6444e6c186c82a21e7fe2868c27fda3378c187a
Signed-off-by: Sean McGinnis <961eeb09b6d45516665e15b82e013282c4faf575@gmail.com>
