-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathturnkey-installer.yml
106 lines (87 loc) · 3.05 KB
/
turnkey-installer.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
---
- name: Fresh install for Turnkey VM Docker
hosts: Linux
become: true
tasks:
- name: Get docker script
uri:
url: 'https://get.docker.com'
method: GET
dest: get-docker.sh
follow_redirects: safe
#- name: Run get-docker.sh
# shell: get-docker.sh
- name: Install Apache and Samba
apt:
name: apache2,samba
state: present
update_cache: yes
- name: Configure Samba smb.conf
blockinfile:
path: /etc/samba/smb.conf
block: |
[homepage]
comment=
path = /path/to/config
force user = smbuser
force group = smbgroup
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
public = yes
read only = no
[www]
comment=
path = /var/www/html
force user = smbuser
force group = smbgroup
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
public = yes
read only = no
- name: Set ownership of directories
command: chown -R $USER:$USER /var/www/html/ && chown -R $USER:$USER /path/to/config
- name: Set permissions on directories
command: chmod -R g+w /var/www/html && chmod -R g+w /path/to/config
- name: Configure Apache VirtualHost
blockinfile:
path: /etc/apache2/sites-available/html.conf
block: |
<VirtualHost *:80>
ServerName html
ServerAlias www.dashboard
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
- name: Enable Apache VirtualHost
command: a2ensite dashboard
- name: Disable default Apache site
command: a2dissite 000-default
- name: Test Apache configuration
command: apache2ctl configtest
- name: Reload Apache service
command: systemctl reload apache2
- name: Download MySQL APT configuration package
command: wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
args:
chdir: /tmp
#- name: Install MySQL APT configuration package
# command: dpkg -i mysql-apt-config*
- name: Update package cache
apt:
update_cache: yes
- name: Install MySQL, PHP, and phpMyAdmin
apt:
name: mysql-server,php,libapache2-mod-php,php-mysql,phpmyadmin,php-mbstring,php-zip,php-gd,php-json,php-curl,php-intl
state: present
- name: Reload Apache service
command: systemctl reload apache2
- name: Run MySQL secure installation
command: mysql_secure_installation
- name: Check MySQL version
command: mysqladmin -u root -p version