Initial commit

This commit is contained in:
2026-05-28 15:50:09 -04:00
commit 0e90090518
8 changed files with 217 additions and 0 deletions

38
README.md Normal file
View File

@@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

3
defaults/main.yml Normal file
View File

@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# defaults file for ansible-role-nextcloud

3
handlers/main.yml Normal file
View File

@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for ansible-role-nextcloud

35
meta/main.yml Normal file
View File

@@ -0,0 +1,35 @@
#SPDX-License-Identifier: MIT-0
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

126
tasks/main.yml Normal file
View File

@@ -0,0 +1,126 @@
#SPDX-License-Identifier: MIT-0
---
# tasks file for ansible-role-nextcloud
- name: Add NextCloud repo
kubernetes.core.helm_repository:
name: nextcloud
repo_url: https://nextcloud.github.io/helm/
register: repo
- name: Update Helm repos
command: helm repo update
when: repo.changed
- name: Deploy NextCloud
kubernetes.core.helm:
name: nextcloud
chart_ref: nextcloud/nextcloud
release_namespace: nextcloud
create_namespace: true
values:
image:
pullPolicy: IfNotPresent
livenessProbe:
initialDelaySeconds: 300
readinessProbe:
initialDelaySeconds: 300
nextcloud:
host: nextcloud.eom.dev
username: nextcloud_admin
password: "{{ nextcloud_admin_password }}"
configs:
proxy.config.php: |-
<?php
$CONFIG = array (
'overwriteprotocol' => 'https',
'trusted_proxies' => array(
0 => '127.0.0.1',
1 => '10.0.0.0/8',
),
'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),
);
mail:
enabled: true
fromAddress: nextcloud
domain: postfix.eom.dev
smtp:
host: postfix.eom.dev
secure: ssl
port: 587
authtype: LOGIN
name: nextcloud
password: "{{ nextcloud_admin_password }}"
persistence:
enabled: true
size: 8Ti
metrics:
enabled: true
cronjob:
enabled: true
redis:
#global:
#defaultStorageClass: r720-nfs-client
enabled: true
auth:
password: "{{ redis_auth_password }}"
ingress:
enabled: true
className: nginx
annotations:
#nginx.ingress.kubernetes.io/enable-cors: "true"
#nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For"
nginx.ingress.kubernetes.io/proxy-body-size: 4G
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: ca-issuer
# Keep this in sync with the README.md:
nginx.ingress.kubernetes.io/server-snippet: |-
server_tokens off;
proxy_hide_header X-Powered-By;
rewrite ^/.well-known/webfinger /index.php/.well-known/webfinger last;
rewrite ^/.well-known/nodeinfo /index.php/.well-known/nodeinfo last;
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json;
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:autotest|occ|issue|indie|db_|console) {
deny all;
}
tls:
- hosts:
- nextcloud.eom.dev
secretName: nextcloud-tls
internalDatabase:
enabled: false
externalDatabase:
enabled: true
type: postgresql
host: postgresql
user: nextcloud
password: "{{ nextcloud_admin_password }}"
database: nextcloud
postgresql:
enabled: true
image:
tag: 16.6.0-debian-12-r2
global:
postgresql:
auth:
username: nextcloud
password: "{{ nextcloud_admin_password }}"
database: nextcloud
primary:
persistence:
enabled: true
size: 2Ti

3
tests/inventory Normal file
View File

@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
localhost

6
tests/test.yml Normal file
View File

@@ -0,0 +1,6 @@
#SPDX-License-Identifier: MIT-0
---
- hosts: localhost
remote_user: root
roles:
- ansible-role-nextcloud

3
vars/main.yml Normal file
View File

@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# vars file for ansible-role-nextcloud