robertdebock.nextcloud

Ansible 角色 nextcloud

在您的系统上安装和配置 Nextcloud。

GitHub GitLab 下载 版本
github gitlab downloads Version

示例剧本

这个示例来自 molecule/default/converge.yml,并在每次推送、拉取请求和发布时进行测试。

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: robertdebock.nextcloud
      nextcloud_apps:
        - name: richdocumentscode
      nextcloud_settings:
        - name: max_chunk_size
          section: files
          value: 0

在 CI 中,需要准备机器。这是通过 molecule/default/prepare.yml 来完成的:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap
    - role: robertdebock.core_dependencies
    - role: robertdebock.cron
    - role: robertdebock.buildtools
    - role: robertdebock.epel
    - role: robertdebock.python_pip
    - role: robertdebock.openssl
      openssl_items:
        - name: apache-httpd
          common_name: "{{ ansible_fqdn }}"
    - role: robertdebock.selinux
    - role: robertdebock.httpd
    - role: robertdebock.redis

- name: 继续准备以获取数据
  hosts: all
  become: true
  gather_facts: false

  pre_tasks:
    - name: 包含 remi
      ansible.builtin.include_role:
        name: robertdebock.remi
      when:
        - ansible_distribution != "Fedora"
      vars:
        remi_enabled_repositories:
          - php74

  roles:
    - role: robertdebock.php
      php_memory_limit: 512M
      php_upload_max_filesize: 8G
      php_post_max_size: 8G
    - role: robertdebock.php_fpm
    - role: robertdebock.mysql
      mysql_databases:
        - name: nextcloud
          encoding: utf8
          collation: utf8_bin
      mysql_users:
        - name: nextcloud
          password: N3x4Cl0ud
          priv: "nextcloud.*:ALL"

还请查看 完整解释和示例,了解如何使用这些角色。

角色变量

变量的默认值在 defaults/main.yml 中设置:

---
# nextcloud 的默认文件

# 要安装的 nextcloud 版本。
nextcloud_version: "25.0.4"

# 该服务器可用的域名。例如:
# "localhost" 或 "nextcloud.example.com"。不包含协议标识符,
# (https://) 或目录。 (/nextcloud)
nextcloud_domain_url: "{{ ansible_default_ipv4.address | default(ansible_all_ipv4_addresses[0]) }}"

# 数据库连接详细信息。
nextcloud_database_name: nextcloud
nextcloud_database_user: nextcloud
nextcloud_database_pass: N3x4Cl0ud
nextcloud_database_host: "127.0.0.1"
nextcloud_admin_user: admin
nextcloud_admin_pass: N3x4Cl0ud

# 您可以将应用程序安装到 NextCloud 中。
# nextcloud_apps:
#   - name: richdocumentscode

# 您可以为 nextcloud 设置参数
# nextcloud_settings:
#   - name: max_chunk_size
#     section: files
#     value: 0

# 您可以在您选择的位置安装 nextcloud。特定于发行版的
# 目标位置在 `vars/main.yml` 中设置,此处可以查找。您可以随意
# 重写目标位置为您喜欢的位置。例如:
#
# nextcloud_destination: /opt
#
nextcloud_destination: "{{ _nextcloud_destination[ansible_distribution] | default(_nextcloud_destination['default']) }}"

需求

使用的角色状态

以下角色用于准备系统。您可以以其他方式准备您的系统。

需求 GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.buildtools Build Status GitHub Build Status GitLab
robertdebock.core_dependencies Build Status GitHub Build Status GitLab
robertdebock.cron Build Status GitHub Build Status GitLab
robertdebock.epel Build Status GitHub Build Status GitLab
robertdebock.httpd Build Status GitHub Build Status GitLab
robertdebock.mysql Build Status GitHub Build Status GitLab
robertdebock.openssl Build Status GitHub Build Status GitLab
robertdebock.php Build Status GitHub Build Status GitLab
robertdebock.php_fpm Build Status GitHub Build Status GitLab
robertdebock.python_pip Build Status GitHub Build Status GitLab
robertdebock.redis Build Status GitHub Build Status GitLab
robertdebock.remi Build Status GitHub Build Status GitLab
robertdebock.selinux Build Status GitHub Build Status GitLab

上下文

此角色是多个兼容角色的一部分。有关更多信息,请查看 这些角色的文档

这是相关角色的概述: 依赖关系

兼容性

此角色已在以下 容器镜像 上进行测试:

容器 标签
EL 9
Ubuntu jammy

所需的最低 Ansible 版本为 2.12,测试已针对:

  • 前一个版本。
  • 当前版本。
  • 开发版本。

如果您发现问题,请在 GitHub 上注册。

许可证

Apache-2.0

作者信息

robertdebock

请考虑 赞助我

关于项目

Install and configure Nextcloud on your system.

安装
ansible-galaxy install robertdebock.nextcloud
许可证
apache-2.0
下载
88.8k
拥有者
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.