-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.yml
113 lines (102 loc) · 2.88 KB
/
store.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
---
- name: Configure Store VM
hosts: all
vars_files:
# - ../store_host_vars.yaml
- vars/store_defaults.yml
become: true
gather_facts: true
vars:
apt_retries: 15
apt_retry_delay: 20
handlers:
- name: Restart sshd
service: name=sshd state=restarted
- name: reload systemctl
command: systemctl daemon-reload
pre_tasks:
- name: Update System
when: update_system == true
include_tasks: tasks/update_system.yml
- name: Install base system packages
package:
name: '{{item}}'
state: latest
loop:
- curl
- htop
- unzip
- wget
- zip
- colordiff
- lsb-release
- git
- python3
- python3-pip
- glusterfs-client
- glusterfs-server
- cifs-utils
tags: ['base_packages', 'packages']
become: true
register: result
until: result is not failed
retries: '{{ apt_retries }}'
delay: '{{ apt_retry_delay }}'
- name: Start and enable GlusterFS server service
when: enable_glusterfs == true
service:
name: glusterd
state: started
enabled: yes
- name: Mount External Network volumes
when:
- mounts is defined
include_tasks: tasks/mount_network_volumes.yml
- name: Configure Store volumes
when:
- volumes is defined
include_tasks: tasks/configure_volumes.yml
tasks:
- name: Ensure user dot files
copy:
src: '{{item.src}}'
dest: '{{item.dest}}'
mode: '0600'
owner: '{{host_username}}'
group: '{{host_username}}'
loop:
- { src: dots/.wgetrc, dest: '/home/{{host_username}}/.wgetrc' }
- { src: dots/.gitignore, dest: '/home/{{host_username}}/.gitignore' }
- { src: dots/.curlrc, dest: '/home/{{host_username}}/.curlrc' }
- { src: dots/.bash_aliases, dest: '/home/{{host_username}}/.bash_aliases' }
tags: ['user_dots', 'dots']
- name: Ensure root dot files
copy:
src: '{{item.src}}'
dest: '{{item.dest}}'
mode: '0600'
owner: root
group: root
loop:
- { src: dots/.wgetrc, dest: '/root/.wgetrc' }
- { src: dots/.curlrc, dest: '/root/.curlrc' }
become: true
tags: ['dots']
- name: Ensure default directories in home
file:
path: '{{item}}'
state: directory
mode: '0700'
owner: '{{host_username}}'
group: '{{host_username}}'
loop:
- '/home/{{host_username}}/.ssh'
- name: Ensure user files (from templates)
template:
src: '{{item.src}}'
dest: '{{item.dest}}'
mode: '0600'
owner: '{{host_username}}'
group: '{{host_username}}'
loop:
- { src: dots/authorized_keys, dest: '/home/{{host_username}}/.ssh/authorized_keys' }