-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.yml
113 lines (98 loc) · 2.7 KB
/
user.yml
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
- hosts: localhost
tasks:
- name: Add mep user
user:
name: mep
comment: MEP User Account
groups: "adm"
shell: /bin/bash
append: yes
- name: create mep .ssh directory
file:
path: /home/mep/.ssh
state: directory
owner: mep
group: mep
mode: 0700
- name: chown /opt to mep
file:
path: /opt/
state: directory
owner: root
group: adm
mode: 0775
- name: copy ssh key to mep
copy:
src: /opt/radiohound/.ssh/mep_key
dest: /home/mep/.ssh/id_rsa
mode: 0600
owner: mep
group: mep
- name: copy git ssh key to mep
copy:
src: /opt/radiohound/.ssh/id_rsa
dest: /home/mep/.ssh/git_key
mode: 0600
owner: mep
group: mep
- name: copy authorized_keys to mep
copy:
src: "files/mep_authorized_keys"
dest: /home/mep/.ssh/authorized_keys
mode: 0600
owner: mep
group: mep
- name: copy ssh config to mep
copy:
src: "files/mep_ssh_config"
dest: /home/mep/.ssh/config
mode: 0600
owner: mep
group: mep
- name: Create /data for ring buffers
file:
path: /data
state: directory
owner: mep
group: mep
mode: 0777
- name: Add user to sudoers
lineinfile:
path: /etc/sudoers
state: present
regexp: '^%adm ALL='
line: '%adm ALL=(ALL) NOPASSWD: ALL'
validate: /usr/sbin/visudo -cf %s
- name: Clone mep-examples repository
git:
repo: [email protected]:spectrumx/mep-examples.git
dest: /opt/mep-examples
update: no
key_file: /opt/radiohound/.ssh/id_rsa
accept_hostkey: yes
register: git_clone_mep_examples
- name: chown /opt/mep-examples to mep
file:
path: /opt/mep-examples
state: directory
owner: mep
group: mep
mode: 0775
recurse: yes
- name: Add key to mep-examples repo
shell: GIT_DIR=/opt/mep-examples/.git GIT_WORK_TREE=/opt/mep-examples git config core.sshCommand "ssh -i /home/mep/.ssh/id_rsa"
args:
chdir: /opt/mep-examples
when: not git_clone_mep_examples.before
become: yes
become_user: mep
- name: Add git safe.directory to mep-examples repo
shell: GIT_DIR=/opt/mep-examples/.git GIT_WORK_TREE=/opt/mep-examples git config --add safe.directory /opt/mep-examples
when: not git_clone_mep_examples.before
become: yes
become_user: mep
- name: Install xrdp
shell: "files/xrdp-installer-1.4.6.sh"
become: yes
become_user: mep