fix nextcloud issue
This commit is contained in:
parent
58d3986201
commit
0a1b675310
@ -40,6 +40,16 @@
|
|||||||
state: directory # not required. choices: absent;directory;file;hard;link;touch. If C(directory), all intermediate subdirectories will be created if they do not exist. Since Ansible 1.7 they will be created with the supplied permissions. If C(file), the file will NOT be created if it does not exist; see the C(touch) value or the M(copy) or M(template) module if you want that behavior. If C(link), the symbolic link will be created or changed. Use C(hard) for hardlinks. If C(absent), directories will be recursively deleted, and files or symlinks will be unlinked. Note that C(absent) will not cause C(file) to fail if the C(path) does not exist as the state did not change. If C(touch) (new in 1.4), an empty file will be created if the C(path) does not exist, while an existing file or directory will receive updated file access and modification times (similar to the way `touch` works from the command line).
|
state: directory # not required. choices: absent;directory;file;hard;link;touch. If C(directory), all intermediate subdirectories will be created if they do not exist. Since Ansible 1.7 they will be created with the supplied permissions. If C(file), the file will NOT be created if it does not exist; see the C(touch) value or the M(copy) or M(template) module if you want that behavior. If C(link), the symbolic link will be created or changed. Use C(hard) for hardlinks. If C(absent), directories will be recursively deleted, and files or symlinks will be unlinked. Note that C(absent) will not cause C(file) to fail if the C(path) does not exist as the state did not change. If C(touch) (new in 1.4), an empty file will be created if the C(path) does not exist, while an existing file or directory will receive updated file access and modification times (similar to the way `touch` works from the command line).
|
||||||
owner: http # not required. Name of the user that should own the file/directory, as would be fed to I(chown).
|
owner: http # not required. Name of the user that should own the file/directory, as would be fed to I(chown).
|
||||||
|
|
||||||
|
- name: création du fichier .ocdata in data
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: "{{ nextcloud_datadirectory }}/.ocdata"
|
||||||
|
group: http # not required. Name of the group that should own the file/directory, as would be fed to I(chown).
|
||||||
|
state: touch # not required. choices: absent;directory;file;hard;link;touch. If C(directory), all intermediate subdirectories will be created if they do not exist. Since Ansible 1.7 they will be created with the supplied permissions. If C(file), the file will NOT be created if it does not exist; see the C(touch) value or the M(copy) or M(template) module if you want that behavior. If C(link), the symbolic link will be created or changed. Use C(hard) for hardlinks. If C(absent), directories will be recursively deleted, and files or symlinks will be unlinked. Note that C(absent) will not cause C(file) to fail if the C(path) does not exist as the state did not change. If C(touch) (new in 1.4), an empty file will be created if the C(path) does not exist, while an existing file or directory will receive updated file access and modification times (similar to the way `touch` works from the command line).
|
||||||
|
owner: http # not required. Name of the user that should own the file/directory, as would be fed to I(chown).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: check if config exist
|
- name: check if config exist
|
||||||
stat:
|
stat:
|
||||||
path: /etc/webapps/nextcloud/config/config.php # required. The full path of the file/object to get the facts of.
|
path: /etc/webapps/nextcloud/config/config.php # required. The full path of the file/object to get the facts of.
|
||||||
@ -62,8 +72,18 @@
|
|||||||
become: true
|
become: true
|
||||||
become_user: http
|
become_user: http
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
ignore_errors: yes
|
||||||
when: installed_mode is changed or nextcloud_config_exist.stat.exists == false
|
when: installed_mode is changed or nextcloud_config_exist.stat.exists == false
|
||||||
|
|
||||||
|
- name: ensure additional options are set in config.php if defined
|
||||||
|
become: true
|
||||||
|
lineinfile:
|
||||||
|
path: '{{ nextcloud_web_root }}/config/config.php'
|
||||||
|
regexp: '^\s*''{{ item.option }}'''
|
||||||
|
line: ' ''{{ item.option }}'' => {{ item.value }},'
|
||||||
|
insertafter: '\$CONFIG'
|
||||||
|
with_items: '{{ nextcloud_config_options }}'
|
||||||
|
when: nextcloud_config_options is defined
|
||||||
|
|
||||||
- name: installation - ensure trusted domains are set
|
- name: installation - ensure trusted domains are set
|
||||||
command: 'php {{ nextcloud_web_root }}/occ config:system:set trusted_domains {{ item.0 }} --value "{{ item.1 }}"'
|
command: 'php {{ nextcloud_web_root }}/occ config:system:set trusted_domains {{ item.0 }} --value "{{ item.1 }}"'
|
||||||
@ -83,15 +103,8 @@
|
|||||||
with_items: '{{ nextcloud_db_options }}'
|
with_items: '{{ nextcloud_db_options }}'
|
||||||
when: nextcloud_config_options is defined
|
when: nextcloud_config_options is defined
|
||||||
|
|
||||||
- name: ensure additional options are set in config.php if defined
|
|
||||||
become: true
|
|
||||||
lineinfile:
|
|
||||||
path: '{{ nextcloud_web_root }}/config/config.php'
|
|
||||||
regexp: '^\s*''{{ item.option }}'''
|
|
||||||
line: ' ''{{ item.option }}'' => {{ item.value }},'
|
|
||||||
insertafter: '\$CONFIG'
|
|
||||||
with_items: '{{ nextcloud_config_options }}'
|
|
||||||
when: nextcloud_config_options is defined
|
|
||||||
|
|
||||||
- name: create cron for nextcloud
|
- name: create cron for nextcloud
|
||||||
cron:
|
cron:
|
||||||
|
Loading…
Reference in New Issue
Block a user