Skip to content

Commit

Permalink
Collection renaming
Browse files Browse the repository at this point in the history
Signed-off-by: staticdev <staticdev-support@proton.me>
  • Loading branch information
staticdev committed May 21, 2023
1 parent efa00b0 commit 93480da
Show file tree
Hide file tree
Showing 46 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
-e "github_tag=$(cat galaxy.yml|grep version:|cut -d' ' -f2)"
-e "ansible_namespace=$(echo ${{ github.repository }}
| cut -d/ -f1)"
-e "collection=admin"
-e "collection=nextcloud"
- name: Publish the release notes
uses: release-drafter/release-drafter@v5
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# ansible collection for nextcloud administration

This repository hosts the `nextcloud.admin` Ansible Collection (formerly the role `aalaesar.install_nextcloud`).
This repository hosts the `nextcloud.nextcloud` Ansible Collection (formerly the role `aalaesar.install_nextcloud`).

The collection includes a variety of Ansible content to help automate the management of nextcloud, as well as provisioning and maintenance of instances of nextcloud.

Expand All @@ -31,14 +31,14 @@ This collection supports Nextcloud versions: `24`, `25`, `26 (latest)`
### Modules
Name | Description
--- | ---
nextcloud.admin.run_occ|Run the occ command line tool with given arguments
nextcloud.nextcloud.run_occ|Run the occ command line tool with given arguments

### Roles

Name | Description
--- | ---
nextcloud.admin.backup (**beta**)|Create a backup of a Nextcloud server - formerly `aalaesar.backup_nextcloud`
nextcloud.admin.install_nextcloud | Install and configure an Nextcloud instance for a Debian/Ubuntu server - formerly `aalaesar.install_nextcloud`
nextcloud.nextcloud.backup (**beta**)|Create a backup of a Nextcloud server - formerly `aalaesar.backup_nextcloud`
nextcloud.nextcloud.install | Install and configure an Nextcloud instance for a Debian/Ubuntu server - formerly `aalaesar.install_nextcloud`

<!--end collection content-->

Expand Down Expand Up @@ -67,20 +67,20 @@ Alternatively, you can also add the content of [this file](requirements.yml) in

Before using the nextcloud collection, you need to install it with the Ansible Galaxy CLI:

ansible-galaxy collection install nextcloud.admin
ansible-galaxy collection install nextcloud.nextcloud

You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format:

```yaml
---
collections:
- name: nextcloud.admin
- name: nextcloud.nextcloud
version: 2.0.0
```

### Using modules from the Nextcloud Collection in your playbooks

It's preferable to use content in this collection using their Fully Qualified Collection Namespace (FQCN), for example `nextcloud.admin.run_occ`:
It's preferable to use content in this collection using their Fully Qualified Collection Namespace (FQCN), for example `nextcloud.nextcloud.run_occ`:

```yaml
---
Expand All @@ -89,12 +89,12 @@ It's preferable to use content in this collection using their Fully Qualified Co
become: true
tasks:
- name: list installed apps
nextcloud.admin.run_occ:
nextcloud.nextcloud.run_occ:
nextcloud_path: /var/www/nextcloud
command: app:list
```

If upgrading older playbooks from <2.0.0, you can minimise your changes by defining `collections` in your play and refer to this collection's role as `install_nextcloud`, instead of `nextcloud.admin.install_nextcloud`, as in this example:
If upgrading older playbooks from <2.0.0, you can minimise your changes by defining `collections` in your play and refer to this collection's role as `install`, instead of `nextcloud.nextcloud.install`, as in this example:

```yaml
---
Expand All @@ -103,12 +103,12 @@ If upgrading older playbooks from <2.0.0, you can minimise your changes by defin
connection: local

collections:
- nextcloud.admin
- nextcloud.nextcloud

tasks:
- name: deploy nextcloud and dependencies
include_role:
name: install_nextcloud
name: install
# previously:
# name: aalaesar.install_nextcloud
```
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace: nextcloud

# The name of the collection. Has the same character restrictions as 'namespace'
name: admin
name: nextcloud

# The version of the collection. Must be compatible with semantic versioning
version: 2.0.1
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/latest-converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
- external
- mail
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
2 changes: 1 addition & 1 deletion molecule/default/nc24-converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
- external
- mail
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
2 changes: 1 addition & 1 deletion molecule/default/nc25-converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
- external
- mail
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
File renamed without changes.
8 changes: 4 additions & 4 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
gather_facts: true
vars:
# load configurations references
os_config_ref: "{{ lookup('ansible.builtin.template', '../../roles/install_nextcloud/defaults/os_config_ref.yml') | from_yaml }}"
os_config_ref: "{{ lookup('ansible.builtin.template', '../../roles/install/defaults/os_config_ref.yml') | from_yaml }}"
vars_files:
- ../../roles/install_nextcloud/defaults/main.yml
- ../../roles/install/defaults/main.yml

tasks:
- name: "Include test_install_nextcloud"
- name: "Include test_install"
ansible.builtin.import_role:
name: "test_install_nextcloud"
name: "test_install"
10 changes: 5 additions & 5 deletions plugins/modules/run_occ.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
unless it is run as the user that own the occ tool.
extends_documentation_fragment:
- nextcloud.admin.occ_common_options
- nextcloud.nextcloud.occ_common_options
options:
command:
Expand All @@ -61,14 +61,14 @@

EXAMPLES = r"""
- name: get nextcloud basic info status
nextcloud.admin.run_occ:
nextcloud.nextcloud.run_occ:
command: status --output=json
nextcloud_path: /var/lib/www/nextcloud
changed_when: false
register: nc_status
- name: install an application
nextcloud.admin.run_occ:
nextcloud.nextcloud.run_occ:
command: app:install notes
nextcloud_path: /var/lib/www/nextcloud
"""
Expand Down Expand Up @@ -102,8 +102,8 @@
"""
import copy
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible_collections.nextcloud.admin.plugins.module_utils.occ import run_occ
from ansible_collections.nextcloud.admin.plugins.module_utils.occ_args_common import (
from ansible_collections.nextcloud.nextcloud.plugins.module_utils.occ import run_occ
from ansible_collections.nextcloud.nextcloud.plugins.module_utils.occ_args_common import (
OCC_ARGS_SPEC,
)

Expand Down
4 changes: 2 additions & 2 deletions roles/backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ None
```yaml
- hosts: nextcloud
roles:
- role: nextcloud.admin.backup
- role: nextcloud.nextcloud.backup
```

### Making a partial backup with only the app_data

```yaml
- hosts: nextcloud
roles:
- role: nextcloud.admin.backup
- role: nextcloud.nextcloud.backup
vars:
nextcloud_backup_suffix: _only_app_data
nextcloud_backup_user: false
Expand Down
16 changes: 8 additions & 8 deletions roles/install_nextcloud/README.md → roles/install/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ansible role: install_nextcloud
# Ansible role: install

This role installs and configures an Nextcloud instance for a Debian/Ubuntu server.

Expand Down Expand Up @@ -34,7 +34,7 @@ This role requires root access, so either configure it in your inventory files,
- hosts: dnsserver
become: true
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
```

## Dependencies
Expand Down Expand Up @@ -570,7 +570,7 @@ In some case, you may want to deploy quickly many instances of Nextcloud on mult
---
- hosts: server
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
```

- This will install a Nextcloud instance in /opt/nextcloud using apache2 and mysql.
Expand All @@ -584,7 +584,7 @@ You can choose the version channel to download a specific version of nextcloud.
---
- hosts: server
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
nextcloud_version_channel: "daily"
nextcloud_version_major: "master"
```
Expand All @@ -594,15 +594,15 @@ This role is not designed to manage letsencrypt certificates. However you can st

You must create first your certificates using a letsencrypt ACME client or an Ansible role like [this one] (https://github.com/jaywink/ansible-letsencrypt)

then call _install_nextcloud_ by setting `nextcloud_tls_cert_method: "installed"`
then call _install_ by setting `nextcloud_tls_cert_method: "installed"`

Here 2 examples for apache and nginx (because they have slightly different configurations)

```yaml
---
- hosts: apache_server
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
nextcloud_trusted_domain:
- "example.com"
nextcloud_tls_cert_method: "installed"
Expand All @@ -612,7 +612,7 @@ Here 2 examples for apache and nginx (because they have slightly different confi

- hosts: nginx_server
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
nextcloud_trusted_domain:
- "example2.com"
nextcloud_tls_cert_method: "installed"
Expand All @@ -634,7 +634,7 @@ He can run the role with the following variables to install Nextcloud accordingl
---
- hosts: server
roles:
- role: nextcloud.admin.install_nextcloud
- role: nextcloud.nextcloud.install
nextcloud_version_major: 25
nextcloud_trusted_domain:
- "cloud.example.tld"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
galaxy_info:
author: aalaesar
role_name: install_nextcloud
role_name: install
description: Install Nextcloud server like you want ! Apache2 or Nginx ? MariaDB or PostgresQL ? You choose, you watch, it works !

license: BSD
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/nextcloud_mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- curl

roles:
- nextcloud.admin.install_nextcloud
- nextcloud.nextcloud.install

vars:
nextcloud_db_backend: "mariadb"
Expand Down
2 changes: 1 addition & 1 deletion tests/nextcloud_mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- curl

roles:
- nextcloud.admin.install_nextcloud
- nextcloud.nextcloud.install

vars:
nextcloud_db_backend: "mysql"
Expand Down
2 changes: 1 addition & 1 deletion tests/nextcloud_nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- curl

roles:
- nextcloud.admin.install_nextcloud
- nextcloud.nextcloud.install

vars:
nextcloud_db_backend: "mariadb"
Expand Down
2 changes: 1 addition & 1 deletion tests/nextcloud_psql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- curl

roles:
- nextcloud.admin.install_nextcloud
- nextcloud.nextcloud.install

vars:
nextcloud_db_backend: "pgsql"
Expand Down

0 comments on commit 93480da

Please sign in to comment.