restructured ansible-office repo
This commit is contained in:
@@ -1 +1,3 @@
|
|||||||
# Buero Infrastruktur
|
# Buero Templates for used software deployments
|
||||||
|
|
||||||
|
In this repository I collect all ansible playbooks used during my work.
|
||||||
|
|||||||
12
TODO.md
12
TODO.md
@@ -1,16 +1,5 @@
|
|||||||
## todo
|
## todo
|
||||||
|
|
||||||
### First Version 0.1
|
|
||||||
|
|
||||||
- [x] install smbclient php module
|
|
||||||
- [x] install ownCloud via task (trusted domains can
|
|
||||||
be added afterwards)
|
|
||||||
- [x] configure cron jobs
|
|
||||||
- [x] configure caching and file locking
|
|
||||||
- [x] add redis to stack and configure it
|
|
||||||
- [x] configure log rotation
|
|
||||||
- [ ] configure https access in apache2
|
|
||||||
|
|
||||||
### Modifications
|
### Modifications
|
||||||
|
|
||||||
- [ ] Build ansible-role-lamp
|
- [ ] Build ansible-role-lamp
|
||||||
@@ -21,3 +10,4 @@
|
|||||||
|
|
||||||
- [ ] Build with option to choose between apache and nginx
|
- [ ] Build with option to choose between apache and nginx
|
||||||
- [ ] Build with option to choose different databases
|
- [ ] Build with option to choose different databases
|
||||||
|
- [ ] Build with option to choose different php versions
|
||||||
|
|||||||
16
roles/lamp/tasks/main.yml
Normal file
16
roles/lamp/tasks/main.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
- name: Install LAMP stack dependencies
|
||||||
|
include_tasks:
|
||||||
|
file: dependencies.yml
|
||||||
|
|
||||||
|
- name: Configure Apache.
|
||||||
|
include_tasks:
|
||||||
|
file: apache.yml
|
||||||
|
|
||||||
|
- name: Configure PHP.
|
||||||
|
include_tasks:
|
||||||
|
file: php.yml
|
||||||
|
|
||||||
|
- name: Configure MySQL.
|
||||||
|
include_tasks:
|
||||||
|
file: mysql.yml
|
||||||
@@ -1 +0,0 @@
|
|||||||
owncloud_core_path: "/var/www/owncloud"
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- name: restart apache
|
|
||||||
service:
|
|
||||||
name: apache2
|
|
||||||
state: restarted
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#- name: Configure Caching and File locking
|
|
||||||
# command: "{{ item }}"
|
|
||||||
# loop: >
|
|
||||||
# - occ config:system:set memcache.local --value '\OC\Memcache\APCu'
|
|
||||||
# - occ config:system:set memcache.locking --value '\OC\Memcache\Redis'
|
|
||||||
# - occ config:system:set redis --value '{"host": "127.0.0.1", "port": "6379"}' --type json
|
|
||||||
|
|
||||||
- name: Configure Log Rotation.
|
|
||||||
template:
|
|
||||||
src: "templates/log-rotation.j2"
|
|
||||||
dest: "/etc/logrotate.d/owncloud"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Install LAMP stack dependencies
|
|
||||||
include_tasks:
|
|
||||||
file: dependencies.yml
|
|
||||||
|
|
||||||
- name: Configure Apache.
|
|
||||||
include_tasks:
|
|
||||||
file: apache.yml
|
|
||||||
|
|
||||||
- name: Configure PHP.
|
|
||||||
include_tasks:
|
|
||||||
file: php.yml
|
|
||||||
|
|
||||||
- name: Configure MySQL.
|
|
||||||
include_tasks:
|
|
||||||
file: mysql.yml
|
|
||||||
|
|
||||||
- name: Create occ helper script.
|
|
||||||
include_tasks:
|
|
||||||
file: occ.yml
|
|
||||||
|
|
||||||
- name: Download ownCloud.
|
|
||||||
include_tasks:
|
|
||||||
file: owncloud.yml
|
|
||||||
|
|
||||||
#- name: Configure Cronjobs.
|
|
||||||
# include_tasks:
|
|
||||||
# file: cron.yml
|
|
||||||
|
|
||||||
- name: Configure ownCloud.
|
|
||||||
include_tasks:
|
|
||||||
file: configure.yml
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
- name: Create a helper script for running occ commands.
|
|
||||||
template:
|
|
||||||
src: "templates/occ.j2"
|
|
||||||
dest: "/usr/local/bin/occ"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0755
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Download ownCloud source.
|
|
||||||
ansible.builtin.get_url:
|
|
||||||
url: https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2
|
|
||||||
dest: "/tmp/owncloud-complete-latest.tar.bz2"
|
|
||||||
owner: www-data
|
|
||||||
|
|
||||||
- name: Extract the archive.
|
|
||||||
ansible.builtin.unarchive:
|
|
||||||
src: "/tmp/owncloud-complete-latest.tar.bz2"
|
|
||||||
dest: "/var/www/"
|
|
||||||
owner: www-data
|
|
||||||
remote_src: yes
|
|
||||||
#- name: Install ownCloud (via occ)
|
|
||||||
# command: >
|
|
||||||
# occ maintenance:install --database "mysql" --database-name "owncloud" --database-user "owncloud" --database-pass "{{ mysql_passwd }}" --data-dir "{{ owncloud_core_path }}/data" --admin-user "root" --admin-pass "{{ mysql_passwd }}"
|
|
||||||
#
|
|
||||||
#- name: Configure ownCloud's trusted domains
|
|
||||||
# command: "{{ item }}"
|
|
||||||
# loop:
|
|
||||||
# - my_ip=$(hostname -I|cut -f1 -d ' ')
|
|
||||||
# - occ config:system:set trusted_domains 1 --value="$my_ip"
|
|
||||||
# - occ config:system:set trusted_domains 2 --value="{{ hostname }}"
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/var/www/owncloud/data/owncloud.log {
|
|
||||||
size 10M
|
|
||||||
rotate 12
|
|
||||||
copytruncate
|
|
||||||
missingok
|
|
||||||
compress
|
|
||||||
compresscmd /bin/gzip
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
cd /var/www/owncloud
|
|
||||||
sudo -E -u www-data /usr/bin/php /var/www/owncloud/occ "$@"
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<VirtualHost *:80>
|
|
||||||
ServerName {{ hostname }}
|
|
||||||
DirectoryIndex index.php index.html
|
|
||||||
DocumentRoot /var/www/owncloud
|
|
||||||
<Directory /var/www/owncloud>
|
|
||||||
Options +FollowSymlinks -Indexes
|
|
||||||
AllowOverride All
|
|
||||||
Require all granted
|
|
||||||
|
|
||||||
<IfModule mod_dav.c>
|
|
||||||
Dav off
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
SetEnv HOME /var/www/owncloud
|
|
||||||
SetEnv HTTP_HOME /var/www/owncloud
|
|
||||||
</Directory>
|
|
||||||
</VirtualHost>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
extension=smbclient.so
|
|
||||||
Reference in New Issue
Block a user