mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Refactored CyMaIS basic features and optimized wordpress implementation
This commit is contained in:
@@ -39,4 +39,8 @@
|
||||
|
||||
- name: "Activating OIDC when enabled."
|
||||
include_tasks: oidc.yml
|
||||
when: applications[application_id].oidc.enabled | bool
|
||||
when: applications[application_id].features.oidc | bool
|
||||
|
||||
#- name: "Activating WP Discourse when enabled"
|
||||
# include_tasks: wp_discourse.yml
|
||||
# when: applications[application_id].wp_discourse.enabled | bool
|
||||
|
23
roles/docker-wordpress/tasks/setup-discourse-api-key.yml
Normal file
23
roles/docker-wordpress/tasks/setup-discourse-api-key.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: "Create Discourse API key for WordPress integration"
|
||||
uri:
|
||||
url: "https://{{ domains.discourse }}/admin/api/keys"
|
||||
method: POST
|
||||
headers:
|
||||
Content-Type: "application/json"
|
||||
Api-Key: "{{ applications.discourse.master_api_key }}"
|
||||
Api-Username: "{{ applications.discourse.master_api_username | default('admin') }}"
|
||||
body_format: json
|
||||
body:
|
||||
key:
|
||||
description: "WP Discourse Integration"
|
||||
username: "system"
|
||||
return_content: true
|
||||
status_code: 200
|
||||
register: discourse_api_key_response
|
||||
when: applications.discourse.master_api_key is defined
|
||||
|
||||
- name: "Set fact for vault_discourse_api_key"
|
||||
set_fact:
|
||||
vault_discourse_api_key: "{{ discourse_api_key_response.json.key.key }}"
|
||||
when: discourse_api_key_response is defined and discourse_api_key_response.json.key is defined
|
17
roles/docker-wordpress/tasks/wp_discourse.yml
Normal file
17
roles/docker-wordpress/tasks/wp_discourse.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: "Install WP Discourse plugin"
|
||||
command: >
|
||||
docker-compose exec -u www-data -T application
|
||||
wp plugin install wp-discourse --activate
|
||||
--path={{ wordpress_docker_html_path }}
|
||||
args:
|
||||
chdir: "{{ docker_compose.directories.instance }}"
|
||||
|
||||
- name: "Configure WP Discourse settings"
|
||||
vars:
|
||||
discourse_settings_json_b64: "{{ discourse_settings | to_json | b64encode }}"
|
||||
command: >
|
||||
docker-compose exec -u www-data -T application bash -lc
|
||||
"wp eval \"update_option('wp_discourse_options', json_decode(base64_decode('{{ discourse_settings_json_b64 }}'), true));\" --path={{ wordpress_docker_html_path }}"
|
||||
args:
|
||||
chdir: "{{ docker_compose.directories.instance }}"
|
Reference in New Issue
Block a user