summaryrefslogtreecommitdiff
path: root/roles/goenv/tasks/main.yml
blob: 29e0b9e9fb4b8e321c1daa0a6a71a93e64c4e551 (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
- name: Set go config directory for macOS
  set_fact:
    goenv_conf_dir: '{{ goenv_homedir }}/Library/Application Support/go'
  when: ansible_os_family == "Darwin"
  tags:
    - dotfiles

- name: Set go config directory for Linux
  set_fact:
    goenv_conf_dir: '{{ goenv_homedir }}/.config/go'
  when: ansible_os_family != "Darwin"
  tags:
    - dotfiles

- name: Create go config directory
  ansible.builtin.file:
    path: '{{ goenv_conf_dir }}'
    state: directory
    owner: '{{ goenv_user }}'
    group: '{{ goenv_group }}'
    mode: u+rw,g-wx,o-rwx
  tags:
    - dotfiles

- name: Configure go enviroment
  ansible.builtin.template:
    src: misc/dotfiles/goenv.j2
    dest: '{{ goenv_conf_dir }}/env'
    owner: '{{ goenv_user }}'
    group: '{{ goenv_group }}'
    mode: u+rw,g+r,o+r
  tags:
    - dotfiles