| 776 |
lars |
1 |
<!doctype html>
|
|
|
2 |
<title>CodeMirror: Puppet mode</title>
|
|
|
3 |
<meta charset="utf-8" />
|
|
|
4 |
<link rel=stylesheet href="../../doc/docs.css">
|
|
|
5 |
<link rel="stylesheet" href="../../lib/codemirror.css">
|
|
|
6 |
<script src="../../lib/codemirror.js"></script>
|
|
|
7 |
<script src="../../addon/edit/matchbrackets.js"></script>
|
|
|
8 |
<script src="puppet.js"></script>
|
|
|
9 |
<style>
|
|
|
10 |
.CodeMirror {
|
|
|
11 |
border-top: 1px solid black;
|
|
|
12 |
border-bottom: 1px solid black;
|
|
|
13 |
}
|
|
|
14 |
|
|
|
15 |
.cm-s-default span.cm-arrow {
|
|
|
16 |
color: red;
|
|
|
17 |
}
|
|
|
18 |
</style>
|
|
|
19 |
<div id=nav>
|
|
|
20 |
<a href="http://codemirror.net">
|
|
|
21 |
<h1>CodeMirror</h1>
|
|
|
22 |
<img id=logo src="../../doc/logo.png">
|
|
|
23 |
</a>
|
|
|
24 |
<ul>
|
|
|
25 |
<li>
|
|
|
26 |
<a href="../../index.html">Home</a>
|
|
|
27 |
<li>
|
|
|
28 |
<a href="../../doc/manual.html">Manual</a>
|
|
|
29 |
<li>
|
|
|
30 |
<a href="https://github.com/codemirror/codemirror">Code</a>
|
|
|
31 |
</ul>
|
|
|
32 |
<ul>
|
|
|
33 |
<li>
|
|
|
34 |
<a href="../index.html">Language modes</a>
|
|
|
35 |
<li>
|
|
|
36 |
<a class=active href="#">Puppet</a>
|
|
|
37 |
</ul>
|
|
|
38 |
</div>
|
|
|
39 |
<article>
|
|
|
40 |
<h2>Puppet mode</h2>
|
|
|
41 |
<form>
|
|
|
42 |
<textarea id="code" name="code"> # == Class: automysqlbackup # # Puppet module to install AutoMySQLBackup for periodic MySQL backups. # # class { 'automysqlbackup': # backup_dir => '/mnt/backups', # } # class automysqlbackup ( $bin_dir = $automysqlbackup::params::bin_dir, $etc_dir
|
|
|
43 |
= $automysqlbackup::params::etc_dir, $backup_dir = $automysqlbackup::params::backup_dir, $install_multicore = undef, $config = {}, $config_defaults = {}, ) inherits automysqlbackup::params { # Ensure valid paths are assigned validate_absolute_path($bin_dir)
|
|
|
44 |
validate_absolute_path($etc_dir) validate_absolute_path($backup_dir) # Create a subdirectory in /etc for config files file { $etc_dir: ensure => directory, owner => 'root', group => 'root', mode => '0750', } # Create an example backup file,
|
|
|
45 |
useful for reference file { "${etc_dir}/automysqlbackup.conf.example": ensure => file, owner => 'root', group => 'root', mode => '0660', source => 'puppet:///modules/automysqlbackup/automysqlbackup.conf', } # Add files from the developer file
|
|
|
46 |
{ "${etc_dir}/AMB_README": ensure => file, source => 'puppet:///modules/automysqlbackup/AMB_README', } file { "${etc_dir}/AMB_LICENSE": ensure => file, source => 'puppet:///modules/automysqlbackup/AMB_LICENSE', } # Install the actual binary
|
|
|
47 |
file file { "${bin_dir}/automysqlbackup": ensure => file, owner => 'root', group => 'root', mode => '0755', source => 'puppet:///modules/automysqlbackup/automysqlbackup', } # Create the base backup directory file { $backup_dir: ensure => directory,
|
|
|
48 |
owner => 'root', group => 'root', mode => '0755', } # If you'd like to keep your config in hiera and pass it to this class if !empty($config) { create_resources('automysqlbackup::backup', $config, $config_defaults) } # If using RedHat family,
|
|
|
49 |
must have the RPMforge repo's enabled if $install_multicore { package { ['pigz', 'pbzip2']: ensure => installed } } } </textarea>
|
|
|
50 |
</form>
|
|
|
51 |
<script>
|
|
|
52 |
var editor = CodeMirror.fromTextArea(document.getElementById("code"),
|
|
|
53 |
{
|
|
|
54 |
mode: "text/x-puppet",
|
|
|
55 |
matchBrackets: true,
|
|
|
56 |
indentUnit: 4
|
|
|
57 |
});
|
|
|
58 |
</script>
|
|
|
59 |
<p>
|
|
|
60 |
<strong>MIME types defined:</strong> <code>text/x-puppet</code>.</p>
|
|
|
61 |
</article>
|