Compare commits

..

1 Commits

Author SHA1 Message Date
28806de6e4 testing 2024-03-09 00:40:18 -05:00
4 changed files with 18 additions and 26 deletions

View File

@ -44,8 +44,9 @@ traefik:
# nextcloud
nextcloud:
DB_NAME: nextcloud
DB_USER: nextcloud
DB_PASSWD: password
ADMIN_PASSWD: password
# nextcloud
#nextcloud_version: stable

View File

@ -5,17 +5,17 @@
- name: Create Nextcloud database
community.mysql.mysql_db:
name: "{{ nextcloud.DB_NAME | default('nextcloud') }}"
name: "{{ nextcloud.DB_NAME }}"
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Create Nextcloud database user
community.mysql.mysql_user:
name: "{{ nextcloud.DB_USER | default('nextcloud') }}"
name: "{{ nextcloud.DB_USER }}"
password: "{{ nextcloud.DB_PASSWD }}"
host: '%'
state: present
priv: "{{ nextcloud.DB_NAME | default('nextcloud') }}.*:ALL"
priv: "{{ nextcloud.DB_NAME }}.*:ALL"
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Start Nextcloud service and enable on boot
@ -32,8 +32,9 @@
- name: Wait for Nextcloud to become available
ansible.builtin.wait_for:
host: "{{ nextcloud_info.container.NetworkSettings.Networks.traefik.IPAddress }}"
delay: 10
#debug:
#host: "{{ nextcloud_info.container.NetworkSettings.Networks.traefik.IPAddress }}"
#var: nextcloud_info.container.NetworkSettings
port: 80
- name: Check Nextcloud status
@ -42,16 +43,20 @@
register: nextcloud_status
changed_when: false
- name: Check status return
debug:
var: nextcloud_status.stderr[:26]
- name: Install Nextcloud
ansible.builtin.command: 'docker exec --user www-data {{ nextcloud_name }}
php occ maintenance:install
--database "mysql"
--database-host "{{ nextcloud.DB_HOST | default(''host.docker.internal'') }}"
--database-name "{{ nextcloud.DB_NAME | default(''nextcloud'') }}"
--database-user "{{ nextcloud.DB_USER | default(''nextcloud'') }}"
--database-pass "{{ nextcloud.DB_PASSWD }}"
--admin-user "{{ nextcloud.ADMIN_USER | default(''admin'') }}"
--admin-pass "{{ nextcloud.ADMIN_PASSWD }}"'
--database-host "{{ nextcloud_dbcontainer }}"
--database-name "{{ nextcloud_dbname }}"
--database-user "{{ nextcloud_dbuser }}"
--database-pass "{{ nextcloud_dbpass }}"
--admin-user "{{ nextcloud_admin }}"
--admin-pass "{{ nextcloud_pass }}"'
register: nextcloud_install
when: nextcloud_status.stderr[:26] == "Nextcloud is not installed"

View File

@ -1 +0,0 @@
cached_dhparams_pem: /vagrant/scratch/dhparams.pem

View File

@ -10,19 +10,6 @@
state: started
enabled: true
- name: Check for cached dhparams.pem file
ansible.builtin.stat:
path: "{{ cached_dhparams_pem }}"
register: dhparams_file
- name: Copy cached dhparams.pem to /etc/ssl/
ansible.builtin.copy:
src: "{{ cached_dhparams_pem }}"
dest: /etc/ssl/dhparams.pem
mode: "600"
remote_src: true
when: dhparams_file.stat.exists
- name: Generate DH Parameters
community.crypto.openssl_dhparam:
path: /etc/ssl/dhparams.pem