aboutsummaryrefslogtreecommitdiffstats
path: root/roles/sshdns/tasks/main.yml
blob: f62c706c6176a74003f77cc87425543ac5c82f05 (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
---

- name: get current user
  shell: whoami
  register: result

- name: set current user
  set_fact:
    sshdns_user: '{{ result.stdout_lines[0] }}'

- name: create config directory
  file:
    path: '/home/{{ sshdns_user }}/.ssh/config.d'
    state: directory
    group: '{{ sshdns_user }}'
    owner: '{{ sshdns_user }}'
    mode: '0700'

- name: generate template to localhost
  template:
    src: templates/sshdns.j2
    dest: '/home/{{ sshdns_user }}//.ssh/config.d/ssh_dns'
    owner: '{{ sshdns_user }}'
    group: '{{ sshdns_user }}'
    mode: '0600'
remember that computers suck.