Weitere Einrichtungsschritte
This commit is contained in:
parent
db196d0567
commit
78307df9e0
10 changed files with 107 additions and 29 deletions
18
tasks/apache.yml
Normal file
18
tasks/apache.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
- name: "Apache Module laden"
|
||||
apache2_module:
|
||||
state: present
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
- macro
|
||||
- proxy_fcgi
|
||||
- setenvif
|
||||
notify: restart apache
|
||||
|
||||
- name: "Apache Seite einrichten"
|
||||
lineinfile:
|
||||
path: /etc/apache2/conf-available/nextcloud_sites.conf
|
||||
insertafter: "^Ansbile"
|
||||
line: "Use NCSite {{ nextcloud_domain }} {{ common_name }}"
|
||||
state: present
|
||||
notify: reload apache
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: "Ensure nextcloud database exists"
|
||||
- name: "Datenbank einrichten"
|
||||
mysql_db:
|
||||
name: '{{ nextcloud_mysql_db }}'
|
||||
state: present
|
||||
|
@ -7,7 +7,7 @@
|
|||
delegate_to: "{{ nextcloud_database_host }}"
|
||||
|
||||
# Todo: Formatierung des Nutzernamens und Zuordnung des hosts schlaegt fehl
|
||||
- name: "Ensure database user exists and has all privileges"
|
||||
- name: "Datenbank Benutzer einrichten"
|
||||
mysql_user:
|
||||
name: "{{ nextcloud_mysql_user }}"
|
||||
password: "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
- name: "Add domain to cerificate list"
|
||||
- name: "Gateway Domain zur Zertifikatsliste hinzufügen"
|
||||
lineinfile:
|
||||
path: /etc/dehydrated/domains.txt
|
||||
insertafter: "^# nextcloud"
|
||||
|
@ -7,11 +7,11 @@
|
|||
# when: dehydrated_installiert
|
||||
delegate_to: "{{ nextcloud_gateway }}"
|
||||
|
||||
- name: "Obtain certificate"
|
||||
- name: "Gateway Zertifikat erstelle"
|
||||
command: dehydrated --cron -g
|
||||
delegate_to: "{{ nextcloud_gateway }}"
|
||||
|
||||
- name: "Copy webserver site configuration"
|
||||
- name: "Gateway Proxy einrichten"
|
||||
template:
|
||||
src: nginx_site.j2
|
||||
dest: "/etc/nginx/sites-available/{{ nextcloud_domain }}"
|
||||
|
@ -20,7 +20,7 @@
|
|||
mode: 0644
|
||||
delegate_to: "{{ nextcloud_gateway }}"
|
||||
|
||||
- name: "Enable site configuration"
|
||||
- name: "Gateway Seite aktivieren"
|
||||
file:
|
||||
src: "/etc/nginx/sites-available/{{ nextcloud_domain }}"
|
||||
dest: "/etc/nginx/sites-enabled/{{ nextcloud_domain }}"
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
---
|
||||
- import_tasks: packages.yml
|
||||
- import_tasks: gateway.yml
|
||||
- import_tasks: database.yml
|
||||
tags: database
|
||||
- import_tasks: php.yml
|
||||
- import_tasks: apache.yml
|
||||
- import_tasks: nextcloud.yml
|
||||
tags: nextcloud
|
||||
- import_tasks: php.yml
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
---
|
||||
|
||||
- name: "Ensure install dir is present"
|
||||
- name: "NC Verzeichnis prüfen"
|
||||
file:
|
||||
path: "{{ nextcloud_install_path }}"
|
||||
mode: 0755
|
||||
state: directory
|
||||
|
||||
- name: "Download und unarchive Nextcloud"
|
||||
- name: "NC herunterladen und entpacken"
|
||||
unarchive:
|
||||
src: "{{ nextcloud_dl_url }}/{{ nextcloud_version }}.tar.bz2"
|
||||
remote_src: true
|
||||
|
@ -17,7 +17,7 @@
|
|||
group: "{{ common_name }}"
|
||||
mode: 0755
|
||||
|
||||
- name: "Install Nextcloud"
|
||||
- name: "NC Installation"
|
||||
command: >
|
||||
php "{{ nextcloud_install_path }}"/occ maintenance:install --database "mysql"
|
||||
--database-name "{{ nextcloud_mysql_db }}" --database-user "{{ nextcloud_mysql_user }}"
|
||||
|
@ -27,7 +27,7 @@
|
|||
become_user: "{{ common_name }}"
|
||||
changed_when: true
|
||||
|
||||
- name: "Ensure trusted domains are set"
|
||||
- name: "NC trusted domains einrichte"
|
||||
command: 'php {{ nextcloud_install_path }}/occ config:system:set trusted_domains {{ item.0 }} --value "{{ item.1 }}"'
|
||||
become: true
|
||||
become_user: "{{ common_name }}"
|
||||
|
@ -35,16 +35,45 @@
|
|||
with_indexed_items:
|
||||
- '{{ nextcloud_trusted_domains }}'
|
||||
|
||||
- name: "Ensure Apache marco module is loaded"
|
||||
apache2_module:
|
||||
state: present
|
||||
name: macro
|
||||
notify: restart apache
|
||||
- name: "NC cron einrichten"
|
||||
cron:
|
||||
name: "nextcloud {{ nextcloud_domain }}"
|
||||
minute: "*/5"
|
||||
user: "{{ common_name }}"
|
||||
job: "php -f {{ nextcloud_install_path}}/cron.php"
|
||||
cron_file: "nextcloud"
|
||||
|
||||
- name: "Setup Apache site config"
|
||||
lineinfile:
|
||||
path: /etc/apache2/conf-available/nextcloud_sites.conf
|
||||
insertafter: "^Ansbile"
|
||||
line: "Use NCSite {{ nextcloud_domain }} {{ common_name }}"
|
||||
state: present
|
||||
notify: reload apache
|
||||
- name: "NC allgemeie Konfiguration"
|
||||
command: "{{ item }}"
|
||||
become: true
|
||||
become_user: "{{ common_name }}"
|
||||
changed_when: true
|
||||
with_items:
|
||||
- "php {{ nextcloud_install_path }}/occ app:enable encryption"
|
||||
- "php {{ nextcloud_install_path }}/occ encryption:enable"
|
||||
- 'php {{ nextcloud_install_path }}/occ config:system:set memcache.local --value "\\OC\\Memcache\\APCu"'
|
||||
- "php {{ nextcloud_install_path }}/occ background:cron"
|
||||
- 'php {{ nextcloud_install_path }}/occ config:system:set overwrite.cli.url --value https://{{ nextcloud_domain }}'
|
||||
- 'php {{ nextcloud_install_path }}/occ config:system:set htaccess.RewriteBase --value /'
|
||||
|
||||
- name: "NC Mailversand einrichten"
|
||||
blockinfile:
|
||||
path: "{{ nextcloud_config_file }}"
|
||||
insertbefore: '^\);'
|
||||
marker_begin: mailserver
|
||||
block: |2
|
||||
'mail_from_address' => '{{ nextcloud_mail_from }}',
|
||||
'mail_smtpmode' => 'smtp',
|
||||
'mail_sendmailmode' => 'smtp',
|
||||
'mail_domain' => '{{ nextcloud_mail_domain }}',
|
||||
'mail_smtpauthtype' => '{{ nextcloud_smtp_auth_type }}',
|
||||
'mail_smtphost' => '{{ nextcloud_smtp_host }}',
|
||||
'mail_smtpport' => '{{ nextcloud_smtp_port}}',
|
||||
|
||||
- name: "NC trusted proxies eirichten"
|
||||
command: 'php {{ nextcloud_install_path }}/occ config:system:set trusted_proxies {{ item.0 }} --value "{{ item.1 }}"'
|
||||
become: true
|
||||
become_user: "{{ common_name }}"
|
||||
changed_when: true
|
||||
with_indexed_items:
|
||||
- '{{ nextcloud_trusted_proxies }}'
|
||||
|
|
20
tasks/packages.yml
Normal file
20
tasks/packages.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- name: "Pakete Fakten sammeln"
|
||||
package_facts:
|
||||
manager: apt
|
||||
|
||||
- name: "Pakete Datenbank installieren"
|
||||
apt:
|
||||
pkg:
|
||||
- python-pymysql
|
||||
update_cache: yes
|
||||
cache_valid_time: 3600
|
||||
# nur für db_gast ausführen
|
||||
|
||||
- name: "Pakete installieren"
|
||||
apt:
|
||||
pkg:
|
||||
- php-redis
|
||||
- redis
|
||||
update_cache: yes
|
||||
cache_valid_time: 3600
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
|
||||
- name: "Create PHP-FPM-User"
|
||||
- name: "PHP FPM-Nutzer anlegen"
|
||||
user:
|
||||
name: "{{ common_name }}"
|
||||
create_home: no
|
||||
|
@ -8,7 +8,7 @@
|
|||
shell: /bin/false
|
||||
state: present
|
||||
|
||||
- name: "Copy PHP-FPM configuration"
|
||||
- name: "PHP FPM-Pool einrichten"
|
||||
template:
|
||||
src: php_fpm_pool.j2
|
||||
dest: "/etc/php/{{ php_version }}/fpm/pool.d/{{ common_name }}.conf"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue