summaryrefslogtreecommitdiff
path: root/playbooks/zuul-stream/pre.yaml
blob: 9753fab85002b872434cd4ba0bf36c2589968238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
- hosts: controller
  roles:

    - role: ensure-pip

    - role: bindep
      bindep_profile: test
      bindep_dir: src/opendev.org/zuul/zuul

  post_tasks:

    - name: Setup 2.7 container environment
      include_tasks: 2.7-container.yaml

    - name: Setup inventory
      include_tasks: create-inventory.yaml

    - name: Install pip
      shell: |+
        python3 -m pip install --upgrade pip setuptools wheel
      become: yes

    - name: Build wheel
      shell:
        chdir: src/opendev.org/zuul/zuul
        cmd: |+
          python3 setup.py bdist_wheel

    - name: Install software
      shell: |+
        python3 -m pip install src/opendev.org/zuul/zuul/dist/*.whl
      become: yes

    - name: Install managed ansible versions
      command: /usr/local/bin/zuul-manage-ansible -v
      become: yes
      environment:
        # This appears to be necessary because without it the virtualenvs
        # that virtualenv creates are not actually virtualenvs. They are just
        # aliases for the root python installation instead. Then we try to
        # install multiple ansible versions to the root (via multiple fake
        # venvs) and the installation fails due to conflicts.
        SETUPTOOLS_USE_DISTUTILS: stdlib

    - name: Copy ansible.cfg
      template:
        src: templates/ansible.cfg.j2
        dest: "{{ ansible_user_dir }}/ansible.cfg"

    - name: Generate logging config
      command: python3 src/opendev.org/zuul/zuul/zuul/ansible/logconfig.py