# common ~~ tasks/main.yml --- - 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 file: path: /data/{{ item }} state: directory loop: - git - include: "init_{{ ansible_distribution | lower }}.yml" ignore_errors: true - name: Copy zshrc configuration file copy: src: zshrc dest: "{{ path_zshrc }}" owner: root group: "{{ group_root }}" mode: 0644 - name: Copy tmux configuration file copy: src: tmux.conf dest: /etc/tmux.conf owner: root group: "{{ group_root }}" mode: 0644 - name: Synchronize host hostname with config hostname hostname: name: "{{ inventory_hostname }}" - name: Retrieve all valid users for zsh 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 }}" loop: "{{ valid_users_shell.stdout_lines }}"