|
1 |
| -Puppet-OpenShift |
2 |
| -================ |
| 1 | +# puppet-openshift_origin |
3 | 2 |
|
4 |
| -This Puppet module will assist with the creation of OpenShift nodes. The configuration |
5 |
| -represented here has been taken from the [OpenShift Build-Your-Own PaaS instructions](https://openshift.redhat.com/community/wiki/build-your-own). Note that, like the instructions, this module only works on RHEL/CentOS 6. Tested with CentOS 6.3. |
| 3 | +Author: Jamey Owens |
| 4 | +Author: Ben Klang |
| 5 | +Author: Ben Langfeld |
| 6 | +Author: Krishna Raman |
6 | 7 |
|
| 8 | +# About |
7 | 9 |
|
8 |
| -How To Use |
9 |
| -========== |
| 10 | +This module helps install [OpenShift Origin](https://openshift.redhat.com/community/open-source) Platform As A Service. |
| 11 | +Through the declaration of the `openshift_origin` class, you can configure the OpenShift Origin Broker, Node and support |
| 12 | +services including ActiveMQ, Qpid, MongoDB, named and OS settings including firewall, startup services, and ntp. |
10 | 13 |
|
11 |
| -An example broker.pp: |
| 14 | +# Requirements |
12 | 15 |
|
13 |
| -```Puppet |
14 |
| -include openshift |
15 |
| -class { "openshift::broker": |
16 |
| - domain => "example.com", |
17 |
| - password => "badpassword", |
18 |
| -} |
19 |
| -``` |
| 16 | +* Puppet >= 2.7 |
| 17 | +* Facter >= 1.6.17 |
| 18 | +* Puppetlabs/stdlib module. Can be obtained |
| 19 | + [here](http://forge.puppetlabs.com/puppetlabs/stdlib) or with the command |
| 20 | + `puppet module install puppetlabs/stdlib` |
| 21 | +* Puppetlabs/ntp module. Can be obtained |
| 22 | + [here](http://forge.puppetlabs.com/puppetlabs/ntp) or with the command |
| 23 | + `puppet module install puppetlabs/ntp` |
20 | 24 |
|
21 |
| -An example node.pp: |
| 25 | +# Installation |
22 | 26 |
|
23 |
| -```Puppet |
24 |
| -include openshift |
25 |
| -class { "openshift::node": |
26 |
| - domain => "example.com", |
27 |
| -} |
28 |
| -``` |
| 27 | +The module can be obtained from the |
| 28 | +[github repository](https://github.com/kraman/puppet-openshift_origin). |
29 | 29 |
|
30 |
| -Developer Workstation |
31 |
| -===================== |
| 30 | +1. Download the [Zip file from github](https://github.com/kraman/puppet-openshift_origin/archive/master.zip) |
| 31 | +1. Upload the Zip file to your Puppet Master. |
| 32 | +1. Unzip the file. This will create a new directory called puppet-openshift_origin-<commit hash> |
| 33 | +1. Rename this directory to just `openshift_origin` and place it in your |
| 34 | + [modulepath](http://docs.puppetlabs.com/learning/modules1.html#modules). |
32 | 35 |
|
33 |
| -Create a User Account |
34 |
| ---------------------- |
35 |
| -User accounts are managed via htpasswd authentication on the broker machine. |
36 |
| -Updating the htpasswd setup for openshift is done by running the htpasswd |
37 |
| -command. |
| 36 | +# Configuration |
38 | 37 |
|
39 |
| -```htpasswd /etc/openshift/htpasswd username on the broker.``` |
| 38 | +There is one class (`openshift_origin`) that needs to be declared on all nodes managing |
| 39 | +any component of OpenShift Origin. These nodes are configured using the parameters of |
| 40 | +this class. |
40 | 41 |
|
41 |
| -Install the RHC Client |
42 |
| ----------------------- |
| 42 | +## Using Parameterized Classes |
43 | 43 |
|
44 |
| -Instructions on installing rhc for various platforms is available at |
45 |
| - https://openshift.redhat.com/community/developers/install-the-client-tools |
| 44 | +[Using Parameterized Classes](http://docs.puppetlabs.com/guides/parameterized_classes.html) |
46 | 45 |
|
47 |
| -In order to use the rhc client with a local openshift installation, it is |
48 |
| -necessary to update the LIBRA_SERVER environment variable. |
| 46 | +Declaration example: |
49 | 47 |
|
50 |
| -``` |
51 |
| -export LIBRA_SERVER=broker.example.com |
| 48 | +```puppet |
| 49 | + class { 'openshift_origin': |
| 50 | + configure_ntp => true, |
| 51 | + configure_activemq => true, |
| 52 | + configure_qpid => false, |
| 53 | + configure_mongodb => true, |
| 54 | + configure_named => true, |
| 55 | + configure_broker => true, |
| 56 | + configure_node => true, |
| 57 | + } |
52 | 58 | ```
|
53 | 59 |
|
54 |
| -Client Tools |
55 |
| -============ |
| 60 | +## Parameters |
56 | 61 |
|
57 |
| -If you are running RHEL/CentOS, the client tools can be installed and |
58 |
| -used for diagnostics against the openshift setup. The configuration steps for |
59 |
| -the repo are available below. These are installed by default on the broker |
60 |
| -and node machines by the openshift module. |
| 62 | +The following lists all the class parameters the `openshift_origin` class accepts. |
61 | 63 |
|
62 |
| -1. Create the following file: |
| 64 | +### create_origin_yum_repos |
63 | 65 |
|
64 |
| -``` |
65 |
| -/etc/yum.repos.d/openshift-client.repo |
66 |
| -``` |
| 66 | +True if OpenShift Origin dependencies and OpenShift Origin nightly yum repositories should be created on this node. |
| 67 | + |
| 68 | +### install_client_tools |
| 69 | + |
| 70 | +True if OpenShift Client tools be installed on this node. |
| 71 | + |
| 72 | +### enable_network_services |
| 73 | + |
| 74 | +True if all support services be enabled. False if they are enabled by other classes in your recipe. |
| 75 | + |
| 76 | +### configure_firewall |
| 77 | + |
| 78 | +True if firewall should be configured for this node (Will blow away any existing configuration) |
| 79 | + |
| 80 | +### configure_ntp |
| 81 | + |
| 82 | +True if NTP should be configured on this node. False if ntp is configured by other classes in your recipe. |
| 83 | + |
| 84 | +### configure_activemq |
| 85 | + |
| 86 | +True if ActiveMQ should be installed and configured on this node (Used by m-collective) |
| 87 | + |
| 88 | +### configure_qpid |
| 89 | + |
| 90 | +True if Qpid message broker should be installed and configured on this node. (Optionally, used by m-collective. Replaced ActiveMQ) |
| 91 | + |
| 92 | +### configure_mongodb |
| 93 | + |
| 94 | +True if Mongo DB should be installed and configured on this node. |
| 95 | + |
| 96 | +### configure_named |
| 97 | + |
| 98 | +True if a Bind server should be configured and run on this node. |
| 99 | + |
| 100 | +### configure_broker |
| 101 | + |
| 102 | +True if an OpenShift Origin broker should be installed and configured on this node. |
| 103 | + |
| 104 | +### configure_node |
| 105 | + |
| 106 | +True if an OpenShift Origin node should be installed and configured on this node. |
| 107 | + |
| 108 | +### named_ipaddress |
| 109 | + |
| 110 | +IP Address of DNS Bind server (If running on a different node) |
| 111 | + |
| 112 | +### mongodb_fqdn |
| 113 | + |
| 114 | +FQDN of node running the MongoDB server (If running on a different node) |
| 115 | + |
| 116 | +### mq_fqdn |
| 117 | + |
| 118 | +FQDN of node running the message queue (ActiveMQ or Qpid) server (If running on a different node) |
| 119 | + |
| 120 | +### broker_fqdn |
| 121 | + |
| 122 | +FQDN of node running the OpenShift OpenShift broker server (If running on a different node) |
| 123 | + |
| 124 | +### cloud_domain |
| 125 | + |
| 126 | +DNS suffix for applications running on this PaaS. |
| 127 | +Eg. cloud.example.com |
| 128 | + Applications will be <app>-<namespace>.cloud.example.com |
| 129 | + |
| 130 | +### configure_fs_quotas |
| 131 | + |
| 132 | +Enables quotas on the local node. Applicable only to OpenShift OpenShift Nodes. |
| 133 | +If this setting is set to false, it is expected that Quotas are configured elsewhere in the |
| 134 | +Puppet recipe |
| 135 | + |
| 136 | +### oo_device |
| 137 | + |
| 138 | +Device on which gears are stored (/var/lib/openshift) |
67 | 139 |
|
68 |
| -2. Add the following content: |
| 140 | +### oo_mount |
| 141 | + |
| 142 | +Base mount point for /var/lib/openshift directory |
| 143 | + |
| 144 | +### configure_cgroups |
| 145 | + |
| 146 | +Enables cgoups on the local node. Applicable only to OpenShift OpenShift Nodes. |
| 147 | +If this setting is set to false, it is expected that cgroups are configured elsewhere in the |
| 148 | +Puppet recipe |
| 149 | + |
| 150 | +### configure_pam |
| 151 | + |
| 152 | +Updates PAM settings on the local node to secure gear logins. Applicable only to |
| 153 | +OpenShift OpenShift Nodes. If this setting is set to false, it is expected that |
| 154 | +cgroups are configured elsewhere in the Puppet recipe |
| 155 | + |
| 156 | +### broker_auth_plugin |
| 157 | + |
| 158 | +The authentication plugin to use with the OpenShift OpenShift Broker. Supported |
| 159 | +values are 'mongo' and 'basic-auth' |
| 160 | + |
| 161 | +### broker_auth_pub_key |
| 162 | + |
| 163 | +Public key used to authenticate communication between node and broker. If left blank, |
| 164 | +this file is auto generated. |
| 165 | + |
| 166 | +### broker_auth_priv_key |
| 167 | + |
| 168 | +Private key used to authenticate communication between node and broker. If |
| 169 | +`broker_auth_pub_key` is left blank, this file is auto generated. |
| 170 | + |
| 171 | +### broker_auth_key_password |
| 172 | + |
| 173 | +Password for `broker_auth_priv_key` private key |
| 174 | + |
| 175 | +### broker_auth_salt |
| 176 | + |
| 177 | +Salt used to generate authentication tokens for communication between node and broker. |
| 178 | + |
| 179 | +### broker_rsync_key |
| 180 | + |
| 181 | +TODO |
| 182 | + |
| 183 | +### mq_provider |
| 184 | + |
| 185 | +Message queue plugin to configure for mcollecitve. Defaults to 'activemq' |
| 186 | +Acceptable values are 'activemq', 'stomp' and 'qpid' |
| 187 | + |
| 188 | +### mq_server_user |
| 189 | + |
| 190 | +User to authenticate against message queue server |
| 191 | + |
| 192 | +### mq_server_password |
| 193 | + |
| 194 | +Password to authenticate against message queue server |
| 195 | + |
| 196 | +### mongo_auth_user |
| 197 | + |
| 198 | +User to authenticate against Mongo DB server |
| 199 | + |
| 200 | +### mongo_auth_password |
| 201 | + |
| 202 | +Password to authenticate against Mongo DB server |
| 203 | + |
| 204 | +### mongo_db_name |
| 205 | + |
| 206 | +name of the MongoDB database |
| 207 | + |
| 208 | +### named_tsig_priv_key |
| 209 | + |
| 210 | +TSIG signature to authenticate against the Bind DNS server. |
| 211 | + |
| 212 | +### update_network_dns_servers |
| 213 | + |
| 214 | +True if Bind DNS server specified in `named_ipaddress` should be added as first DNS server |
| 215 | +for application name resolution. |
| 216 | + |
| 217 | +Known Issues |
| 218 | +============ |
| 219 | + |
| 220 | +## Ruby |
| 221 | + |
| 222 | +The ruby runtime currently distributed with Fedora 17 (1.9.3.362-24.fc17) has some issues which causes |
| 223 | +mcollective to arbitrarily disconnect from the message queue server. |
| 224 | + |
| 225 | +Please update the ruby runtime from `updates-testing` repository |
69 | 226 |
|
70 | 227 | ```
|
71 |
| -[openshift_client] |
72 |
| -name=OpenShift Client |
73 |
| -baseurl=https://mirror.openshift.com/pub/origin-server/nightly/enterprise/2012-11-15/Client/x86_64/os/ |
74 |
| -enabled=1 |
75 |
| -gpgcheck=0 |
| 228 | +yum update --enablerepo updates-testing ruby ruby-libs ruby-irb ruby-devel |
76 | 229 | ```
|
77 | 230 |
|
78 |
| -3. Save and close the file. |
| 231 | +## Facter |
79 | 232 |
|
80 |
| -................................................................................ |
| 233 | +Facter broken on Fedora 17. http://projects.puppetlabs.com/issues/15001 |
81 | 234 |
|
| 235 | +```puppet |
| 236 | +yumrepo { 'puppetlabs-products': |
| 237 | + name => 'puppetlabs-products', |
| 238 | + descr => 'Puppet Labs Products Fedora 17 - $basearch', |
| 239 | + baseurl => 'http://yum.puppetlabs.com/fedora/f17/dependencies/\$basearch', |
| 240 | + gpgkey => 'http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs', |
| 241 | + enabled => 1, |
| 242 | + gpgcheck => 1, |
| 243 | +} |
82 | 244 |
|
| 245 | +yumrepo { 'puppetlabs-deps': |
| 246 | + name => 'puppetlabs-deps', |
| 247 | + descr => 'Puppet Labs Dependencies Fedora 17 - $basearch', |
| 248 | + baseurl => 'http://yum.puppetlabs.com/fedora/f17/products/\$basearch', |
| 249 | + gpgkey => 'http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs', |
| 250 | + enabled => 1, |
| 251 | + gpgcheck => 1, |
| 252 | +} |
83 | 253 |
|
| 254 | +package { 'facter': |
| 255 | + ensure => latest, |
| 256 | + require => [Yumrepo['puppetlabs-products'],Yumrepo['puppetlabs-deps']], |
| 257 | +} |
| 258 | +``` |
0 commit comments