Rename roles to manifests
With the goal to transform this work in a complete puppet module, this patch aims to rename roles to manifests. Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
143
manifests/common/packages_config.pp
Normal file
143
manifests/common/packages_config.pp
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
# APT configuration
|
||||||
|
#
|
||||||
|
|
||||||
|
class os_packages_config {
|
||||||
|
|
||||||
|
case $::osfamily {
|
||||||
|
'Debian': {
|
||||||
|
class{'apt':
|
||||||
|
always_apt_update => false,
|
||||||
|
purge_sources_list => true,
|
||||||
|
purge_sources_list_d => true,
|
||||||
|
purge_preferences_d => true,
|
||||||
|
}
|
||||||
|
|
||||||
|
# Ensure apt is configured before every package installation
|
||||||
|
Class['os_packages_config'] -> Package <| |>
|
||||||
|
|
||||||
|
# configure apt periodic updates
|
||||||
|
apt::conf { 'periodic':
|
||||||
|
priority => '10',
|
||||||
|
content => "APT::Periodic::Update-Package-Lists 1;\nAPT::Periodic::Download-Upgradeable-Packages 1;\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# OS specific repositories
|
||||||
|
case $::operatingsystem {
|
||||||
|
'Debian': {
|
||||||
|
# Official Debian repositories
|
||||||
|
apt::source {'debian_main':
|
||||||
|
location => 'http://ftp2.fr.debian.org/debian/',
|
||||||
|
release => 'wheezy',
|
||||||
|
repos => 'main contrib non-free',
|
||||||
|
include_src => false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apt::source {'debian_backports':
|
||||||
|
location => 'http://ftp2.fr.debian.org/debian/',
|
||||||
|
release => 'wheezy-backports',
|
||||||
|
include_src => false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apt::source {'debian_security':
|
||||||
|
location => 'http://security.debian.org/',
|
||||||
|
release => 'wheezy/updates',
|
||||||
|
repos => 'main',
|
||||||
|
include_src => false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apt::source {'mariadb':
|
||||||
|
location => 'http://ftp.igh.cnrs.fr/pub/mariadb/repo/5.5/debian',
|
||||||
|
release => 'wheezy',
|
||||||
|
include_src => false,
|
||||||
|
key_server => 'keyserver.ubuntu.com',
|
||||||
|
key => '1BB943DB',
|
||||||
|
}
|
||||||
|
} # Debian
|
||||||
|
|
||||||
|
'Ubuntu': {
|
||||||
|
apt::source { 'ubuntu_precise':
|
||||||
|
location => 'http://fr.archive.ubuntu.com/ubuntu',
|
||||||
|
release => 'precise',
|
||||||
|
repos => 'main universe multiverse',
|
||||||
|
include_src => false
|
||||||
|
}
|
||||||
|
|
||||||
|
apt::source { 'ubuntu_precise_update':
|
||||||
|
location => 'http://fr.archive.ubuntu.com/ubuntu',
|
||||||
|
release => 'precise-updates',
|
||||||
|
repos => 'main universe multiverse',
|
||||||
|
include_src => false
|
||||||
|
}
|
||||||
|
|
||||||
|
apt::source { 'ubuntu_precise_security':
|
||||||
|
location => 'http://security.ubuntu.com/ubuntu',
|
||||||
|
release => 'precise-security',
|
||||||
|
repos => 'main universe multiverse',
|
||||||
|
include_src => false
|
||||||
|
}
|
||||||
|
|
||||||
|
apt::source {'mariadb':
|
||||||
|
location => 'http://ftp.igh.cnrs.fr/pub/mariadb/repo/5.5/ubuntu',
|
||||||
|
release => 'precise',
|
||||||
|
include_src => false,
|
||||||
|
key_server => 'keyserver.ubuntu.com',
|
||||||
|
key => '1BB943DB',
|
||||||
|
}
|
||||||
|
} # Ubuntu
|
||||||
|
default: {
|
||||||
|
fail("Operating system (${::operatingsystem}) not supported yet" )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Common packages for Debian / Ubuntu
|
||||||
|
case $::operatingsystem {
|
||||||
|
/^(Debian|Ubuntu)$/: {
|
||||||
|
# OpenStack / Ceph / Specific Backports
|
||||||
|
apt::source {'cloud.pkgs.enovance.com':
|
||||||
|
location => "[trusted=1 arch=amd64] http://cloud.pkgs.enovance.com/${::lsbdistcodename}-${os_params::os_release}",
|
||||||
|
release => $os_params::os_release,
|
||||||
|
include_src => false,
|
||||||
|
key_server => 'keyserver.ubuntu.com',
|
||||||
|
key => '5D964F0B',
|
||||||
|
}
|
||||||
|
|
||||||
|
# # Specific to eNovance (SSH keys, etc)
|
||||||
|
# apt::source {'enovance':
|
||||||
|
# location => 'http://***REMOVED***@repo.enovance.com/apt/',
|
||||||
|
# release => 'squeeze',
|
||||||
|
# repos => 'main contrib non-free',
|
||||||
|
# key => '3A964515',
|
||||||
|
# key_source => 'http://***REMOVED***@repo.enovance.com/apt/key/enovance.gpg',
|
||||||
|
# include_src => true,
|
||||||
|
# }
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
fail("Operating system (${::operatingsystem}) not supported yet" )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} # os family Debian
|
||||||
|
'RedHat': {
|
||||||
|
notice("${::osfamily} (${::operatingsystem})")
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
err "${::osfamily} not supported yet"
|
||||||
|
}
|
||||||
|
} # Case $::osfamily
|
||||||
|
# We don't include Ceph here, since APT is managed by Ceph Puppet module
|
||||||
|
}
|
36
site.pp
36
site.pp
@@ -18,24 +18,24 @@
|
|||||||
|
|
||||||
import 'params.pp'
|
import 'params.pp'
|
||||||
|
|
||||||
# Import roles
|
# Import manifests
|
||||||
import 'roles/automation/*.pp'
|
import 'manifests/automation/*.pp'
|
||||||
import 'roles/cache/*.pp'
|
import 'manifests/cache/*.pp'
|
||||||
import 'roles/common/*.pp' # mandatory
|
import 'manifests/common/*.pp' # mandatory
|
||||||
import 'roles/compute/*.pp'
|
import 'manifests/compute/*.pp'
|
||||||
import 'roles/dashboard/*.pp'
|
import 'manifests/dashboard/*.pp'
|
||||||
import 'roles/database/*.pp'
|
import 'manifests/database/*.pp'
|
||||||
import 'roles/identity/*.pp'
|
import 'manifests/identity/*.pp'
|
||||||
import 'roles/image/*.pp'
|
import 'manifests/image/*.pp'
|
||||||
import 'roles/load-balancer/*.pp'
|
import 'manifests/load-balancer/*.pp'
|
||||||
import 'roles/messaging/*.pp'
|
import 'manifests/messaging/*.pp'
|
||||||
import 'roles/monitoring/*.pp'
|
import 'manifests/monitoring/*.pp'
|
||||||
import 'roles/network/*.pp'
|
import 'manifests/network/*.pp'
|
||||||
import 'roles/object-storage/*.pp'
|
import 'manifests/object-storage/*.pp'
|
||||||
import 'roles/orchestration/*.pp'
|
import 'manifests/orchestration/*.pp'
|
||||||
import 'roles/spof/*.pp'
|
import 'manifests/spof/*.pp'
|
||||||
import 'roles/telemetry/*.pp'
|
import 'manifests/telemetry/*.pp'
|
||||||
import 'roles/volume/*.pp'
|
import 'manifests/volume/*.pp'
|
||||||
|
|
||||||
node common {
|
node common {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user