Commit cce01c5e authored by Walter Heck's avatar Walter Heck

Merge pull request #13 from shreejit13/shreejit/features/osbasedprofiles

Shreejit/features/osbasedprofiles
parents 4968d9e4 bb116927
......@@ -139,7 +139,7 @@ roles:
inline: |-
/sbin/service puppet stop
foss-puppet-agent:
foss-puppet-agent-rhel7:
provisioners:
-
type: hosts
......@@ -153,7 +153,7 @@ roles:
/opt/puppetlabs/bin/puppet config set --section main server master.opstheater.vm
/sbin/service puppet stop
foss-puppet-agent-el6:
foss-puppet-agent-rhel6:
provisioners:
-
type: hosts
......@@ -166,3 +166,19 @@ roles:
/usr/bin/yum install -y puppet-agent
/opt/puppetlabs/bin/puppet config set --section main server master.opstheater.vm
/sbin/service puppet stop
foss-puppet-agent-trusty:
provisioners:
-
type: hosts
add_localhost_hostnames: false
sync_hosts: true
-
type: shell
inline: |-
/usr/bin/wget https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
/usr/bin/dpkg -i puppetlabs-release-pc1-trusty.deb
/usr/bin/apt-get update
/usr/bin/apt-get install puppet-agent
/opt/puppetlabs/bin/puppet config set --section main server master.opstheater.vm
/usr/sbin/service puppet stop
......@@ -22,7 +22,7 @@ vms:
private_networks: [ {ip: '10.20.1.20'} ]
hostname: icinga2.opstheater.vm
roles:
- foss-puppet-agent
- foss-puppet-agent-rhel7
## elasticsearch + kibana
- name: elasticsearch
......@@ -30,7 +30,7 @@ vms:
private_networks: [ {ip: '10.20.1.30'} ]
hostname: elasticsearch.opstheater.vm
roles:
- foss-puppet-agent-el6
- foss-puppet-agent-rhel6
## gitlab + gitlabci + matter most
- name: gitlab
......@@ -38,7 +38,7 @@ vms:
private_networks: [ {ip: '10.20.1.50'} ]
hostname: gitlab.opstheater.vm
roles:
- foss-puppet-agent
- foss-puppet-agent-rhel7
## mysql
- name: mysql
......@@ -46,7 +46,7 @@ vms:
private_networks: [ {ip: '10.20.1.60'} ]
hostname: mysql.opstheater.vm
roles:
- foss-puppet-agent
- foss-puppet-agent-rhel7
- name: peclient
box: puppetlabs/centos-7.0-64-nocm
......@@ -55,9 +55,23 @@ vms:
roles:
- pe-puppet-agent
- name: fossclient
- name: fossclient-rhel7
box: puppetlabs/centos-7.0-64-nocm
private_networks: [ {ip: '10.20.1.201'} ]
hostname: fossclient.opstheater.vm
hostname: fossrhel7.opstheater.vm
roles:
- foss-puppet-agent
- foss-puppet-agent-rhel7
- name: fossclient-rhel6
box: puppetlabs/centos-6.6-64-nocm
private_networks: [ {ip: '10.20.1.203'} ]
hostname: fossrhel6.opstheater.vm
roles:
- foss-puppet-agent-rhel6
- name: fossclient-ubuntutrusty
box: puppetlabs/ubuntu-14.04-64-nocm
private_networks: [ {ip: '10.20.1.202'} ]
hostname: fosstrusty.opstheater.vm
roles:
- foss-puppet-agent-trusty
......@@ -22,6 +22,19 @@ node 'mysql.opstheater.vm' {
include opstheater::role::database::standalone
}
node 'fosstrusty.opstheater.vm' {
include opstheater::role::client::fosstrusty
}
node 'fossrhel7.opstheater.vm' {
include opstheater::role::client::fossrhel7
}
node 'fossrhel6.opstheater.vm' {
include opstheater::role::client::fossrhel6
}
node default {
include opstheater::role::testclient
fail ('node $::fqdn unknown to site.pp')
}
......@@ -2,6 +2,12 @@ class opstheater::profile::base::apt {
# include base aptitude class
include ::apt
package { 'software-properties-common':
ensure => 'installed',
} ->
Class[apt::update] -> Package['icinga2']
# get keys from hiera and create them
$keys = hiera_hash('opstheater::profile::base::apt::keys', undef)
if $keys {
......@@ -13,4 +19,5 @@ class opstheater::profile::base::apt {
if $repositories {
create_resources('apt::source', $repositories)
}
}
\ No newline at end of file
}
class opstheater::profile::base::icinga {
Icinga2::Object::Host {
display_name => $::fqdn,
check_command => 'cluster-zone',
......
class opstheater::profile::client::rhel6 {
include opstheater::profile::base::filebeat
include opstheater::profile::base::yum
include opstheater::profile::base::icinga
include opstheater::profile::icinga::client
$rand1 = fqdn_rand(30)
$rand2 = $rand1 + 30
cron { 'Puppet agent run':
command => '/opt/puppetlabs/bin/puppet agent --onetime --no-daemonize',
user => 'root',
minute => [ $rand1, $rand2],
}
}
class opstheater::profile::client::rhel7 {
include opstheater::profile::base::filebeat
include opstheater::profile::base::yum
include opstheater::profile::base::icinga
include opstheater::profile::icinga::client
$rand1 = fqdn_rand(30)
$rand2 = $rand1 + 30
cron { 'Puppet agent run':
command => '/opt/puppetlabs/bin/puppet agent --onetime --no-daemonize',
user => 'root',
minute => [ $rand1, $rand2],
}
}
class opstheater::profile::client::trusty {
include opstheater::profile::base::filebeat
include opstheater::profile::base::apt
include opstheater::profile::base::icinga
include opstheater::profile::icinga::client
$rand1 = fqdn_rand(30)
$rand2 = $rand1 + 30
cron { 'Puppet agent run':
command => '/opt/puppetlabs/bin/puppet agent --onetime --no-daemonize',
user => 'root',
minute => [ $rand1, $rand2],
}
}
class opstheater::role::client::fossrhel6 {
include opstheater::profile::client::rhel6
}
class opstheater::role::client::fossrhel7 {
include opstheater::profile::client::rhel7
}
class opstheater::role::client::fosstrusty {
include opstheater::profile::client::trusty
}
\ No newline at end of file
class opstheater::role::testclient {
include opstheater::profile::base
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment