mirror of
https://gh.wpcy.net/https://github.com/Chassis/puppet-wp.git
synced 2026-05-06 18:37:47 +08:00
85 lines
21 KiB
HTML
85 lines
21 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en-US">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<title>Plugin | Puppet WP</title>
|
||
<meta name="description" content="This module enables the easy use of WP CLI to control your WordPress site through Puppet manifests. It provides an easy abstraction for common WP CLI commands as well as installing the WP CLI binaries as needed.">
|
||
|
||
|
||
<link rel="preload" href="/puppet-wp/assets/css/0.styles.3555fada.css" as="style"><link rel="preload" href="/puppet-wp/assets/js/app.fa6aeef6.js" as="script"><link rel="preload" href="/puppet-wp/assets/js/2.9c067755.js" as="script"><link rel="preload" href="/puppet-wp/assets/js/15.2d20c5af.js" as="script"><link rel="prefetch" href="/puppet-wp/assets/js/10.3ae47639.js"><link rel="prefetch" href="/puppet-wp/assets/js/11.8480f621.js"><link rel="prefetch" href="/puppet-wp/assets/js/12.01d6689e.js"><link rel="prefetch" href="/puppet-wp/assets/js/13.e9402967.js"><link rel="prefetch" href="/puppet-wp/assets/js/14.1e5c138a.js"><link rel="prefetch" href="/puppet-wp/assets/js/16.606b6d78.js"><link rel="prefetch" href="/puppet-wp/assets/js/17.125632f9.js"><link rel="prefetch" href="/puppet-wp/assets/js/18.33b23e9b.js"><link rel="prefetch" href="/puppet-wp/assets/js/19.b33e4957.js"><link rel="prefetch" href="/puppet-wp/assets/js/20.d44dba7e.js"><link rel="prefetch" href="/puppet-wp/assets/js/21.da1bc37d.js"><link rel="prefetch" href="/puppet-wp/assets/js/22.7925425c.js"><link rel="prefetch" href="/puppet-wp/assets/js/23.ed2e32a3.js"><link rel="prefetch" href="/puppet-wp/assets/js/24.b1665b07.js"><link rel="prefetch" href="/puppet-wp/assets/js/3.95ca6637.js"><link rel="prefetch" href="/puppet-wp/assets/js/4.acbad4b1.js"><link rel="prefetch" href="/puppet-wp/assets/js/5.afc655ad.js"><link rel="prefetch" href="/puppet-wp/assets/js/6.3c605811.js"><link rel="prefetch" href="/puppet-wp/assets/js/7.589df22e.js"><link rel="prefetch" href="/puppet-wp/assets/js/8.23fbfed4.js"><link rel="prefetch" href="/puppet-wp/assets/js/9.02ff3dc3.js">
|
||
<link rel="stylesheet" href="/puppet-wp/assets/css/0.styles.3555fada.css">
|
||
</head>
|
||
<body>
|
||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/puppet-wp/" class="home-link router-link-active"><!----> <span class="site-name">Puppet WP</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/puppet-wp/" class="nav-link">Home</a></div><div class="nav-item"><a href="/puppet-wp/installation/" class="nav-link">Installation</a></div><div class="nav-item"><a href="/puppet-wp/classes/" class="nav-link router-link-active">Classes</a></div> <a href="https://github.com/chassis/puppet-wp" target="_blank" rel="noopener noreferrer" class="repo-link">
|
||
GitHub
|
||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/puppet-wp/" class="nav-link">Home</a></div><div class="nav-item"><a href="/puppet-wp/installation/" class="nav-link">Installation</a></div><div class="nav-item"><a href="/puppet-wp/classes/" class="nav-link router-link-active">Classes</a></div> <a href="https://github.com/chassis/puppet-wp" target="_blank" rel="noopener noreferrer" class="repo-link">
|
||
GitHub
|
||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Installation</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/puppet-wp/installation/" class="sidebar-link">Installation</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Classes</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/puppet-wp/classes/cap.html" class="sidebar-link">Cap</a></li><li><a href="/puppet-wp/classes/cli.html" class="sidebar-link">CLI</a></li><li><a href="/puppet-wp/classes/command.html" class="sidebar-link">Command</a></li><li><a href="/puppet-wp/classes/comment.html" class="sidebar-link">Comment</a></li><li><a href="/puppet-wp/classes/config.html" class="sidebar-link">Config</a></li><li><a href="/puppet-wp/classes/core.html" class="sidebar-link">Core</a></li><li><a href="/puppet-wp/classes/option.html" class="sidebar-link">Option</a></li><li><a href="/puppet-wp/classes/params.html" class="sidebar-link">Params</a></li><li><a href="/puppet-wp/classes/plugin.html" class="active sidebar-link">Plugin</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/puppet-wp/classes/plugin.html#description" class="sidebar-link">Description</a></li><li class="sidebar-sub-header"><a href="/puppet-wp/classes/plugin.html#attributes" class="sidebar-link">Attributes</a></li></ul></li><li><a href="/puppet-wp/classes/rewrite.html" class="sidebar-link">Rewrite</a></li><li><a href="/puppet-wp/classes/role.html" class="sidebar-link">Role</a></li><li><a href="/puppet-wp/classes/theme.html" class="sidebar-link">Theme</a></li><li><a href="/puppet-wp/classes/user.html" class="sidebar-link">User</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Docs</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/puppet-wp/docs/" class="sidebar-link">Documentation</a></li><li><a href="/puppet-wp/docs/puppet-forge.html" class="sidebar-link">Puppet Forge</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Licence</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/puppet-wp/licence/" class="sidebar-link">Licence</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="plugin"><a href="#plugin" aria-hidden="true" class="header-anchor">#</a> Plugin</h1> <ul><li><a href="/puppet-wp/classes/plugin.html#description">Description</a></li> <li><a href="/puppet-wp/classes/plugin.html#attributes">Attributes</a></li></ul> <h2 id="description"><a href="#description" aria-hidden="true" class="header-anchor">#</a> Description</h2> <p>Manages plugins, including installs, activations, and updates.</p> <h2 id="attributes"><a href="#attributes" aria-hidden="true" class="header-anchor">#</a> Attributes</h2> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>plugin <span class="token punctuation">{</span> <span class="token string">'resource title'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token comment"># The location to run the command.</span>
|
||
<span class="token attr-name">slug</span> <span class="token operator">=></span> <span class="token comment"># The slug of the plugin in the WordPress repository.</span>
|
||
<span class="token attr-name">ensure</span> <span class="token operator">=></span> <span class="token comment"># What state the option should be in.</span>
|
||
<span class="token attr-name">networkwide</span> <span class="token operator">=></span> <span class="token comment"># Whether the state should be applied network wide.</span>
|
||
<span class="token attr-name">version</span> <span class="token operator">=></span> <span class="token comment"># The version of the plugin to install.</span>
|
||
<span class="token attr-name">all</span> <span class="token operator">=></span> <span class="token comment"># Set this to delete all plugins.</span>
|
||
<span class="token attr-name">skipdelete</span> <span class="token operator">=></span> <span class="token comment"># Only run the uninstall procedure.</span>
|
||
<span class="token attr-name">unless</span> <span class="token operator">=></span> <span class="token comment"># A test command that checks the state of the target system and restricts when the command can run.</span>
|
||
<span class="token attr-name">user</span> <span class="token operator">=></span> <span class="token comment"># The user to run the command as.</span>
|
||
<span class="token attr-name">onlyif</span> <span class="token operator">=></span> <span class="token comment"># A test command that checks the state of the target system and restricts when the command can run.</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div><h3 id="location"><a href="#location" aria-hidden="true" class="header-anchor">#</a> location</h3> <p>The directory from which to run the command. If this directory does not exist, the command will fail.</p> <h3 id="slug"><a href="#slug" aria-hidden="true" class="header-anchor">#</a> slug</h3> <p>(<em>If omitted, this attribute’s value defaults to the resource’s title.</em>)</p> <h3 id="ensure"><a href="#ensure" aria-hidden="true" class="header-anchor">#</a> ensure</h3> <p>(<em>If omitted, this attribute’s value defaults to <code>enabled</code>.</em>)</p> <p>Values: <code>activate</code>, <code>enabled</code>, <code>disabled</code>, <code>installed</code>, <code>deleted</code>, <code>uninstalled</code>.</p> <h3 id="networkwide"><a href="#networkwide" aria-hidden="true" class="header-anchor">#</a> networkwide</h3> <p>(<em>If omitted, this attribute’s value defaults to <code>false</code></em>)</p> <p>Values: <code>true</code>, <code>false</code></p> <h3 id="version"><a href="#version" aria-hidden="true" class="header-anchor">#</a> version</h3> <p>(<em>If omitted, this attribute’s value defaults to the latest version in the WordPress repository</em>)</p> <p>Values: <code>latest</code> or a version number e.g. <code>1.0.1</code>.</p> <h3 id="all"><a href="#all" aria-hidden="true" class="header-anchor">#</a> all</h3> <p>(<em>If omitted, this attribute’s value defaults to <code>''</code></em>)</p> <p>Values: <code>''</code> or <code>true</code>.</p> <h3 id="skipdelete"><a href="#skipdelete" aria-hidden="true" class="header-anchor">#</a> skipdelete</h3> <p>(<em>If omitted, this attribute’s value defaults to <code>''</code></em>)</p> <p>Values: <code>''</code> or <code>true</code>.</p> <h3 id="unless"><a href="#unless" aria-hidden="true" class="header-anchor">#</a> unless</h3> <p>(<em>If omitted, this attribute’s value defaults to <code>undef</code> which Puppet treats as <code>false</code>.</em>)</p> <p>A test command that checks the state of the target system and restricts when the command can run.</p> <h3 id="user"><a href="#user" aria-hidden="true" class="header-anchor">#</a> user</h3> <p>(<em>If omitted, this attribute’s value defaults to <code>www-data</code>.</em>)</p> <h3 id="onlyif"><a href="#onlyif" aria-hidden="true" class="header-anchor">#</a> onlyif</h3> <p>(<em>If omitted, this attribute’s value defaults to <code>/usr/local/bin/wp core is-installed</code>.</em>)</p> <p>You can pass one or more checks into Puppet for this. e.g.</p> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>command <span class="token punctuation">{</span> <span class="token string">'WP-CLI Info'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token string">'/vagrant'</span>
|
||
<span class="token attr-name">command</span> <span class="token operator">=></span> <span class="token string">'--info'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">onlyif</span> <span class="token operator">=></span> <span class="token punctuation">[</span>
|
||
<span class="token string">'/usr/local/bin/wp core is-installed'</span><span class="token punctuation">,</span>
|
||
<span class="token string">'/usr/local/bin/wp theme is-active twentynineteen'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">]</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div><h4 id="examples"><a href="#examples" aria-hidden="true" class="header-anchor">#</a> Examples</h4> <p>Install and activate Yoast SEO.</p> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>plugin <span class="token punctuation">{</span> <span class="token string">'Install and activate Yoast SEO'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token string">'/vagrant'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">slug</span> <span class="token operator">=></span> <span class="token string">'wordpress-seo'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">ensure</span> <span class="token operator">=></span> <span class="token string">'enabled'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div><p>Install and activate Yoast SEO Network Wide.</p> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>plugin <span class="token punctuation">{</span> <span class="token string">'Install and activate Yoast SEO'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token string">'/vagrant'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">slug</span> <span class="token operator">=></span> <span class="token string">'wordpress-seo'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">ensure</span> <span class="token operator">=></span> <span class="token string">'enabled'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">networkwide</span> <span class="token operator">=></span> <span class="token string">'true'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div><p>Install Yoast SEO.</p> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>plugin <span class="token punctuation">{</span> <span class="token string">'Install Yoast SEO'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token string">'/vagrant'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">slug</span> <span class="token operator">=></span> <span class="token string">'wordpress-seo'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">ensure</span> <span class="token operator">=></span> <span class="token string">'installed'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div><p>Activate Yoast SEO.</p> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>plugin <span class="token punctuation">{</span> <span class="token string">'Activate Yoast SEO'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token string">'/vagrant'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">slug</span> <span class="token operator">=></span> <span class="token string">'wordpress-seo'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">ensure</span> <span class="token operator">=></span> <span class="token string">'activate'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div><p>Delete Hello Dolly.</p> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>plugin <span class="token punctuation">{</span> <span class="token string">'Delete Hello Dolly'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token string">'/vagrant'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">slug</span> <span class="token operator">=></span> <span class="token string">'hello-dolly'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">ensure</span> <span class="token operator">=></span> <span class="token string">'deleted'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div><p>Deactivate Hello Dolly.</p> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>plugin <span class="token punctuation">{</span> <span class="token string">'Deactivate Hello Dolly'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token string">'/vagrant'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">slug</span> <span class="token operator">=></span> <span class="token string">'hello-dolly'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">ensure</span> <span class="token operator">=></span> <span class="token string">'disabled'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div><p>Uninstall Hello Dolly.</p> <div class="language-puppet extra-class"><pre class="language-puppet"><code> wp<span class="token punctuation">::</span>plugin <span class="token punctuation">{</span> <span class="token string">'Uninstall Hello Dolly'</span><span class="token punctuation">:</span>
|
||
<span class="token attr-name">location</span> <span class="token operator">=></span> <span class="token string">'/vagrant'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">slug</span> <span class="token operator">=></span> <span class="token string">'hello-dolly'</span><span class="token punctuation">,</span>
|
||
<span class="token attr-name">ensure</span> <span class="token operator">=></span> <span class="token string">'uninstalled'</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span>
|
||
</code></pre></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/chassis/puppet-wp/edit/master/classes/plugin.md" target="_blank" rel="noopener noreferrer">Suggest an edit!</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">9/13/2019, 8:03:39 AM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||
←
|
||
<a href="/puppet-wp/classes/params.html" class="prev">
|
||
Params
|
||
</a></span> <span class="next"><a href="/puppet-wp/classes/rewrite.html">
|
||
Rewrite
|
||
</a>
|
||
→
|
||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||
<script src="/puppet-wp/assets/js/app.fa6aeef6.js" defer></script><script src="/puppet-wp/assets/js/2.9c067755.js" defer></script><script src="/puppet-wp/assets/js/15.2d20c5af.js" defer></script>
|
||
</body>
|
||
</html>
|