Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ansible-community/ansible-lint-action from 6.2.1 to 6.8.2 #159

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- name: Run ansible-lint
# replace `main` with any valid ref, or tags like `v6`
uses: ansible-community/ansible-lint-action@v6.2.1
uses: ansible-community/ansible-lint-action@v6.8.2
# optional:
# with:
# path: "playbooks/" # <-- only one value is allowed
44 changes: 22 additions & 22 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
# [DOWNLOAD]
# An URL will be generated following naming rules used by nextcloud's repository
# Not following this rules correctly will make the role unable to download nextcloud.
nextcloud_version_channel: "releases" # mandatory # (releases | prereleases | daily)
nextcloud_version_channel: "releases" # mandatory # (releases/prereleases/daily)
# channel releases requires version_full.
# channel prereleases requires version_full. Optional: version_special.
# channel daily requires requires version_full & version_special.
nextcloud_get_latest: true # mandatory # specify if the latest archive should be downloaded.
# Override generated file name for channels: releases | daily.
# Override generated file name for channels: releases/daily.
# optional : version_major.
# nextcloud_version_major: 10 # (9 | 10 | 11| ..) for releases | for daily : (master | stable9 | stable10 | ...)
# nextcloud_version_full: "10.0.3" # full version string
# nextcloud_version_special: "" # For prereleases: "RCn|beta" | for daily "YYYY-MM-DD"
# nextcloud_version_major: 25 # (23/24/25/26) for releases or for daily (master/stable25/stable26...)
# nextcloud_version_full: "24.0.3" # full version string
# nextcloud_version_special: "" # For prereleases: "RCn/beta" or for daily "YYYY-MM-DD"
nextcloud_repository: "https://download.nextcloud.com/server" # Domain URL where to download Nextcloud.
nextcloud_archive_format: "zip" # zip | tar.bz2
nextcloud_archive_format: "zip" # zip/tar.bz2
# nextcloud_full_url: "https://download.nextcloud.com/server/releases/nextcloud-23.0.0.zip" # specify directly a full URL to the archive


# [PHP CONFIG AND EXTENSIONS]
# by default, use references stored in defaults/php_configs.yml
php_ver: "{{ os_config_ref[ansible_distribution|lower][ansible_distribution_release|lower].php_ver }}"
php_dir: "{{ php_config_ref[php_ver|replace('.','_')].php_dir | d(php_config_ref.defaults.php_dir) }}"
php_bin: "{{ php_config_ref[php_ver|replace('.','_')].php_bin | d(php_config_ref.defaults.php_bin) }}"
php_pkg_apcu: "{{ php_config_ref[php_ver|replace('.','_')].php_pkg_apcu | d(php_config_ref.defaults.php_pkg_apcu) }}"
php_pkg_spe: "{{ php_config_ref[php_ver|replace('.','_')].php_pkg_spe | d(php_config_ref.defaults.php_pkg_spe) }}"
php_socket: "{{ php_config_ref[php_ver|replace('.','_')].php_socket | d(php_config_ref.defaults.php_socket) }}"
php_ver: "{{ os_config_ref[ansible_distribution | lower][ansible_distribution_release | lower].php_ver }}"
php_dir: "{{ php_config_ref[php_ver | replace('.', '_')].php_dir | d(php_config_ref.defaults.php_dir) }}"
php_bin: "{{ php_config_ref[php_ver | replace('.', '_')].php_bin | d(php_config_ref.defaults.php_bin) }}"
php_pkg_apcu: "{{ php_config_ref[php_ver | replace('.', '_')].php_pkg_apcu | d(php_config_ref.defaults.php_pkg_apcu) }}"
php_pkg_spe: "{{ php_config_ref[php_ver | replace('.', '_')].php_pkg_spe | d(php_config_ref.defaults.php_pkg_spe) }}"
php_socket: "{{ php_config_ref[php_ver | replace('.', '_')].php_socket | d(php_config_ref.defaults.php_socket) }}"
php_memory_limit: 512M

# [NEXTCLOUD CONFIG]
Expand All @@ -40,9 +40,9 @@ nextcloud_trusted_proxies: []
nextcloud_instance_name: "{{ nextcloud_trusted_domain | first }}"

nextcloud_install_websrv: true
nextcloud_websrv: "apache2" # "apache2" | "nginx"
nextcloud_websrv_user: "{{ os_config_ref[ansible_os_family|lower].defaults.nextcloud_websrv_user }}"
nextcloud_websrv_group: "{{ os_config_ref[ansible_os_family|lower].defaults.nextcloud_websrv_group }}"
nextcloud_websrv: "apache2" # "apache2"/"nginx"
nextcloud_websrv_user: "{{ os_config_ref[ansible_os_family | lower].defaults.nextcloud_websrv_user }}"
nextcloud_websrv_group: "{{ os_config_ref[ansible_os_family | lower].defaults.nextcloud_websrv_group }}"
nextcloud_disable_websrv_default_site: false
nextcloud_websrv_template: "templates/{{ nextcloud_websrv }}_nc.j2"
nextcloud_webroot: "/opt/nextcloud"
Expand All @@ -69,16 +69,16 @@ nextcloud_config_settings:
- { name: 'memcache.local', value: '\OC\Memcache\APCu' }
- { name: 'open_basedir', value: '/dev/urandom' }
- { name: 'mysql.utf8mb4', value: 'true' }
- { name: 'updater.release.channel', value: 'production' } # production | stable | daily | beta
- { name: 'updater.release.channel', value: 'production' } # production/stable/daily/beta

# [DATABASE]
nextcloud_install_db: true
nextcloud_db_host: "127.0.0.1"
nextcloud_db_backend: "mysql" # "mysql"/"mariadb" | "pgsql"
nextcloud_db_backend: "mysql" # mysql/mariadb/pgsql
mysql_daemon: >-
{{
os_config_ref[ansible_distribution|lower][ansible_distribution_release|lower].mysql_daemon |
default(os_config_ref[ansible_distribution|lower].defaults.mysql_daemon)
os_config_ref[ansible_distribution | lower][ansible_distribution_release | lower].mysql_daemon |
default(os_config_ref[ansible_distribution | lower].defaults.mysql_daemon)
}}
nextcloud_db_enabled_on_startup: true
nextcloud_db_name: "nextcloud"
Expand All @@ -89,19 +89,19 @@ nextcloud_mysql_root_pwd_update: false

# [TLS] parameters used in the apache2 & nginx templates
## max file's size allowed to be uploaded on the server
nextcloud_max_upload_size: 512m # in Byte or human readable size notation (g|m|k)
nextcloud_max_upload_size: 512m # in Byte or human readable size notation (g/m/k)
nextcloud_install_tls: true
nextcloud_tls_enforce: true
nextcloud_mozilla_modern_ssl_profile: false # when false, intermediate profile is used
nextcloud_tls_cert_method: "self-signed" # "self-signed" | "signed" | "installed"
nextcloud_tls_cert_method: "self-signed" # self-signed/signed/installed
nextcloud_tls_dhparam: "/etc/ssl/dhparam.pem"
nextcloud_hsts: false # recommended >= 15552000
# nextcloud_tls_cert: /path/to/cert
# nextcloud_tls_cert_key: /path/to/cert/key
# nextcloud_tls_cert_chain: /path/to/cert/chain
# nextcloud_tls_src_cert: /path/to/cert
# nextcloud_tls_src_cert_key: /path/to/cert/key
nextcloud_tls_session_cache_size: 50m # in Byte or human readable size notation (g|m|k)
nextcloud_tls_session_cache_size: 50m # in Byte or human readable size notation (g/m/k)

# [APPS]
nextcloud_apps: {}
Expand Down
16 changes: 8 additions & 8 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
---
# handlers file for nextcloud
- name: restart mysql
- name: Restart mysql
ansible.builtin.service:
name: "{{ mysql_daemon }}"
state: restarted

- name: start http
- name: Start http
ansible.builtin.service:
name: "{{ nextcloud_websrv }}"
state: started

- name: restart http
- name: Restart http
ansible.builtin.service:
name: "{{ nextcloud_websrv }}"
state: restarted

- name: reload http
- name: Reload http
ansible.builtin.service:
name: "{{ nextcloud_websrv }}"
state: reloaded

- name: start php-fpm
- name: Start php-fpm
ansible.builtin.service:
name: php{{ php_ver }}-fpm
state: started

- name: reload php-fpm
- name: Reload php-fpm
ansible.builtin.service:
name: php{{ php_ver }}-fpm
state: reloaded

- name: start redis
- name: Start redis
ansible.builtin.service:
name: redis-server
state: started

- name: restart redis
- name: Restart redis
ansible.builtin.service:
name: redis-server
state: restarted
4 changes: 2 additions & 2 deletions tasks/db_mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
dest: /etc/mysql/conf.d/nextcloud.cnf
src: files/mysql_nextcloud.cnf
mode: 0600
notify: restart mysql
notify: Restart mysql

- name: "[mySQL] - Add Database {{ nextcloud_db_name }}."
- name: "[mySQL] - Add Database {{ nextcloud_db_name }}"
mysql_db:
name: "{{ nextcloud_db_name }}"
login_user: root
Expand Down
12 changes: 6 additions & 6 deletions tasks/http_apache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- {regexp: 'opcache.revalidate_freq', line: 'opcache.revalidate_freq=1'}
- {regexp: 'memory_limit', line: 'memory_limit={{ php_memory_limit }}'}
# validate: "/usr/sbin/{{ php_bin }} -t #%s"
notify: reload http
notify: Reload http

- name: "[APACHE] - Required Apache2 modules are enabled"
apache2_module:
Expand All @@ -36,7 +36,7 @@
- env
- dir
- mime
notify: restart http
notify: Restart http

- name: "[APACHE] - Ssl Apache2 module is enabled"
apache2_module:
Expand All @@ -45,25 +45,25 @@
with_items:
- ssl
when: (nextcloud_install_tls | bool)
notify: restart http
notify: Restart http

- name: "[APACHE] - generate Nextcloud configuration for apache"
ansible.builtin.template:
dest: /etc/apache2/sites-available/nc_{{ nextcloud_instance_name }}.conf
src: "{{ nextcloud_websrv_template }}"
mode: 0640
notify: reload http
notify: Reload http

- name: "[APACHE] - Enable Nextcloud site in apache conf"
ansible.builtin.file:
path: /etc/apache2/sites-enabled/nc_{{ nextcloud_instance_name }}.conf
src: /etc/apache2/sites-available/nc_{{ nextcloud_instance_name }}.conf
state: link
notify: reload http
notify: Reload http

- name: "[APACHE] - Disable apache default site"
ansible.builtin.file:
path: /etc/apache2/sites-enabled/000-default.conf
state: absent
when: nextcloud_disable_websrv_default_site | bool
notify: reload http
notify: Reload http
18 changes: 9 additions & 9 deletions tasks/http_nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
regexp: '^\;env'
state: absent
# validate: "/usr/sbin/{{ php_bin }} -t #%s"
notify: reload php-fpm
notify: Reload php-fpm

- name: "[NGINX] - Add path variable to php-fpm"
ansible.builtin.blockinfile:
Expand All @@ -18,7 +18,7 @@
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
notify: reload php-fpm
notify: Reload php-fpm

- name: "[NGINX] - enable APC for php CLI"
ansible.builtin.lineinfile:
Expand All @@ -27,7 +27,7 @@
insertbefore: "^; End:$"
state: present
# validate: "/usr/sbin/{{ php_bin }} -t #%s"
notify: reload php-fpm
notify: Reload php-fpm

- name: "[NGINX] - enable PHP OPcache for php.ini"
ansible.builtin.lineinfile:
Expand All @@ -46,7 +46,7 @@
- { regexp: 'opcache.revalidate_freq', line: 'opcache.revalidate_freq=1' }
- { regexp: 'memory_limit', line: 'memory_limit={{ php_memory_limit }}'}
# validate: "/usr/sbin/{{ php_bin }} -t #%s"
notify: reload php-fpm
notify: Reload php-fpm


- name: "[NGINX] - Public Diffie-Hellman Parameter are generated. This might take a while."
Expand All @@ -59,32 +59,32 @@
dest: /etc/nginx/sites-available/php_handler.cnf
src: templates/nginx_php_handler.j2
mode: 0640
notify: reload http
notify: Reload http

- name: "[NGINX] - php handler is enabled"
ansible.builtin.file:
path: /etc/nginx/sites-enabled/php_handler
src: /etc/nginx/sites-available/php_handler.cnf
state: link
notify: reload http
notify: Reload http

- name: "[NGINX] - generate Nextcloud configuration for nginx"
ansible.builtin.template:
dest: /etc/nginx/sites-available/nc_{{ nextcloud_instance_name }}.cnf
src: "{{ nextcloud_websrv_template }}"
mode: 0640
notify: reload http
notify: Reload http

- name: "[NGINX] - Enable Nextcloud in nginx conf"
ansible.builtin.file:
path: /etc/nginx/sites-enabled/nc_{{ nextcloud_instance_name }}
src: /etc/nginx/sites-available/nc_{{ nextcloud_instance_name }}.cnf
state: link
notify: reload http
notify: Reload http

- name: "[NGINX] - Disable nginx default site"
ansible.builtin.file:
path: /etc/nginx/sites-enabled/default
state: absent
when: nextcloud_disable_websrv_default_site | bool
notify: reload http
notify: Reload http
Loading