diff --git a/defaults/main.yml b/defaults/main.yml index 03f9761..fe7559e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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" diff --git a/tasks/main.yml b/tasks/main.yml index 52e8f33..28c66a6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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: @@ -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: @@ -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: @@ -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 @@ -124,7 +124,7 @@ 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 @@ -132,7 +132,7 @@ 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 @@ -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 @@ -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 diff --git a/templates/theme/404.php b/templates/theme/404.php deleted file mode 100755 index 1464e52..0000000 --- a/templates/theme/404.php +++ /dev/null @@ -1,36 +0,0 @@ - - -
-

404

-

Page not found :(

-
-
-
-
-
-
-
-
-
-
- -
-
-

The requested page could not be found.

-

This happens when the page has been moved, removed, or had its name and address changed. It might otherwise be temporarily unavailable for technical reasons.

-
-
-
-
- -
-
-
-
- - -
- - diff --git a/templates/theme/archive.php b/templates/theme/archive.php deleted file mode 100755 index 5091324..0000000 --- a/templates/theme/archive.php +++ /dev/null @@ -1,24 +0,0 @@ - - -
-

-

Archives

-
- -
-
-
-
-
-
-
-
- -
- - -
- - diff --git a/templates/theme/category.php b/templates/theme/category.php deleted file mode 100755 index a5f5ce9..0000000 --- a/templates/theme/category.php +++ /dev/null @@ -1,24 +0,0 @@ - - -
-

-

Categories

-
- -
-
-
-
-
-
-
-
- -
- - -
- - diff --git a/templates/theme/comments.php b/templates/theme/comments.php deleted file mode 100755 index 4c0eeb3..0000000 --- a/templates/theme/comments.php +++ /dev/null @@ -1,56 +0,0 @@ - - -
- - -

- ' . get_the_title() . '' ); - ?> -

- -
    - 'ol', - 'short_ping' => true, - 'avatar_size' => 74, - ) ); - ?> -
- - 1 && get_option( 'page_comments' ) ) : - ?> - - - - -

- - - - - - -
diff --git a/templates/theme/footer.php b/templates/theme/footer.php deleted file mode 100755 index eb46737..0000000 --- a/templates/theme/footer.php +++ /dev/null @@ -1,45 +0,0 @@ -
-
-
-
-
-
- - - - - - - diff --git a/templates/theme/functions.php b/templates/theme/functions.php deleted file mode 100755 index 6a0f6fd..0000000 --- a/templates/theme/functions.php +++ /dev/null @@ -1,64 +0,0 @@ -'; -} -add_action('wp_head', 'centos_favicon'); - -/** - * CentOS Sidebar - */ -function centos_widgets_init() { - register_sidebar( array ( - 'name' => __('Primary Sidebar', 'centos'), - 'id' => 'sidebar-1', - 'before_widget' => '
', - 'after_widget' => '
', - 'before_title' => '
', - 'after_title' => '
', - )); -} -add_action('widgets_init', 'centos_widgets_init'); - -/** - * CentOS Navbar and Wordpress administration bar integration - * - * By default the admin bar consumes 32px height, always. This adds an extra - * space on top of the navigation bar which affects the CentOS navigation bar - * expected presentation. Here (and in header.php) we remove that space and fix - * the CentOS navigation bar presentation to deal with Wordpress admin bar - * based on whether the user is logged in or not. - */ -if (is_user_logged_in()) { - add_filter('show_admin_bar' , '__return_true'); -} else { - add_filter('show_admin_bar' , '__return_false'); -} - -/** - * CentOS Title - */ - -function centos_title() { - add_theme_support( 'title-tag' ); -} -add_action( 'after_setup_theme', 'centos_title' ); -?> diff --git a/templates/theme/header.php b/templates/theme/header.php deleted file mode 100755 index e22618d..0000000 --- a/templates/theme/header.php +++ /dev/null @@ -1,36 +0,0 @@ - -> - - - - - - - -