summaryrefslogtreecommitdiff
path: root/ansible/roles/liw/tasks/main.yml
blob: 916d14050aea484faebe392169059804233a60ed (plain)
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
- name: "install git"
  apt:
    name: git

- name: "configure liw account"
  shell: |
    if ! [ -e /home/liw/.config ]; then sudo -u liw -i git clone git://git.liw.fi/liw-dot-files; fi
    sudo -u liw -i bash -c "pwd &&  ./liw-dot-files/make-symlinks"
    sudo -u liw -i bash -c "ln -nsf liw-dot-files/gitconfig-exolobe1 .gitconfig"

- name: "make sure ~liw/.ssh/known_hosts exists"
  shell: |
    dir=/home/liw/.ssh
    k="$dir/known_hosts"
    if ! [ -e "$dir" ]; then install -d -o liw -g liw -m 0755 "$dir"; fi
    if ! [ -e "$k" ]; then touch "$k"; fi

- name: "configure liw SSH known hosts"
  lineinfile:
    line: "@cert-authority * ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW1QmBC3OLsjpUv1gIYBHSN5tWhPOHHzDIXgj8d1Hg1"
    path: /home/liw/.ssh/known_hosts
    owner: liw
    group: liw
    mode: 0644

- name: "create ~liw/src and ~liw/cargo"
  file:
    state: directory
    name: "/home/liw/{{ item }}"
    owner: liw
    group: liw
  with_list:
    - src
    - cargo