zuul-jobs/roles/ensure-babel/tasks/main.yaml
Lukas Kranz d8ec17cab0 Remove get_md5 parameter from stat module.
The get_md5 parameter was removed with ansible 9.
https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_9.html#id44

If it is being used the following error appears:
"Unsupported parameters for (stat) module: get_md5..."

Unrelated, but also blocking testing/merging of this change, the
Ansible version specs for older python versions is loosened
to allow installing older versions of Ansible on test nodes (like
focal) that have older pythons that are unsupported by newer Ansible.

Change-Id: I99dd4f16fde659d84eb3dfa191557b3d9508b0fb
2024-08-01 07:12:17 -07:00

36 lines
889 B
YAML

- name: Install gettext package
package:
name: gettext
state: present
become: yes
- name: Check to see if the constraints file exists
stat:
path: "{{ constraints_file }}"
get_checksum: false
get_mime: false
register: stat_results
when: constraints_file is defined
- name: Fail if constraints file does not exist
fail:
msg: "Variable constraints_file is set but file does not exist."
when:
- constraints_file is defined
- not stat_results is skipped and not stat_results.stat.exists
- name: Record file location
set_fact:
upper_constraints: "-c {{ constraints_file }}"
when: not stat_results is skipped and stat_results.stat.exists
- name: Install babel
pip:
name:
- pbr
- Babel
- lxml
- requests
virtualenv: "{{ ansible_user_dir }}/.venv"
extra_args: "{{ upper_constraints | default(omit) }}"