Initial commit
This commit is contained in:
commit
a6d1261679
4 changed files with 133 additions and 0 deletions
48
tasks/main.yml
Normal file
48
tasks/main.yml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
- name: install nextcloud
|
||||
register: nextcloudinstall
|
||||
unarchive:
|
||||
src: "https://download.nextcloud.com/server/releases/nextcloud-14.0.0.tar.bz2"
|
||||
remote_src: yes
|
||||
dest: /var/www/
|
||||
owner: www-data
|
||||
group: www-data
|
||||
creates: /var/www/nextcloud
|
||||
|
||||
- name: setup nextcloud
|
||||
become_user: www-data
|
||||
become: true
|
||||
when: nextcloudinstall is changed
|
||||
command: "/usr/bin/php occ maintenance:install -n --database 'mysql' --database-name '{{ nextcloud.db.name }}' --database-user '{{ nextcloud.db.user }}' --database-pass '{{ nextcloud.db.pw }}' --admin-user '{{ nextcloud.admin.name }}' --admin-pass '{{ nextcloud.admin.pw }}'"
|
||||
args:
|
||||
chdir: /var/www/nextcloud
|
||||
|
||||
- name: set nextcloud trusted domains
|
||||
become_user: www-data
|
||||
become: true
|
||||
command: '/usr/bin/php occ config:system:set trusted_domains 1 --value "{{ nextcloud.externalurl }}"'
|
||||
args:
|
||||
chdir: /var/www/nextcloud
|
||||
|
||||
- name: copy nextcloud nginx config
|
||||
template:
|
||||
src: nginx.j2
|
||||
dest: /etc/nginx/sites-available/nextcloud
|
||||
notify:
|
||||
- restart nginx
|
||||
|
||||
- name: enable nextcloud for nginx
|
||||
file:
|
||||
src: /etc/nginx/sites-available/nextcloud
|
||||
dest: /etc/nginx/sites-enabled/nextcloud
|
||||
state: link
|
||||
notify:
|
||||
- restart nginx
|
||||
|
||||
- name: add cronjob for nextcloud
|
||||
cron:
|
||||
job: /usr/bin/php -f /var/www/nextcloud/cron.php
|
||||
user: www-data
|
||||
minute: "*/10"
|
||||
name: nextcloud-cron
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue