wordpress

Install and configure WordPress with WP-CLI tool.

14,090 downloads

5,138 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 3.1.0 (latest)
  • 3.0.0
  • 2.0.0
  • 1.3.5
  • 1.3.4
  • 1.3.3
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.0
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Dec 31st 2018
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
  • Puppet >= 5.0.0 < 7.0.0
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'adullact-wordpress', '2.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add adullact-wordpress
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install adullact-wordpress --version 2.0.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

adullact/wordpress — version 2.0.0 Dec 31st 2018

Reference

Table of Contents

Classes

Public Classes

  • wordpress: Install WP-CLI tool, use it to download wordpress core, create tables in database, configure WordPress and manage plugins and themes.
  • wordpress::params: Sets defaults values for some variables and parameters.

Private Classes

  • wordpress::cli: Install lastest WP-CLI tool.
  • wordpress::core: Use WP-CLI to download last version of WordPress core, create tables in database and configure WordPress.
  • wordpress::external_fact: Deploy files to forge an external fact named 'wordpress'
  • wordpress::resource: download and manage resources aka plugins and themes.
  • wordpress::site: Use WP-CLI to download last version of WordPress core, create tables in database and configure WordPress.

Defined types

Public Defined types

Private Defined types

  • wordpress::config::admin: Configure settings (name password and email) of one user in the desired state.
  • wordpress::config::option: Configure an option in the desired state
  • wordpress::core::config: configure WordPress instance.
  • wordpress::core::install: Downloads and installs WordPress core and language.
  • wordpress::core::update: Backup and update WordPress core and language.
  • wordpress::resource::activate: Activates an already installed resource aka plugin or theme.
  • wordpress::resource::install: Downloads and installs a resource aka plugin or theme.
  • wordpress::resource::uninstall: Uninstall an already installed resource aka plugin or theme.
  • wordpress::resource::update: Updates an already installed resource aka plugin or theme.

Functions

Classes

wordpress

Install WP-CLI tool, use it to download wordpress core, create tables in database, configure WordPress and manage plugins and themes.

Examples

Configure one WordPress instance for URL wordpress.foo.org by using already existing database server and database account and web server with vhost root '/var/www/wordpress.foo.org'.

  class { 'wordpress':
    settings => {
      'wordpress.foo.org' => {
        owner         => 'wp',
        dbhost        => 'XX.XX.XX.XX',
        dbname        => 'wordpress',
        dbuser        => 'wpuserdb',
        dbpasswd      => 'kiki',
        wproot        => '/var/www/wordpress.foo.org',
        wptitle       => 'hola this wordpress instance is installed by puppet',
        wpadminuser   => 'wpadmin',
        wpadminpasswd => 'lolo',
        wpadminemail  => 'bar@foo.org',
      }
    }
  }

Bellow the datatype of `$settings`. Parameters without a default value are mandatory unless otherwise stated.

  Hash[
    String,                  # The URI of the WordPress instance (like : www.foo.org).
    Hash[
      Enum[
        'ensure',            # Possible values : present, absent, lastest (defaults present).
        'wproot',            # Path where is located root of WordPress instance.
        'owner',             # User that own files of WordPress instance.
        'locale',            # Language used by WordPress instance (defaults en_US).
        'dbhost',            # Address of the database server (must be MySQL or MariaDB).
        'dbname',            # Name of the database where tables of WordPress instance are stored.
        'dbuser',            # User of the database used by wordpress to connect to the database server.
        'dbpasswd',          # Password of the user of the database.
        'dbprefix',          # Set table prefix (defaults wp<random_number_with_4_digits>).
        'wpselfupdate',      # Possible values : disabled , enabled (defaults disabled).
        'wptitle',           # Init title of the WordPress instance.
        'wpadminuser',       # Name of admin account of the WordPress instance.
        'wpadminpasswd',     # Password of the admin account of the WordPress instance.
        'wpadminemail',      # email address of the admin account.
        'wpresources',       # Settings for plugins and themes (not mandatory).
      ],
      Variant[
        String,
        Hash[
          Enum[
            'plugin',
            'theme',
          ],
          Array[
            Hash[
              Enum[
                'name',      # Name of the plugin or theme
                'ensure',    # Possible values : present, absent, latest (defaults present).
              ],
              String
              ]
            ]
          ]
        ]
      ]
    ]

Parameters

The following parameters are available in the wordpress class.

settings

Data type: Hash

Describes all availables settings in this module for all wordpress instances on this node. Defaults to empty hash.

Default value: {}

wparchives_path

Data type: Pattern['^/']

Gives the path where are stored archives done before update managed by puppet (not by WordPress itself with wpselfupdate). Defaults to /var/wordpress_archives.

Default value: $wordpress::params::default_wparchives_path

wpcli_url

Data type: Pattern['^http']

Gives the address from which to download the WP-CLI tool. Defaults to 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar'.

Default value: $wordpress::params::default_wpcli_url

wpcli_bin

Data type: Pattern['^/']

Gives the path where the WP-CLI tools is deployed. Defaults to '/usr/local/bin/wp'.

Default value: $wordpress::params::default_wpcli_bin

hour_fact_update

Data type: Integer[1,23]

Gives the time (hour between 1 and 23) at which the update of external fact is done. Defaults to 7.

Default value: $wordpress::params::default_hour_fact_update

wordpress::params

Sets defaults values for some variables and parameters.

Defined types

Functions

wordpress::password_hash

Type: Ruby 4.x API

Hash a string

wordpress::password_hash(String $password)

The wordpress::password_hash function.

Returns: String the password hash from the clear text password.

password

Data type: String

Plain text password.