Skip to content

Commit bcffc60

Browse files
author
Tom Krouper
authored
Merge pull request #9 from mcrauwel/manage-repo
added support for managing the packagecloud repo's
2 parents 3a54593 + a2d2456 commit bcffc60

File tree

6 files changed

+109
-0
lines changed

6 files changed

+109
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ This module is to install the MySQL tool called Orchestrator via puppet. Orchest
8181

8282
* The orchestrator deb/rpm package is available to puppet if `orchestrator::params::package_manage` is `true`.
8383

84+
* Puppet will manage the [Orchestrator Packagecloud repo](https://packagecloud.io/github/orchestrator) if `orchestrator::params::repo_manage` is `true`. *Note*: this functionality will require the [computology/packagecloud]( https://forge.puppet.com/computology/packagecloud) module dependency.
85+
8486
## Status
8587
Stable and in active development.
8688

examples/init.pp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node default {
2+
3+
$user = 'root'
4+
$password = 'root'
5+
6+
class { '::mysql::server':
7+
root_password => "%${password}%",
8+
remove_default_accounts => true,
9+
} ->
10+
class { '::orchestrator':
11+
config_override => {
12+
'MySQLOrchestratorHost' => '127.0.0.1',
13+
},
14+
}
15+
16+
}

manifests/init.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
$package_ensure = $orchestrator::params::package_ensure,
1010
$package_manage = $orchestrator::params::package_manage,
1111
$package_name = $orchestrator::params::package_name,
12+
$repo_manage = $orchestrator::params::repo_manage,
1213
$service_enable = $orchestrator::params::service_enable,
1314
$service_ensure = $orchestrator::params::service_ensure,
1415
$service_manage = $orchestrator::params::service_manage,
@@ -20,6 +21,7 @@
2021
validate_string($package_ensure)
2122
validate_bool($package_manage)
2223
validate_array($package_name)
24+
validate_bool($repo_manage)
2325
validate_bool($service_enable)
2426
validate_string($service_ensure)
2527
validate_bool($service_manage)
@@ -28,6 +30,7 @@
2830
# Using anchor pattern based on known issue:
2931
# http://docs.puppetlabs.com/puppet/2.7/reference/lang_containment.html#known-issues
3032
anchor { 'orchestrator::begin': } ->
33+
class { '::orchestrator::repo': } ->
3134
class { '::orchestrator::install': } ->
3235
class { '::orchestrator::config': } ~>
3336
class { '::orchestrator::my_cnf': } ~>

manifests/params.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
$package_ensure = 'present'
77
$package_manage = true
88
$package_name = [ 'orchestrator' ]
9+
$repo_manage = true
910
$service_enable = true
1011
$service_ensure = 'running'
1112
$service_manage = true
1213
$service_name = 'orchestrator'
1314
$srv_cnf = '/etc/orchestrator_srv.cnf'
1415
$topology_cnf = '/etc/orchestrator.cnf'
1516

17+
# lint:ignore:140chars
1618
$config_defaults = {
1719
'Debug' => true,
1820
'EnableSyslog' => false,
@@ -150,4 +152,5 @@
150152
'GraphitePath' => '',
151153
'GraphiteConvertHostnameDotsToUnderscores' => true,
152154
}
155+
# lint:endignore
153156
}

manifests/repo.pp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Manage the packagecloud repo's
2+
class orchestrator::repo inherits orchestrator {
3+
if $orchestrator::repo_manage {
4+
include packagecloud
5+
6+
case $::operatingsystem {
7+
'Debian', 'Ubuntu': {
8+
packagecloud::repo { 'github/orchestrator':
9+
type => 'deb',
10+
}
11+
}
12+
'Fedora', 'CentOS', 'RedHat': {
13+
packagecloud::repo { 'github/orchestrator':
14+
type => 'rpm',
15+
}
16+
}
17+
default: {
18+
fail("Operating system ${::operatingsystem} was not supported for adding repo's")
19+
}
20+
}
21+
}
22+
23+
}

metadata.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"name": "github-orchestrator",
3+
"version": "1.0.1",
4+
"author": "GitHub",
5+
"license": "MIT",
6+
"summary": "A module for installing and configuring Orchestrator (https://github.com/github/orchestrator/)",
7+
"source": "https://github.com/github/puppet-orchestrator-for-mysql.git",
8+
"project_page": "https://github.com/github/puppet-orchestrator-for-mysql",
9+
"issues_url": "https://github.com/github/puppet-orchestrator-for-mysql/issues",
10+
"tags": ["mysql", "orchestrator"],
11+
"operatingsystem_support": [
12+
{
13+
"operatingsystem": "RedHat",
14+
"operatingsystemrelease": [
15+
"5",
16+
"6",
17+
"7"
18+
]
19+
},
20+
{
21+
"operatingsystem": "CentOS",
22+
"operatingsystemrelease": [
23+
"5",
24+
"6",
25+
"7"
26+
]
27+
},
28+
{
29+
"operatingsystem":"Fedora",
30+
"operatingsystemrelease": [
31+
"22",
32+
"23",
33+
"24"
34+
]
35+
},
36+
{
37+
"operatingsystem":"Debian",
38+
"operatingsystemrelease": [
39+
"7",
40+
"8"
41+
]
42+
},
43+
{
44+
"operatingsystem": "Ubuntu",
45+
"operatingsystemrelease": [
46+
"12.04",
47+
"14.04",
48+
"15.04",
49+
"15.10",
50+
"16.04"
51+
]
52+
}
53+
],
54+
"requirements": [
55+
{ "name": "json", "version_requirement": ">=1.8.0" },
56+
{ "name": "puppet", "version_requirement": ">= 3.2.0" }
57+
],
58+
"dependencies": [
59+
{ "name": "puppetlabs/stdlib", "version_requirement": ">= 3.2.0 <5.0.0" },
60+
{ "name": "computology/packagecloud", "version_requirement": ">= 0.2.0" }
61+
]
62+
}

0 commit comments

Comments
 (0)