restructured ansible-office repo

This commit is contained in:
2024-12-04 10:47:12 +01:00
parent 35892aec74
commit 0bb7ecbbc0
17 changed files with 20 additions and 123 deletions

View File

@@ -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
View File

@@ -1,16 +1,5 @@
## 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
- [ ] Build ansible-role-lamp
@@ -21,3 +10,4 @@
- [ ] Build with option to choose between apache and nginx
- [ ] Build with option to choose different databases
- [ ] Build with option to choose different php versions

16
roles/lamp/tasks/main.yml Normal file
View 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

View File

@@ -1 +0,0 @@
owncloud_core_path: "/var/www/owncloud"

View File

@@ -1,5 +0,0 @@
---
- name: restart apache
service:
name: apache2
state: restarted

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 }}"

View File

@@ -1,8 +0,0 @@
/var/www/owncloud/data/owncloud.log {
size 10M
rotate 12
copytruncate
missingok
compress
compresscmd /bin/gzip
}

View File

@@ -1,4 +0,0 @@
#!/bin/bash
cd /var/www/owncloud
sudo -E -u www-data /usr/bin/php /var/www/owncloud/occ "$@"

View File

@@ -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>

View File

@@ -1 +0,0 @@
extension=smbclient.so