ansible: Split base role into separate task files
[noc.git] / ansible / roles / base / tasks / 05tools.yml
diff --git a/ansible/roles/base/tasks/05tools.yml b/ansible/roles/base/tasks/05tools.yml
new file mode 100644 (file)
index 0000000..8a25597
--- /dev/null
@@ -0,0 +1,34 @@
+---
+- name: install base tools
+  apt:
+    name:
+      - htop
+      - zsh
+
+- name: set root default shell to zsh
+  user:
+    name: root
+    shell: /bin/zsh
+
+- name: set default shell for adduser
+  with_dict:
+    DSHELL: /bin/zsh
+  lineinfile:
+    dest: /etc/adduser.conf
+    regexp: "^#?{{ item.key }}="
+    line: "{{ item.key }}={{ item.value }}"
+
+- name: Deploy default configuration for tools
+  with_dict:
+    /etc/htoprc: "{{ global_files_dir }}/common/htoprc"
+
+    /etc/zsh/zprofile: zprofile
+    /etc/zsh/zshrc: zshrc
+    /etc/skel/.zshrc: zshrc.skel
+
+  loop_control:
+    label: "{{ item.key }}"
+  copy:
+    mode: 0644
+    src: "{{ item.value }}"
+    dest: "{{ item.key }}"