From 874a27a2e86b82bc381bc7270b2bec3d9dfb7114 Mon Sep 17 00:00:00 2001 From: binary Date: Wed, 18 Nov 2020 09:41:04 +0100 Subject: Per distribution config path --- roles/common/tasks/main.yml | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) (limited to 'roles/common/tasks') diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 1bc657f..6e816c7 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -3,50 +3,37 @@ --- -- name: Check installation of packages - package: - name: "{{ item }}" - state: present - loop: "{{ common_packages +lookup('vars', 'common_packages_' + ansible_distribution | lower) }}" - ignore_errors: true - -- name: Check existence of primary directory +- name: check existence of data directory file: - path: /data/{{ item }} + path: /data + owner: root + group: "{{ group_root }}" state: directory - loop: - - git - - -- include: "init_{{ ansible_distribution | lower }}.yml" - ignore_errors: true + mode: 0711 -- name: Copy zshrc configuration file +- name: copy zsh configuration file copy: src: zshrc - dest: "{{ path_zshrc }}" + dest: "{{ path_zshconfig }}" owner: root group: "{{ group_root }}" mode: 0644 -- name: Copy tmux configuration file +- name: copy tmux configuration file copy: src: tmux.conf - dest: /etc/tmux.conf + dest: "{{ path_tmuxconfig }}" owner: root group: "{{ group_root }}" mode: 0644 -- name: Synchronize host hostname with config hostname - hostname: - name: "{{ inventory_hostname }}" +- name: synchronize host hostname with config hostname + hostname: name="{{ inventory_hostname }}" -- name: Retrieve all valid users for zsh +- name: retrieve all users shell: awk -F ":" '{ if($3 == 0 || $3 > 999 && $3 < 16000) { print $1 }}' /etc/passwd register: valid_users_shell -- name: Change shell for all valid users to zsh - user: - name: "{{ item }}" - shell: "{{ path_zsh }}" +- name: change shell to zsh for all valid users + user: name="{{ item }}" shell="{{ path_zsh }}" loop: "{{ valid_users_shell.stdout_lines }}" -- cgit v1.2.3