diff --git a/defaults/main.yml b/defaults/main.yml index 8205cbaa..f8dc9006 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -326,7 +326,12 @@ horizon_translations_update: False # This variable is used to define the version of the project # (horizon) to pull from Zanata. Default value is master, # other possibly values are stable/pike, stable/queens... -horizon_translations_project_version: master +horizon_translations_project_version: "master" + +# This variable is used to be able to fully override or +# partially union/intersect lists in order to change the +# behaviour of the pull of the translations per component. +horizon_translations_pull: "{{ _horizon_translations_pull }}" # This variable is used by the repo_build process to determine # which host group to check for members of before building the diff --git a/tasks/horizon_translations_update.yml b/tasks/horizon_translations_update.yml index 6c4940b9..f36c89e3 100644 --- a/tasks/horizon_translations_update.yml +++ b/tasks/horizon_translations_update.yml @@ -13,13 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Perform a Horizon Zanata Pull Catalog - command: "{{ horizon_bin }}/horizon-manage.py pull_catalog -v {{ horizon_translations_project_version | replace('/', '-') }}" +- name: Perform a Zanata Pull Catalog + command: "{{ horizon_bin }}/horizon-manage.py pull_catalog -p {{ translation.project }} -b {{ (translation.branch | default(horizon_translations_project_version)) | replace('/', '-') }}" args: chdir: "{{ horizon_lib_dir }}/" changed_when: false + with_items: "{{ horizon_translations_pull }}" + loop_control: + loop_var: translation + when: + - translation.enabled | bool -- name: Perform Horizon Zanata Compile Messages +- name: Perform Zanata Compile Messages command: "{{ horizon_bin }}/horizon-manage.py compilemessages" args: chdir: "{{ horizon_lib_dir }}/{{ item }}" diff --git a/vars/main.yml b/vars/main.yml index 61147f53..1b62c763 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -101,3 +101,10 @@ _horizon_panels: - src: "{{ horizon_lib_dir }}/octavia_dashboard/enabled/_1482_project_load_balancer_panel.py" path: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_1482_project_load_balancer_panel.py" state: "{{ (horizon_enable_octavia_ui | bool) | ternary('link', 'absent') }}" + +_horizon_translations_pull: + - project: "horizon" + enabled: True + - project: "heat-dashboard" + enabled: "{{ horizon_enable_heat_ui }}" +