Half-Revert "Revert "Add ensure-reno and ensure-babel roles""
Add the ensure-babel role back.
This reverts half of commit 89f8a9684c
.
Change-Id: I1334ff1f469061884b222dd99e72a989d72c68be
This commit is contained in:
parent
16eb6f1f3b
commit
3bdb8d22bf
7
roles/ensure-babel/README.rst
Normal file
7
roles/ensure-babel/README.rst
Normal file
@ -0,0 +1,7 @@
|
||||
Ensure babel is installed
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: constraints_file
|
||||
|
||||
Optional path to a pip constraints file for installing python libraries.
|
36
roles/ensure-babel/tasks/main.yaml
Normal file
36
roles/ensure-babel/tasks/main.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
- 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
|
||||
get_md5: 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|skipped and not stat_results.stat.exists
|
||||
|
||||
- name: Record file location
|
||||
set_fact:
|
||||
upper_constraints: "-c {{ constraints_file }}"
|
||||
when: not stat_results|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) }}"
|
Loading…
Reference in New Issue
Block a user