Skip to content

Latest commit

 

History

History
185 lines (127 loc) · 6.08 KB

REFERENCE.md

File metadata and controls

185 lines (127 loc) · 6.08 KB

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  => '[email protected]',
      }
    }
  }

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.