diff options
author | binary <me@rgoncalves.se> | 2020-11-18 09:41:04 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2020-11-18 09:41:04 +0100 |
commit | 874a27a2e86b82bc381bc7270b2bec3d9dfb7114 (patch) | |
tree | fb05e0b3e8507dc5772616fbbb0c1f0f8d6a451d /roles/common/tasks | |
parent | 79610f53d3bdf8b45bbf8acac44b27e2cf296f57 (diff) | |
download | infrastructure-874a27a2e86b82bc381bc7270b2bec3d9dfb7114.tar.gz |
Per distribution config path
Diffstat (limited to 'roles/common/tasks')
-rw-r--r-- | roles/common/tasks/main.yml | 41 |
1 files changed, 14 insertions, 27 deletions
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 }}" |