Execution
Date 08 Dec 2025 13:50:33 +0000
Duration 00:06:27.80
Controller aio1.openstack.local
User root
Versions
Ansible 2.18.6
ara 1.7.4 / 1.7.4
Python 3.12.11
Summary
7 Hosts
589 Tasks
576 Results
37 Plays
222 Files
0 Records

File: /home/zuul/src/opendev.org/openstack/openstack-ansible-repo_server/tasks/repo_install_constraints.yml

---
# Copyright 2021, BBC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Ensure deploy host u-c directory exists
  ansible.builtin.file:
    state: directory
    path: "{{ repo_upper_constraints_path }}"
    mode: "0755"
  delegate_to: localhost

# by default the u-c file is retrieved by https
- name: Retrieve upper constraints using https
  ansible.builtin.get_url:
    url: "{{ user_requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }}"
    dest: "{{ repo_upper_constraints_path }}/{{ 'upper_constraints_' ~ requirements_git_install_branch | default('master') ~ '.txt' }}"
    mode: "0644"
    timeout: 30
  when: requirements_git_repo is search('http')
  register: _fetch_uc_https
  until: _fetch_uc_https is success
  retries: 5
  delay: 5
  delegate_to: localhost

- name: Retrieve local filesystem upper constraints in CI
  ansible.builtin.command:
    git --git-dir={{ requirements_git_repo.split('file://')[1] }}/.git show {{ requirements_git_install_branch | default('master') }}:upper-constraints.txt
  when: requirements_git_repo is search('file://')
  register: _uc_contents_git
  delegate_to: localhost
  tags:
    - skip_ansible_lint

- name: Copy local upper constraints content to a file in CI
  ansible.builtin.copy:
    content: "{{ _uc_contents_git.stdout }}"
    dest: "{{ repo_upper_constraints_path }}/{{ 'upper_constraints_' ~ requirements_git_install_branch | default('master') ~ '.txt' }}"
    mode: "0644"
  when: requirements_git_repo is search('file://')
  delegate_to: localhost

- name: Copy all constraints files from the deploy host to the first repo server
  ansible.builtin.copy:
    src: "{{ repo_upper_constraints_path }}/"
    dest: "{{ repo_server_directory_root }}/constraints/"
    owner: "{{ repo_service_user_name }}"
    group: "{{ repo_service_group_name }}"
    mode: "0644"

- name: Create a symlink for constraints file
  ansible.builtin.file:
    src: "{{ repo_server_directory_root }}/constraints/{{ 'upper_constraints_' ~ requirements_git_install_branch | default('master') ~ '.txt' }}"
    dest: "{{ repo_server_directory_root }}/constraints/upper_constraints_cached.txt"
    owner: "{{ repo_service_user_name }}"
    group: "{{ repo_service_group_name }}"
    state: link
    mode: "0644"