Updated Ansible tasks to FQCN format
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
- name: Create Nextcloud network
|
||||
docker_network:
|
||||
community.general.docker_network:
|
||||
name: "{{ nextcloud_container }}"
|
||||
|
||||
- name: Start Nextcloud's database container
|
||||
docker_container:
|
||||
community.general.docker_container:
|
||||
name: "{{ nextcloud_dbcontainer }}"
|
||||
image: mariadb:{{ nextcloud_dbversion }}
|
||||
state: started
|
||||
@@ -19,7 +19,7 @@
|
||||
MYSQL_PASSWORD: "{{ nextcloud_dbpass }}"
|
||||
|
||||
- name: Start Nextcloud container
|
||||
docker_container:
|
||||
community.general.docker_container:
|
||||
name: "{{ nextcloud_container }}"
|
||||
image: nextcloud:{{ nextcloud_version }}
|
||||
state: started
|
||||
@@ -41,34 +41,34 @@
|
||||
traefik.enable: "true"
|
||||
|
||||
- name: Grab Nextcloud database container information
|
||||
docker_container_info:
|
||||
community.general.docker_container_info:
|
||||
name: "{{ nextcloud_dbcontainer }}"
|
||||
register: nextcloud_dbinfo
|
||||
|
||||
- name: Grab Nextcloud container information
|
||||
docker_container_info:
|
||||
community.general.docker_container_info:
|
||||
name: "{{ nextcloud_container }}"
|
||||
register: nextcloud_info
|
||||
|
||||
- name: Wait for Nextcloud to become available
|
||||
wait_for:
|
||||
ansible.builtin.wait_for:
|
||||
host: "{{ nextcloud_info.container.NetworkSettings.Networks.traefik.IPAddress }}"
|
||||
port: 80
|
||||
|
||||
- name: Check Nextcloud status
|
||||
command: "docker exec --user www-data {{ nextcloud_container }}
|
||||
ansible.builtin.command: "docker exec --user www-data {{ nextcloud_container }}
|
||||
php occ status"
|
||||
register: nextcloud_status
|
||||
args:
|
||||
removes: "{{ nextcloud_root }}/config/CAN_INSTALL"
|
||||
|
||||
- name: Wait for Nextcloud database to become available
|
||||
wait_for:
|
||||
ansible.builtin.wait_for:
|
||||
host: "{{ nextcloud_dbinfo.container.NetworkSettings.Networks.nextcloud.IPAddress }}"
|
||||
port: 3306
|
||||
|
||||
- name: Install Nextcloud
|
||||
command: 'docker exec --user www-data {{ nextcloud_container }}
|
||||
ansible.builtin.command: 'docker exec --user www-data {{ nextcloud_container }}
|
||||
php occ maintenance:install
|
||||
--database "mysql"
|
||||
--database-host "{{ nextcloud_dbcontainer }}"
|
||||
@@ -83,19 +83,19 @@
|
||||
- nextcloud_domain is defined
|
||||
|
||||
- name: Set Nextcloud's Trusted Proxy
|
||||
command: 'docker exec --user www-data {{ nextcloud_container }}
|
||||
ansible.builtin.command: 'docker exec --user www-data {{ nextcloud_container }}
|
||||
php occ config:system:set trusted_proxies 0
|
||||
--value="{{ traefik_name }}"'
|
||||
when: nextcloud_install.changed
|
||||
|
||||
- name: Set Nextcloud's Trusted Domain
|
||||
command: 'docker exec --user www-data {{ nextcloud_container }}
|
||||
ansible.builtin.command: 'docker exec --user www-data {{ nextcloud_container }}
|
||||
php occ config:system:set trusted_domains 0
|
||||
--value="{{ nextcloud_domain }}"'
|
||||
when: nextcloud_install.changed
|
||||
|
||||
- name: Preform Nextcloud database maintenance
|
||||
command: "docker exec --user www-data {{ nextcloud_container }} {{ item }}"
|
||||
ansible.builtin.command: "docker exec --user www-data {{ nextcloud_container }} {{ item }}"
|
||||
loop:
|
||||
- "php occ maintenance:mode --on"
|
||||
- "php occ db:add-missing-indices"
|
||||
@@ -104,6 +104,6 @@
|
||||
when: nextcloud_install.changed
|
||||
|
||||
- name: Remove Nextcloud's CAN_INSTALL file
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ nextcloud_root }}/config/CAN_INSTALL"
|
||||
state: absent
|
||||
|
Reference in New Issue
Block a user