]> git.phdru.name Git - ansible.git/commitdiff
Refactor(init-system): Merge locale handlers back into tasks
authorOleg Broytman <phd@phdru.name>
Tue, 23 Jul 2019 23:28:03 +0000 (02:28 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 23 Jul 2019 23:55:47 +0000 (02:55 +0300)
playbooks/debian/roles/init-system/handlers/main.yml [deleted file]
playbooks/debian/roles/init-system/tasks/locales.yml

diff --git a/playbooks/debian/roles/init-system/handlers/main.yml b/playbooks/debian/roles/init-system/handlers/main.yml
deleted file mode 100644 (file)
index 701e789..0000000
+++ /dev/null
@@ -1,16 +0,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',
-  ]
-  notify: Regenerate locales
-
-- name: Regenerate locales
-  become: true
-  command: /usr/sbin/locale-gen
index 77adf741bae3f7072ee242a9aeec8f73ed402e48..58b7aa7371020c2f5ae09531e04bf7e706f0c12b 100644 (file)
@@ -3,11 +3,23 @@
   register: has_locales
 
 - debug:
-    msg: "Creating and regenerating locales..."
-  changed_when: true # Force notification
-  notify: Configure locales
+    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"
 
-- debug:
-    msg: "Locales has already been created"
-  when: has_locales.stdout != "0"
+- name: Regenerate locales
+  become: true
+  command: /usr/sbin/locale-gen
+  when: has_locales.stdout == "0"