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

Install theme files accumulatively from zip file #2

Merged
merged 8 commits into from
Aug 6, 2024
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
15 changes: 15 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,18 @@ httpd_navbar:
- name: "About"
icon: "fas fa-info-circle"
link: "#"

# ===============================================================================
# Blog theme configuration.
#
# Themes are being installed in accumulative way to avoid conflicts between
# different theme versions (e.g., because files were added or removed). You can
# switch from one theme version to another using the wordpress graphical user
# interface, after performing a live preview verification. As new themes are
# installed, older themes are available as backup mechanism.
#
# New theme releases can be found in:
# - https://gitlab.com/CentOS/artwork/centos-web/wordpress-theme-centos/-/releases
# ===============================================================================
wp_theme_name: wordpress-theme-centos
wp_theme_version: "1.0.16"
60 changes: 19 additions & 41 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
- include_tasks: selinux.yml

- block:
- name: Creating mandatory DB
include_role:
- name: Creating mandatory DB
include_role:
name: mysql
tasks_from: db_remote
vars:
Expand All @@ -21,7 +21,7 @@
mysql_host: "{{ wp_mysql_host }}"

- name: Opening iptables if needed on remote mysql host
include_role:
include_role:
name: iptables
tasks_from: remote-mysqld
vars:
Expand All @@ -33,8 +33,8 @@
name: mysql
when: not wp_use_remote_mysql_host

- name: Creating mandatory (local) DB
include_role:
- name: Creating mandatory (local) DB
include_role:
name: mysql
tasks_from: db
vars:
Expand Down Expand Up @@ -68,8 +68,8 @@
- restart_httpd
with_items:
- ssl-wp-vhost.conf
when: wp_httpd_tls
when: wp_httpd_tls

- import_role:
name: httpd
tasks_from: pki-tls
Expand Down Expand Up @@ -124,15 +124,15 @@
url: https://api.wordpress.org/secret-key/1.1/salt/
return_content: True
when: wp_new_install is changed
register: wp_api_keys
register: wp_api_keys
tags:
- api

- name: Minimal configuration for wordpress
template:
src: wp-config.php.j2
dest: "{{ wp_local_path }}/wp-config.php"
when: wp_new_install is changed
when: wp_new_install is changed
tags:
- config

Expand All @@ -141,7 +141,7 @@
src: "https://downloads.wordpress.org/plugin/{{ item.name }}.{{ item.version }}.zip"
remote_src: yes
dest: "{{ wp_local_path | default('/var/www/wordpress') }}/wp-content/plugins/"
with_items: "{{ wp_plugins }}"
with_items: "{{ wp_plugins }}"
tags:
- plugins

Expand All @@ -155,50 +155,28 @@
template:
src: fedora-autologin.php.j2
dest: "{{ wp_local_path | default('/var/www/wordpress') }}/wp-content/plugins/fedora-autologin/fedora-autologin.php"
when: wp_openid_redirect
when: wp_openid_redirect

- name: Ensuring centos theme directory exists
file:
path: "{{ wp_local_path | default('/var/www/wordpress') }}/wp-content/themes/{{ item }}/"
path: "{{ wp_local_path | default('/var/www/wordpress') }}/wp-content/themes/{{ wp_theme_name}}-{{ wp_theme_version }}/"
state: directory
with_items:
- centos
- centos/includes
tags: theme

- name: Update theme files
template:
src: "{{ item }}"
dest: "{{ wp_local_path | default('/var/www/wordpress') }}/wp-content/themes/centos/{{ item | basename }}"
with_fileglob:
- "templates/theme/*.php"
- "templates/theme/*.css"
tags: theme

- name: Update theme includes
template:
src: "{{ item }}"
dest: "{{ wp_local_path | default('/var/www/wordpress') }}/wp-content/themes/centos/includes/{{ item | basename }}"
with_fileglob:
- "templates/theme/includes/*.php"
tags: theme

- name: Update theme screenshot
copy:
src: "{{ item }}"
dest: "{{ wp_local_path | default('/var/www/wordpress') }}/wp-content/themes/centos/{{ item | basename }}"
with_fileglob:
- "templates/theme/screenshot.png"
- name: Update centos theme files
unarchive:
src: "https://gitlab.com/api/v4/projects/CentOS%2Fartwork%2Fcentos-web%2F{{ wp_theme_name }}/packages/generic/release/{{ wp_theme_version }}/{{ wp_theme_name }}.zip"
dest: "{{ wp_local_path | default('/var/www/wordpress') }}/wp-content/themes/{{ wp_theme_name}}-{{ wp_theme_version }}/"
remote_src: true
tags: theme

- name: Ensuring backup user and jobs
include_role:
name: centos-backup
tasks_from: client

- include_role:
name: postfix
tasks_from: relay_to
vars:
postfix_relay_to: True

postfix_relay_to: True
36 changes: 0 additions & 36 deletions templates/theme/404.php

This file was deleted.

24 changes: 0 additions & 24 deletions templates/theme/archive.php

This file was deleted.

24 changes: 0 additions & 24 deletions templates/theme/category.php

This file was deleted.

56 changes: 0 additions & 56 deletions templates/theme/comments.php

This file was deleted.

45 changes: 0 additions & 45 deletions templates/theme/footer.php

This file was deleted.

Loading