Stelle auf zentrale Instanzen-Verwaltung um
This commit is contained in:
parent
212d7d950c
commit
e63c995f11
5 changed files with 28 additions and 27 deletions
|
@ -13,5 +13,5 @@
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/apache2/conf-available/nextcloud_sites.conf
|
path: /etc/apache2/conf-available/nextcloud_sites.conf
|
||||||
insertafter: "^Ansbile"
|
insertafter: "^Ansbile"
|
||||||
line: "Use NCSite {{ nextcloud_domain }} {{ common_name }}"
|
line: "Use NCSite {{ domain }} {{ user }}"
|
||||||
notify: reload apache
|
notify: reload apache
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: "Datenbank einrichten"
|
- name: "Datenbank einrichten"
|
||||||
mysql_db:
|
mysql_db:
|
||||||
name: '{{ nextcloud_mysql_db }}'
|
name: "{{ database }}"
|
||||||
state: present
|
state: present
|
||||||
login_unix_socket: "{{ mysql_socket }}"
|
login_unix_socket: "{{ mysql_socket }}"
|
||||||
login_user: root
|
login_user: root
|
||||||
|
@ -10,10 +10,10 @@
|
||||||
|
|
||||||
- name: "Datenbank Benutzer einrichten"
|
- name: "Datenbank Benutzer einrichten"
|
||||||
mysql_user:
|
mysql_user:
|
||||||
name: "{{ nextcloud_mysql_user }}"
|
name: "{{ database }}"
|
||||||
host: "{{ nextcloud_host }}"
|
host: "{{ inventory_hostname }}"
|
||||||
password: "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}"
|
password: "{{ lookup('password', '/tmp/nc_db_password chars=ascii_letters') }}"
|
||||||
priv: "{{ nextcloud_mysql_db }}.*:ALL"
|
priv: "{{ database }}.*:ALL"
|
||||||
state: present
|
state: present
|
||||||
login_unix_socket: "{{ mysql_socket }}"
|
login_unix_socket: "{{ mysql_socket }}"
|
||||||
login_user: root
|
login_user: root
|
||||||
|
|
|
@ -3,27 +3,27 @@
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/dehydrated/domains.txt
|
path: /etc/dehydrated/domains.txt
|
||||||
insertafter: "^# nextcloud"
|
insertafter: "^# nextcloud"
|
||||||
line: "{{ nextcloud_domain }}"
|
line: "{{ domain }}"
|
||||||
# when: dehydrated_installiert
|
# when: dehydrated_installiert
|
||||||
delegate_to: "{{ nextcloud_gateway }}"
|
delegate_to: "{{ gateway_host }}"
|
||||||
|
|
||||||
- name: "Gateway Zertifikat erstellen"
|
- name: "Gateway Zertifikat erstellen"
|
||||||
command: dehydrated --cron -g
|
command: dehydrated --cron -g
|
||||||
delegate_to: "{{ nextcloud_gateway }}"
|
delegate_to: "{{ gateway_host }}"
|
||||||
|
|
||||||
- name: "Gateway Proxy einrichten"
|
- name: "Gateway Proxy einrichten"
|
||||||
template:
|
template:
|
||||||
src: nginx_site.j2
|
src: nginx_site.j2
|
||||||
dest: "/etc/nginx/sites-available/{{ nextcloud_domain }}"
|
dest: "/etc/nginx/sites-available/{{ domain }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
delegate_to: "{{ nextcloud_gateway }}"
|
delegate_to: "{{ gateway_host }}"
|
||||||
|
|
||||||
- name: "Gateway Seite aktivieren"
|
- name: "Gateway Seite aktivieren"
|
||||||
file:
|
file:
|
||||||
src: "/etc/nginx/sites-available/{{ nextcloud_domain }}"
|
src: "/etc/nginx/sites-available/{{ domain }}"
|
||||||
dest: "/etc/nginx/sites-enabled/{{ nextcloud_domain }}"
|
dest: "/etc/nginx/sites-enabled/{{ domain }}"
|
||||||
state: link
|
state: link
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
delegate_to: "{{ nextcloud_gateway }}"
|
delegate_to: "{{ gateway_host }}"
|
||||||
|
|
|
@ -13,40 +13,41 @@
|
||||||
extra_opts:
|
extra_opts:
|
||||||
- "--strip-components=1"
|
- "--strip-components=1"
|
||||||
dest: "{{ nextcloud_install_path }}"
|
dest: "{{ nextcloud_install_path }}"
|
||||||
owner: "{{ common_name }}"
|
owner: "{{ user }}"
|
||||||
group: "{{ common_name }}"
|
group: "{{ user }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: "NC Installation"
|
- name: "NC Installation"
|
||||||
command: >
|
command: >
|
||||||
php "{{ nextcloud_install_path }}"/occ maintenance:install --database "mysql"
|
php "{{ nextcloud_install_path }}"/occ maintenance:install --database "mysql"
|
||||||
--database-name "{{ nextcloud_mysql_db }}" --database-user "{{ nextcloud_mysql_user }}"
|
--database-name "{{ database }}" --database-user "{{ database }}"
|
||||||
--database-pass "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}" --database-host "{{ nextcloud_database_host }}"
|
--database-pass "{{ lookup('password', '/tmp/nc_db_password chars=ascii_letters') }}" --database-host "{{ database_host }}"
|
||||||
--admin-user "{{ nextcloud_admin_user }}" --admin-pass "{{ nextcloud_admin_pw }}"
|
--admin-user "{{ nextcloud_admin_user }}" --admin-pass "{{ nextcloud_admin_pw }}"
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ common_name }}"
|
become_user: "{{ user }}"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
||||||
|
#todo: Auch auf instances.alias anwenden
|
||||||
- name: "NC trusted domains einrichten"
|
- name: "NC trusted domains einrichten"
|
||||||
command: 'php {{ nextcloud_install_path }}/occ config:system:set trusted_domains {{ item.0 }} --value "{{ item.1 }}"'
|
command: 'php {{ nextcloud_install_path }}/occ config:system:set trusted_domains {{ item.0 }} --value "{{ item.1 }}"'
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ common_name }}"
|
become_user: "{{ name }}"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
with_indexed_items:
|
with_indexed_items:
|
||||||
- '{{ nextcloud_trusted_domains }}'
|
- '{{ nextcloud_trusted_domains }}'
|
||||||
|
|
||||||
- name: "NC cron einrichten"
|
- name: "NC cron einrichten"
|
||||||
cron:
|
cron:
|
||||||
name: "nextcloud {{ nextcloud_domain }}"
|
name: "nextcloud {{ domain }}"
|
||||||
minute: "*/5"
|
minute: "*/5"
|
||||||
user: "{{ common_name }}"
|
user: "{{ user }}"
|
||||||
job: "php -f {{ nextcloud_install_path}}/cron.php"
|
job: "php -f {{ nextcloud_install_path}}/cron.php"
|
||||||
cron_file: "nextcloud"
|
cron_file: "nextcloud"
|
||||||
|
|
||||||
- name: "NC allgemeie Konfiguration"
|
- name: "NC allgemeie Konfiguration"
|
||||||
command: "{{ item }}"
|
command: "{{ item }}"
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ common_name }}"
|
become_user: "{{ user }}"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
with_items:
|
with_items:
|
||||||
- "php {{ nextcloud_install_path }}/occ app:enable encryption"
|
- "php {{ nextcloud_install_path }}/occ app:enable encryption"
|
||||||
|
@ -54,7 +55,7 @@
|
||||||
- 'php {{ nextcloud_install_path }}/occ config:system:set memcache.local --value "\\OC\\Memcache\\APCu"'
|
- 'php {{ nextcloud_install_path }}/occ config:system:set memcache.local --value "\\OC\\Memcache\\APCu"'
|
||||||
- 'php {{ nextcloud_install_path }}/occ config:system:set memcache.distributed --value "\OC\Memcache\Redis"'
|
- 'php {{ nextcloud_install_path }}/occ config:system:set memcache.distributed --value "\OC\Memcache\Redis"'
|
||||||
- "php {{ nextcloud_install_path }}/occ background:cron"
|
- "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 overwrite.cli.url --value https://{{ domain }}'
|
||||||
- 'php {{ nextcloud_install_path }}/occ config:system:set htaccess.RewriteBase --value /'
|
- 'php {{ nextcloud_install_path }}/occ config:system:set htaccess.RewriteBase --value /'
|
||||||
- 'php {{ nextcloud_install_path }}/occ maintenance:update:htaccess'
|
- 'php {{ nextcloud_install_path }}/occ maintenance:update:htaccess'
|
||||||
- 'php {{ nextcloud_install_path }}/occ config:system:set default_language --value "de"'
|
- 'php {{ nextcloud_install_path }}/occ config:system:set default_language --value "de"'
|
||||||
|
@ -92,7 +93,7 @@
|
||||||
- name: "NC trusted proxies einrichten"
|
- name: "NC trusted proxies einrichten"
|
||||||
command: 'php {{ nextcloud_install_path }}/occ config:system:set trusted_proxies {{ item.0 }} --value "{{ item.1 }}"'
|
command: 'php {{ nextcloud_install_path }}/occ config:system:set trusted_proxies {{ item.0 }} --value "{{ item.1 }}"'
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ common_name }}"
|
become_user: "{{ user }}"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
with_indexed_items:
|
with_indexed_items:
|
||||||
- '{{ nextcloud_trusted_proxies }}'
|
- '{{ nextcloud_trusted_proxies }}'
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
- name: "PHP FPM-Nutzer anlegen"
|
- name: "PHP FPM-Nutzer anlegen"
|
||||||
user:
|
user:
|
||||||
name: "{{ common_name }}"
|
name: "{{ user }}"
|
||||||
create_home: no
|
create_home: no
|
||||||
password: "!"
|
password: "!"
|
||||||
groups: redis
|
groups: redis
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
- name: "PHP FPM-Pool einrichten"
|
- name: "PHP FPM-Pool einrichten"
|
||||||
template:
|
template:
|
||||||
src: php_fpm_pool.j2
|
src: php_fpm_pool.j2
|
||||||
dest: "/etc/php/{{ php_version }}/fpm/pool.d/{{ common_name }}.conf"
|
dest: "/etc/php/{{ php_version }}/fpm/pool.d/{{ user }}.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
Loading…
Reference in a new issue