]> git.phdru.name Git - ansible.git/blobdiff - playbooks/debian/roles/init-system/tasks/locales.yml
Refactor: Join tasks into blocks to factor out conditions
[ansible.git] / playbooks / debian / roles / init-system / tasks / locales.yml
index 81434078bcee66d0d8dc50e766c5fbf82ba4b7c3..8351b6005fa04be46b8626bc50d75bd63a9823e1 100644 (file)
@@ -7,20 +7,19 @@
     msg: "Locales have already been configured"
   when: has_locales.stdout != "0"
 
-- name: Configure locales
-  become: true
-  lineinfile:
-    path: /etc/locale.gen
-    regexp: "^{{ item }}"
-    line: "{{ item }}"
-  loop: [
-      'en_US ISO-8859-1',
-      'ru_RU.KOI8-R KOI8-R',
-      'ru_RU.UTF-8 UTF-8',
-  ]
-  when: has_locales.stdout == "0"
-
-- name: Regenerate locales
-  become: true
-  command: /usr/sbin/locale-gen
+- block:
+    - name: Configure locales
+      become: true
+      lineinfile:
+        path: /etc/locale.gen
+        regexp: "^{{ item }}"
+        line: "{{ item }}"
+      loop: [
+          'en_US ISO-8859-1',
+          'ru_RU.KOI8-R KOI8-R',
+          'ru_RU.UTF-8 UTF-8',
+      ]
+    - name: Regenerate locales
+      become: true
+      command: /usr/sbin/locale-gen
   when: has_locales.stdout == "0"