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

Make public config mode/owner configurable #1073

Open
wants to merge 3 commits into
base: 32.x
Choose a base branch
from
Open
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
15 changes: 12 additions & 3 deletions config/core/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,25 @@ m_cache_directory_mode: "0770"
m_cache_directory_owner: "{{ user_apache }}"
m_cache_directory_group: "{{ group_apache }}"


m_logs_mode: "0755"
m_logs_owner: meza-ansible
m_logs_group: wheel


m_backups_mode: "0755"
m_backups_owner: root
m_backups_group: root

# Public config is present on the controller at /opt/conf-meza/public (set above
# in `m_local_public`). That directory is deployed to all servers into the
# /opt/.deploy-meza/public directory. Below allows setting mode and ownership
# for each destination.
m_public_config_mode: "0644"
m_public_config_owner: root
m_public_config_group: root
m_public_config_deployed_mode: "0755"
m_public_config_deployed_owner: root
m_public_config_deployed_group: root


#
# PHP config
Expand All @@ -261,7 +270,7 @@ php_opcache_memory_consumption: 256
php_opcache_interned_strings_buffer: 16

# The amount of input variables that may be accepted
php_max_input_vars: 2000
php_max_input_vars: 2000

# It's important for this number to be greater than the number of PHP files on a
# server.
Expand Down
16 changes: 8 additions & 8 deletions src/roles/configure-wiki/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
file:
path: "/opt/conf-meza/public/wikis/{{ wiki_id }}"
state: directory
owner: "{{ user_apache }}"
group: "{{ group_apache }}"
owner: "{{ m_public_config_owner }}"
group: "{{ m_public_config_group }}"
mode: 0755
delegate_to: localhost
run_once: true
Expand All @@ -36,8 +36,8 @@
dest: "/opt/conf-meza/public/wikis/{{ wiki_id }}/{{ item }}"
# force=no: this will not overwrite
force: no
owner: "{{ user_apache }}"
group: "{{ group_apache }}"
owner: "{{ m_public_config_owner }}"
group: "{{ m_public_config_group }}"
mode: 0755
with_items:
- favicon.ico
Expand All @@ -49,8 +49,8 @@
file:
path: "/opt/conf-meza/public/wikis/{{ wiki_id }}/{{ item }}"
state: directory
owner: "{{ user_apache }}"
group: "{{ group_apache }}"
owner: "{{ m_public_config_owner }}"
group: "{{ m_public_config_group }}"
mode: 0755
delegate_to: localhost
run_once: true
Expand All @@ -64,8 +64,8 @@
dest: "/opt/conf-meza/public/wikis/{{ wiki_id }}/{{ item }}"
# force=no: Non-default for templates. Destination files will not be overwritten
force: no
owner: "{{ user_apache }}"
group: "{{ group_apache }}"
owner: "{{ m_public_config_owner }}"
group: "{{ m_public_config_group }}"
mode: 0755
with_items:
- preLocalSettings.d/base.php
Expand Down
24 changes: 12 additions & 12 deletions src/roles/init-controller-config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
file:
path: "{{ m_local_public }}"
state: directory
owner: root
group: root
mode: 0755
owner: "{{ m_public_config_owner }}"
group: "{{ m_public_config_group }}"
mode: "{{ m_public_config_mode }}"
recurse: true
delegate_to: localhost
run_once: true
Expand All @@ -69,9 +69,9 @@
file:
path: "{{ m_local_public }}/wikis"
state: directory
owner: root
group: root
mode: 0755
owner: "{{ m_public_config_owner }}"
group: "{{ m_public_config_group }}"
mode: "{{ m_public_config_mode }}"
delegate_to: localhost
run_once: true

Expand All @@ -80,9 +80,9 @@
file:
path: "/opt/conf-meza/public/{{ item }}"
state: directory
owner: root
group: root
mode: 0755
owner: "{{ m_public_config_owner }}"
group: "{{ m_public_config_group }}"
mode: "{{ m_public_config_mode }}"
delegate_to: localhost
run_once: true
with_items:
Expand All @@ -94,9 +94,9 @@
template:
src: "templates/{{ item }}.j2"
dest: "{{ m_local_public }}/{{ item }}"
owner: root
group: root
mode: 0755
owner: "{{ m_public_config_owner }}"
group: "{{ m_public_config_group }}"
mode: "{{ m_public_config_mode }}"
force: no
delegate_to: localhost
run_once: true
Expand Down
4 changes: 2 additions & 2 deletions src/roles/mediawiki/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

- name: Set variable holding list of local skins
include_vars:
file: "{{ m_local_public }}/MezaLocalSkins.yml"
file: "{{ m_deploy }}/public/MezaLocalSkins.yml"
name: meza_local_skins
tags:
- skins
Expand Down Expand Up @@ -132,7 +132,7 @@

- name: Set variable holding list of local extensions
include_vars:
file: "{{ m_local_public }}/MezaLocalExtensions.yml"
file: "{{ m_deploy }}/public/MezaLocalExtensions.yml"
name: meza_local_extensions
tags:
- always
Expand Down
12 changes: 6 additions & 6 deletions src/roles/sync-configs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
file:
path: "{{ m_deploy }}/public"
state: directory
owner: root
group: root
mode: 0755
owner: "{{ m_public_config_deployed_owner }}"
group: "{{ m_public_config_deployed_group }}"
mode: "{{ m_public_config_deployed_mode }}"
recurse: yes

# At this point the controller must have a local config. Now force it upon the
Expand All @@ -28,8 +28,8 @@
file:
path: "{{ m_deploy }}"
state: directory
owner: root
group: root
mode: 0755
owner: "{{ m_public_config_deployed_owner }}"
group: "{{ m_public_config_deployed_group }}"
mode: "{{ m_public_config_deployed_mode }}"
recurse: yes