aboutsummaryrefslogtreecommitdiffstats
path: root/roles/common/tasks/main.yml
blob: 6e816c71e197a2ce8e16eb00862c5c0cc2ded994 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

# common ~~ tasks/main.yml

---

- name: check existence of data directory
  file:
    path: /data
    owner: root
    group: "{{ group_root }}"
    state: directory
    mode: 0711

- name: copy zsh configuration file
  copy:
    src: zshrc
    dest: "{{ path_zshconfig }}"
    owner: root
    group: "{{ group_root }}"
    mode: 0644

- name: copy tmux configuration file
  copy:
    src: tmux.conf
    dest: "{{ path_tmuxconfig }}"
    owner: root
    group: "{{ group_root }}"
    mode: 0644

- name: synchronize host hostname with config hostname
  hostname: name="{{ inventory_hostname }}"

- 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 to zsh for all valid users
  user: name="{{ item }}" shell="{{ path_zsh }}"
  loop: "{{ valid_users_shell.stdout_lines }}"
remember that computers suck.