]> git.phdru.name Git - ansible.git/commitdiff
Feat(debian/init-system): Split `tasks/main`
authorOleg Broytman <phd@phdru.name>
Sun, 21 Jul 2019 12:42:03 +0000 (15:42 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 21 Jul 2019 12:42:03 +0000 (15:42 +0300)
Split `tasks/main` into `tasks/apt` and `tasks/locales`.

playbooks/debian/roles/init-system/tasks/apt.yml [new file with mode: 0644]
playbooks/debian/roles/init-system/tasks/locales.yml [new file with mode: 0644]
playbooks/debian/roles/init-system/tasks/main.yml

diff --git a/playbooks/debian/roles/init-system/tasks/apt.yml b/playbooks/debian/roles/init-system/tasks/apt.yml
new file mode 100644 (file)
index 0000000..bc6c8ed
--- /dev/null
@@ -0,0 +1,50 @@
+- name: Configure apt
+  become: true
+  template:
+    src: sources.list
+    dest: /etc/apt/sources.list
+    owner: root
+    group: root
+    mode: '0640'
+
+- name: Install minimal software packages
+  become: true
+  apt:
+    autoclean: yes
+    autoremove: yes
+    install_recommends: no
+    name: ['apt', 'aptitude', 'deborphan', 'dselect',
+           'bash', 'bash-completion',
+           'curl', 'mc', 'rsync', 'vim', 'wget',
+           'arj', 'bzip2', 'lzip', 'lzma', 'lzop', 'p7zip',
+           'unzip', 'zip', 'xz-utils',
+           'gnupg', 'gnupg2',
+           'adjtimex', 'logcheck',
+           'bsd-mailx', 'mutt', 'procmail',
+           'python', 'python2.7', 'python3',
+          ]
+    purge: yes
+    state: latest
+    update_cache: yes
+
+- name: Purge uninteresting packages
+  become: true
+  apt:
+    autoclean: yes
+    autoremove: yes
+    install_recommends: no
+    name: ['avahi-autoip', 'bluetooth', 'bluez',
+           'debian-faq', 'doc-debian',
+           'emacsen-comm', 'vim-tiny',
+          ]
+    purge: yes
+    state: absent
+    update_cache: no
+
+
+- name: Configure apt key for deb-multimedia
+  become: true
+  apt_key:
+    keyserver: keyserver.ubuntu.com
+    id: 5C808C2B65558117
+  when: "inventory_hostname in ('localhost', 'iskra-aviel.phdru.name')"
diff --git a/playbooks/debian/roles/init-system/tasks/locales.yml b/playbooks/debian/roles/init-system/tasks/locales.yml
new file mode 100644 (file)
index 0000000..63a3e1b
--- /dev/null
@@ -0,0 +1,9 @@
+- name: Check locales
+  shell: "grep -c '^ru_RU.KOI8-R' /etc/locale.gen || :"
+  register: has_locales
+
+- debug:
+    msg: "Creating and regenerating locales..."
+  changed_when: true # Force notification
+  notify: Configure locales
+  when: has_locales.stdout == "0"
index 0853c8b841274eff30945020102440cb73ec631c..83104c73bd0a06ca8c7d748ff712484b579fa1be 100644 (file)
@@ -1,59 +1,5 @@
-- name: Configure apt
-  become: true
-  template:
-    src: sources.list
-    dest: /etc/apt/sources.list
-    owner: root
-    group: root
-    mode: '0640'
+- name: apt
+  import_tasks: apt.yml
 
-- name: Install minimal software packages
-  become: true
-  apt:
-    autoclean: yes
-    autoremove: yes
-    install_recommends: no
-    name: ['apt', 'aptitude', 'deborphan', 'dselect',
-           'bash', 'bash-completion',
-           'curl', 'mc', 'rsync', 'vim', 'wget',
-           'arj', 'bzip2', 'lzip', 'lzma', 'lzop', 'p7zip',
-           'unzip', 'zip', 'xz-utils',
-           'gnupg', 'gnupg2',
-           'adjtimex', 'logcheck',
-           'bsd-mailx', 'mutt', 'procmail',
-           'python', 'python2.7', 'python3',
-          ]
-    purge: yes
-    state: latest
-    update_cache: yes
-
-- name: Purge uninteresting packages
-  become: true
-  apt:
-    autoclean: yes
-    autoremove: yes
-    install_recommends: no
-    name: ['avahi-autoip', 'bluetooth', 'bluez',
-           'debian-faq', 'doc-debian',
-           'emacsen-comm', 'vim-tiny',
-          ]
-    purge: yes
-    state: absent
-    update_cache: no
-
-
-- name: Configure apt key for deb-multimedia
-  become: true
-  apt_key:
-    keyserver: keyserver.ubuntu.com
-    id: 5C808C2B65558117
-  when: "inventory_hostname in ('localhost', 'iskra-aviel.phdru.name')"
-
-- name: Check locales
-  shell: "grep -c '^ru_RU.KOI8-R' /etc/locale.gen || :"
-  register: has_locales
-- debug:
-    msg: "Creating and regenerating locales..."
-  changed_when: true # Force notification
-  notify: Configure locales
-  when: has_locales.stdout == "0"
+- name: locales
+  import_tasks: locales.yml