mirror of
https://github.com/iiab/iiab.git
synced 2025-02-14 20:22:08 +00:00
change default admin user/pw
allow access from all ips and domains
This commit is contained in:
parent
144bb15603
commit
5f663a4b93
3 changed files with 27 additions and 21 deletions
|
@ -15,7 +15,7 @@ nextcloud_dbpassword: nextcloudmysql
|
|||
nextcloud_user: nextcloud
|
||||
nextcloud_user_password: nextcloudmysql
|
||||
|
||||
nextcloud_admin_user: root
|
||||
nextcloud_admin_password: "{{ mysql_root_password }}"
|
||||
nextcloud_admin_user: 'Admin'
|
||||
nextcloud_admin_password: 'changeme'
|
||||
|
||||
nextcloud_required_ip: 10.0.0.0/8 192.168.0.0/16
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
|
||||
- name: ubuntu and debian treat names differently
|
||||
package: name={{ item }} state=present
|
||||
with_items:
|
||||
with_items:
|
||||
- libapache2-mod-php5
|
||||
when: is_debian
|
||||
|
||||
- name: ubuntu and debian treat names differently
|
||||
package: name={{ item }} state=present
|
||||
with_items:
|
||||
with_items:
|
||||
- libapache2-mod-php
|
||||
- php-imagick
|
||||
- php-zip
|
||||
|
@ -33,7 +33,7 @@
|
|||
|
||||
- name: Install list of packages for debuntu
|
||||
package: name={{ item }} state=present
|
||||
with_items:
|
||||
with_items:
|
||||
- php{{ php_version }}-gd
|
||||
- php{{ php_version }}-json
|
||||
- php{{ php_version }}-mysql
|
||||
|
@ -41,10 +41,10 @@
|
|||
- php{{ php_version }}-intl
|
||||
- php{{ php_version }}-mcrypt
|
||||
when: is_debuntu
|
||||
|
||||
- name: Install list of packages
|
||||
|
||||
- name: Install list of packages
|
||||
package: name={{ item }} state=present
|
||||
with_items:
|
||||
with_items:
|
||||
- php
|
||||
- php-gd
|
||||
- php-json
|
||||
|
@ -55,16 +55,16 @@
|
|||
# centos does not have a package for php-imagick
|
||||
# - php-imagick
|
||||
when: is_redhat
|
||||
|
||||
|
||||
- name: Copy it to permanent location /opt
|
||||
unarchive: src={{ downloads_dir }}/{{ nextcloud_src_file }}
|
||||
unarchive: src={{ downloads_dir }}/{{ nextcloud_src_file }}
|
||||
dest={{ nextcloud_prefix }}
|
||||
creates={{ nextcloud_prefix }}/nextcloud/version.php
|
||||
when: not is_F18
|
||||
|
||||
# ansible 1.4.1 does not have "creates"
|
||||
- name: Copy it to permanent location /opt
|
||||
unarchive: src={{ downloads_dir }}/{{ nextcloud_src_file }}
|
||||
unarchive: src={{ downloads_dir }}/{{ nextcloud_src_file }}
|
||||
dest={{ nextcloud_prefix }}
|
||||
when: is_F18
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# This should go in computed_network.yml, but here for now
|
||||
# This should go in computed_network.yml, but here for now
|
||||
- name: Compute nextcloud listen ip addr for nextcloud.conf
|
||||
set_fact:
|
||||
nextcloud_required_ip: "{{ ansible_default_ipv4.network }}/{{ ansible_default_ipv4.netmask }}"
|
||||
|
@ -29,34 +29,40 @@
|
|||
# the install wizard does not succeed if already installed
|
||||
- name: Determine if nextcloud is installed
|
||||
shell: >
|
||||
sudo -u {{ apache_user }} php
|
||||
'{{ nextcloud_prefix }}/nextcloud/occ' status |
|
||||
sudo -u {{ apache_user }} php
|
||||
'{{ nextcloud_prefix }}/nextcloud/occ' status |
|
||||
grep installed: | cut -d' ' -f5
|
||||
register: returned
|
||||
|
||||
- name: Run nextcloud initial install wizard
|
||||
shell: >
|
||||
cd {{ nextcloud_prefix }}/nextcloud;
|
||||
sudo -u {{ apache_user }} php occ maintenance:install
|
||||
sudo -u {{ apache_user }} php occ maintenance:install
|
||||
--database "mysql"
|
||||
--database-name "{{ nextcloud_dbname }}"
|
||||
--database-user "{{ nextcloud_dbuser }}"
|
||||
--database-user "{{ nextcloud_dbuser }}"
|
||||
--database-pass "{{ nextcloud_dbpassword }}"
|
||||
--admin-user "root"
|
||||
--admin-pass "{{ mysql_root_password }}"
|
||||
--admin-user "{{ nextcloud_admin_user }}"
|
||||
--admin-pass "{{ nextcloud_admin_password }}"
|
||||
when: nextcloud_enabled and returned.stdout == "false"
|
||||
|
||||
- name: allow access from all hosts and ips
|
||||
command: php '{{ nextcloud_prefix }}/nextcloud/occ' config:system:set trusted_domains 1 --value=*
|
||||
become: true
|
||||
become_user: "{{ apache_user }}"
|
||||
when: nextcloud_enabled and returned.stdout == "false"
|
||||
|
||||
- name: Determine if nextcloud user exists already
|
||||
shell: >
|
||||
sudo -u {{ apache_user }} php
|
||||
'{{ nextcloud_prefix }}/nextcloud/occ' user:list |
|
||||
sudo -u {{ apache_user }} php
|
||||
'{{ nextcloud_prefix }}/nextcloud/occ' user:list |
|
||||
grep {{ nextcloud_user }} | wc | cut -d' ' -f1
|
||||
register: returned_count
|
||||
|
||||
# nextcloud wants to make users rather than just mysql users and not done
|
||||
- name: create the default user
|
||||
shell: >
|
||||
su -s /bin/sh {{ apache_user }} -c
|
||||
su -s /bin/sh {{ apache_user }} -c
|
||||
'OC_PASS={{ nextcloud_user_password }};
|
||||
php {{ nextcloud_prefix }}/nextcloud/occ user:add
|
||||
--password-from-env --display-name={{ nextcloud_user }}
|
||||
|
|
Loading…
Reference in a new issue