Ansible Role linuxfabrik.lfops.grav¶
This role installs Grav (a simple file-based flat-file CMS platform) using PHP composer. For keeping Grav, Plugins and Themes up to date the role configures the Grav Package Manager (GPM).
It is possible to configure whether the Grav Admin Panel should be installed (it is installed by default). By default, you can access the admin by pointing your browser to http://grav.example.com/admin. You can simply log in with the username and password set in the role variables.
Mandatory Requirements¶
- Install a web server (for example Apache httpd), and configure a virtual host for Grav. This can be done using the linuxfabrik.lfops.apache_httpd role.
- Install PHP 7.3.6+ (PHP 8.1 recommended (20220930)). This can be done using the linuxfabrik.lfops.repo_remi and linuxfabrik.lfops.php role.
If you use the "Grav" Playbook, this is automatically done for you.
Tags¶
grav
- Install unzip.
- Test if Grav is already installed.
composer create-project getgrav/grav {{ grav__install_dir }}.chown -R apache:apache {{ grav__install_dir }}.find {{ grav__install_dir }} -type f -exec chmod --changes 664 {} \;.find {{ grav__install_dir }}/bin -type f -exec chmod --changes 775 {} \;.find {{ grav__install_dir }} -type d -exec chmod --changes 775 {} \;.find {{ grav__install_dir }} -type d -exec chmod --changes +s {} \;.- Deploy
/etc/systemd/system/grav-selfupgrade.service. - Deploy
/etc/systemd/system/grav-selfupgrade.timer. - Deploy
/etc/systemd/system/grav-update.service. - Deploy
/etc/systemd/system/grav-update.timer. systemctl enable/disable grav-selfupgrade.timer --now.systemctl enable/disable grav-update.timer --now.- Install the Administration Panel plugin for Grav.
- Create Grav User Accounts.
- Triggers: none.
grav:cron
- Deploy
/etc/systemd/system/grav-selfupgrade.service. - Deploy
/etc/systemd/system/grav-selfupgrade.timer. - Deploy
/etc/systemd/system/grav-update.service. - Deploy
/etc/systemd/system/grav-update.timer. systemctl enable/disable grav-selfupgrade.timer --now.systemctl enable/disable grav-update.timer --now.- Triggers: none.
grav:state
systemctl enable/disable grav-selfupgrade.timer --now.systemctl enable/disable grav-update.timer --now.- Triggers: none.
grav:user
- Install the Administration Panel plugin for Grav.
- Create Grav User Accounts.
- Triggers: none.
Mandatory Role Variables¶
grav__url
- The Grav URL, without
http://orhttps://. - Type: String.
grav__users
- Mandatory if using the Grav Admin Panel. Have a look at the example below for defining a user. The
permissionskey can be eitherafor Admin access only,sfor Site access only andbfor both Admin and Site access. - Type: List of dictionaries.
Example:
# mandatory
grav__url: 'grav.example.com'
grav__users:
- user: 'firstname_lastname'
fullname: 'Firstname Lastname'
password: 'linuxfabrik'
email: 'firstname.lastname@example.com'
permissions: 'b'
Optional Role Variables¶
grav__install_dir
- Grav installation directory.
- Type: String.
- Default:
'/var/www/html/{{ grav__url }}'
grav__on_calendar_selfupgrade
- Time to upgrading Grav CMS (Systemd-Timer notation).
- Type: String.
- Default:
'22:{{ 59 | random(seed=inventory_hostname) }}'
grav__on_calendar_update
- Time to update Grav Plugins and Themes (Systemd-Timer notation).
- Type: String.
- Default:
'23:{{ 59 | random(seed=inventory_hostname) }}'
grav__skip_admin
- If set to
true, installation of the Admin Panel plugin will be skipped. - Type: Bool.
- Default:
false
grav__timer_selfupgrade_enabled
- Enables/disables Systemd-Timer for upgrading Grav CMS.
- Type: Bool.
- Default:
true
grav__timer_update_enabled
- Enables/disables Systemd-Timer for updating Grav Plugins and Themes.
- Type: Bool.
- Default:
true
Known Limitations¶
There might be more to implement:
- https://learn.getgrav.org/17/security/configuration