-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_basic_services.yml
77 lines (66 loc) · 1.63 KB
/
install_basic_services.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
---
- name: Install Basic Services and Configurations
hosts: aws_ec2
become: true
vars_files:
- vars/config_vars.yml
pre_tasks:
- name: Update packages
import_role:
name: update_packages
tags: always
- name: Set security configurations
import_role:
name: secure_server
tags: secure
- name: Add Swap memory
import_role:
name: add_swap
tags: swap
tasks:
- name: Install common system dependencies
apt:
name:
- openssl
- libssl-dev
- cmake
- make
- gcc
- g++
- git
- gdebi-core
state: present
- name: Set default locale
import_role:
name: set_locale
tags: locale
- name: Create personal user
user:
name: "{{ personal_user }}"
password: "{{ personal_user_password | password_hash('sha512') }}"
update_password: on_create
append: true
groups:
- root
- name: Add sudo rights for main users
lineinfile:
dest: /etc/sudoers
regexp: '^{{ item.user }}'
line: '{{ item.user }} ALL=(ALL) NOPASSWD: ALL'
state: present
validate: 'visudo -cf %s'
with_items:
- user: '{{ ansible_user }}'
- user: '{{ personal_user }}'
- name: Install and configure Nginx
import_role:
name: install_nginx
tags: nginx
- name: Install and configure Postgresql
import_role:
name: install_postgresql
tags: postgresql
- name: Install R
import_role:
name: install_r
tags: r