|
| 1 | +# Puppet module: apache |
| 2 | + |
| 3 | +This is a Puppet apache module from the second generation of Example42 Puppet Modules. |
| 4 | + |
| 5 | +Made by Alessandro Franceschi / Lab42 |
| 6 | + |
| 7 | +Official site: http://www.example42.com |
| 8 | + |
| 9 | +Official git repository: http://github.com/example42/puppet-apache |
| 10 | + |
| 11 | +Released under the terms of Apache 2 License. |
| 12 | + |
| 13 | +This module requires functions provided by the Example42 Puppi module. |
| 14 | + |
| 15 | +For detailed info about the logic and usage patterns of Example42 modules read README.usage on Example42 main modules set. |
| 16 | + |
| 17 | +## USAGE - Module specific usage |
| 18 | + |
| 19 | +* Install apache with a custom httpd.conf template and some virtual hosts |
| 20 | + |
| 21 | + class { 'apache': |
| 22 | + template => 'example42/apache/httpd.conf.erb', |
| 23 | + } |
| 24 | + |
| 25 | + apache::vhost { 'mysite': |
| 26 | + docroot => '/path/to/docroot', |
| 27 | + template => 'example42/apache/vhost/mysite.com.erb', |
| 28 | + } |
| 29 | + |
| 30 | +## USAGE - Basic management |
| 31 | + |
| 32 | +* Install apache with default settings |
| 33 | + |
| 34 | + class { "apache": } |
| 35 | + |
| 36 | +* Disable apache service. |
| 37 | + |
| 38 | + class { "apache": |
| 39 | + disable => true |
| 40 | + } |
| 41 | + |
| 42 | +* Disable apache service at boot time, but don't stop if is running. |
| 43 | + |
| 44 | + class { "apache": |
| 45 | + disableboot => true |
| 46 | + } |
| 47 | + |
| 48 | +* Remove apache package |
| 49 | + |
| 50 | + class { "apache": |
| 51 | + absent => true |
| 52 | + } |
| 53 | + |
| 54 | +* Enable auditing without without making changes on existing apache configuration files |
| 55 | + |
| 56 | + class { "apache": |
| 57 | + audit_only => true |
| 58 | + } |
| 59 | + |
| 60 | +* Install apache with a specific version |
| 61 | + |
| 62 | + class { "apache": |
| 63 | + version => '2.2.22' |
| 64 | + } |
| 65 | + |
| 66 | + |
| 67 | +## USAGE - Default server management |
| 68 | +* Simple way to manage default apache configuration |
| 69 | + |
| 70 | + apache::vhost { 'default': |
| 71 | + docroot => '/var/www/document_root', |
| 72 | + server_name => false, |
| 73 | + priority => '', |
| 74 | + template => 'apache/virtualhost/vhost.conf.erb', |
| 75 | + } |
| 76 | + |
| 77 | + |
| 78 | +## USAGE - Overrides and Customizations |
| 79 | +* Use custom sources for main config file |
| 80 | + |
| 81 | + class { "apache": |
| 82 | + source => [ "puppet:///modules/lab42/apache/apache.conf-${hostname}" , "puppet:///modules/lab42/apache/apache.conf" ], |
| 83 | + } |
| 84 | + |
| 85 | + |
| 86 | +* Use custom source directory for the whole configuration dir |
| 87 | + |
| 88 | + class { "apache": |
| 89 | + source_dir => "puppet:///modules/lab42/apache/conf/", |
| 90 | + source_dir_purge => false, # Set to true to purge any existing file not present in $source_dir |
| 91 | + } |
| 92 | + |
| 93 | +* Use custom template for main config file |
| 94 | + |
| 95 | + class { "apache": |
| 96 | + template => "example42/apache/apache.conf.erb", |
| 97 | + } |
| 98 | + |
| 99 | +* Define custom options that can be used in a custom template without the |
| 100 | + need to add parameters to the apache class |
| 101 | + |
| 102 | + class { "apache": |
| 103 | + template => "example42/apache/apache.conf.erb", |
| 104 | + options => { |
| 105 | + 'LogLevel' => 'INFO', |
| 106 | + 'UsePAM' => 'yes', |
| 107 | + }, |
| 108 | + } |
| 109 | + |
| 110 | +* Automaticallly include a custom subclass |
| 111 | + |
| 112 | + class { "apache:" |
| 113 | + my_class => 'apache::example42', |
| 114 | + } |
| 115 | + |
| 116 | + |
| 117 | +## USAGE - Example42 extensions management |
| 118 | +* Activate puppi (recommended, but disabled by default) |
| 119 | + Note that this option requires the usage of Example42 puppi module |
| 120 | + |
| 121 | + class { "apache": |
| 122 | + puppi => true, |
| 123 | + } |
| 124 | + |
| 125 | +* Activate puppi and use a custom puppi_helper template (to be provided separately with |
| 126 | + a puppi::helper define ) to customize the output of puppi commands |
| 127 | + |
| 128 | + class { "apache": |
| 129 | + puppi => true, |
| 130 | + puppi_helper => "myhelper", |
| 131 | + } |
| 132 | + |
| 133 | +* Activate automatic monitoring (recommended, but disabled by default) |
| 134 | + This option requires the usage of Example42 monitor and relevant monitor tools modules |
| 135 | + |
| 136 | + class { "apache": |
| 137 | + monitor => true, |
| 138 | + monitor_tool => [ "nagios" , "monit" , "munin" ], |
| 139 | + } |
| 140 | + |
| 141 | +* Activate automatic firewalling |
| 142 | + This option requires the usage of Example42 firewall and relevant firewall tools modules |
| 143 | + |
| 144 | + class { "apache": |
| 145 | + firewall => true, |
| 146 | + firewall_tool => "iptables", |
| 147 | + firewall_src => "10.42.0.0/24", |
| 148 | + firewall_dst => "$ipaddress_eth0", |
| 149 | + } |
| 150 | + |
| 151 | + |
| 152 | +[](https://travis-ci.org/example42/puppet-apache) |
0 commit comments