mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Update nextcloud_enabled.yml
This commit is contained in:
parent
17847d05d0
commit
114a3f7b84
1 changed files with 16 additions and 11 deletions
|
@ -40,8 +40,7 @@
|
||||||
# the install wizard does not succeed if already installed
|
# the install wizard does not succeed if already installed
|
||||||
- name: Determine if Nextcloud is installed
|
- name: Determine if Nextcloud is installed
|
||||||
shell: >
|
shell: >
|
||||||
#sudo -u {{ apache_user }}
|
php {{ nextcloud_prefix }}/nextcloud/occ status |
|
||||||
php '{{ nextcloud_prefix }}/nextcloud/occ' status |
|
|
||||||
gawk '/installed:/ { print $3 }'
|
gawk '/installed:/ { print $3 }'
|
||||||
become: yes
|
become: yes
|
||||||
become_user: "{{ apache_user }}"
|
become_user: "{{ apache_user }}"
|
||||||
|
@ -50,42 +49,48 @@
|
||||||
- name: Run Nextcloud initial install wizard
|
- name: Run Nextcloud initial install wizard
|
||||||
shell: >
|
shell: >
|
||||||
cd {{ nextcloud_prefix }}/nextcloud;
|
cd {{ nextcloud_prefix }}/nextcloud;
|
||||||
sudo -u {{ apache_user }} php occ maintenance:install
|
php occ maintenance:install
|
||||||
--database "mysql"
|
--database "mysql"
|
||||||
--database-name "{{ nextcloud_dbname }}"
|
--database-name "{{ nextcloud_dbname }}"
|
||||||
--database-user "{{ nextcloud_dbuser }}"
|
--database-user "{{ nextcloud_dbuser }}"
|
||||||
--database-pass "{{ nextcloud_dbpassword }}"
|
--database-pass "{{ nextcloud_dbpassword }}"
|
||||||
--admin-user "{{ nextcloud_admin_user }}"
|
--admin-user "{{ nextcloud_admin_user }}"
|
||||||
--admin-pass "{{ nextcloud_admin_password }}"
|
--admin-pass "{{ nextcloud_admin_password }}"
|
||||||
|
become: yes
|
||||||
|
become_user: "{{ apache_user }}"
|
||||||
when: nextcloud_enabled and returned.stdout == "false"
|
when: nextcloud_enabled and returned.stdout == "false"
|
||||||
|
|
||||||
- name: Allow access from all hosts and ips
|
- name: Allow access from all hosts and ips
|
||||||
command: php '{{ nextcloud_prefix }}/nextcloud/occ' config:system:set trusted_domains 1 --value=*
|
command: php {{ nextcloud_prefix }}/nextcloud/occ config:system:set trusted_domains 1 --value=*
|
||||||
become: yes
|
become: yes
|
||||||
become_user: "{{ apache_user }}"
|
become_user: "{{ apache_user }}"
|
||||||
when: nextcloud_enabled and returned.stdout == "false"
|
when: nextcloud_enabled and returned.stdout == "false"
|
||||||
|
|
||||||
# Code below was NEVER RUNNING as of 2018-10-29, as "wc | cut -d' ' -f1" ALWAYS
|
# Code below was NEVER RUNNING as of 2018-10-29, as "wc | cut -d' ' -f1" ALWAYS
|
||||||
# returns null (rather than the intended returned_count !) This fragment could
|
# returns null (rather than the intended returned_count !) This line could
|
||||||
# be replace with "wc -l" or "wc | awk '{print $1}'" if it truly needs fixing?
|
# be replaced by ALTERNATIVE 1 or ALTERNATIVE 2 below IF it truly needs fixing.
|
||||||
#
|
#
|
||||||
# Or perhaps default user/password nextcloud/nextcloudmysql (from variables
|
# Or perhaps default user/password nextcloud/nextcloudmysql (from variables
|
||||||
# nextcloud_user/nextcloud_user_password) is just not needed in the end...
|
# nextcloud_user/nextcloud_user_password) is just not needed in the end...
|
||||||
|
#
|
||||||
|
# NOTE: COMMENTS (FOLLOWING '#' SIGN) WITHIN A SHELL COMMAND CAUSE IT TO *FAIL*
|
||||||
#
|
#
|
||||||
#- name: Determine if Nextcloud user exists already
|
#- name: Determine if Nextcloud user exists already
|
||||||
# shell: >
|
# shell: >
|
||||||
# #sudo -u {{ apache_user }}
|
# php {{ nextcloud_prefix }}/nextcloud/occ user:list |
|
||||||
# php '{{ nextcloud_prefix }}/nextcloud/occ' user:list |
|
# grep {{ nextcloud_user }} | wc | cut -d' ' -f1 # USELESS
|
||||||
# grep {{ nextcloud_user }} | wc | cut -d' ' -f1
|
# #grep {{ nextcloud_user }} | wc -l # ALTERNATIVE 1
|
||||||
# #grep {{ nextcloud_user }} | wc -l
|
# #grep {{ nextcloud_user }} | wc | awk '{print $1}' # ALTERNATIVE 2
|
||||||
# become: yes
|
# become: yes
|
||||||
# become_user: "{{ apache_user }}"
|
# become_user: "{{ apache_user }}"
|
||||||
# register: returned_count
|
# register: returned_count
|
||||||
#
|
#
|
||||||
|
# debug:
|
||||||
|
# var: returned_count
|
||||||
|
#
|
||||||
## nextcloud wants to make users rather than just mysql users and not done
|
## nextcloud wants to make users rather than just mysql users and not done
|
||||||
#- name: Create the default user
|
#- name: Create the default user
|
||||||
# shell: >
|
# shell: >
|
||||||
# #su -s /bin/sh {{ apache_user }} -c
|
|
||||||
# OC_PASS={{ nextcloud_user_password }};
|
# OC_PASS={{ nextcloud_user_password }};
|
||||||
# php {{ nextcloud_prefix }}/nextcloud/occ user:add
|
# php {{ nextcloud_prefix }}/nextcloud/occ user:add
|
||||||
# --password-from-env --display-name={{ nextcloud_user }}
|
# --password-from-env --display-name={{ nextcloud_user }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue