1 # SPDX-license-identifier: Apache-2.0
2 ##############################################################################
3 # Copyright (c) 2016 RedHat and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
10 $iptables_public_tcp_ports = [],
11 $iptables_public_udp_ports = [],
12 $iptables_rules4 = [],
13 $iptables_rules6 = [],
15 $enable_unbound = true,
16 $purge_apt_sources = true,
18 ###########################################################
19 # Classes for all hosts
25 public_tcp_ports => $iptables_public_tcp_ports,
26 public_udp_ports => $all_udp,
27 rules4 => $iptables_rules4,
28 rules6 => $iptables_rules6,
32 timezone => 'Etc/UTC',
35 if ($enable_unbound) {
37 install_resolv_conf => $install_resolv_conf
42 notify { 'rsyslog in chroot':
43 message => 'rsyslog not refreshed, running in chroot',
51 require => Package['rsyslog'],
53 $rsyslog_notify = [ Service['rsyslog'] ]
56 ###########################################################
59 # Increase syslog message size in order to capture
60 # python tracebacks with syslog.
61 file { '/etc/rsyslog.d/99-maxsize.conf':
63 # Note MaxMessageSize is not a puppet variable.
64 content => '$MaxMessageSize 6k',
68 notify => $rsyslog_notify,
69 require => Package['rsyslog'],
73 file { '/etc/profile.d/Z98-byobu.sh':
77 if $::osfamily == 'Debian' {
79 # Ubuntu installs their whoopsie package by default, but it eats through
80 # memory and we don't need it on servers
85 package { 'popularity-contest':
90 ###########################################################
91 # Package resources for all operating systems
123 $packages = ['parted', 'puppet', 'wget', 'iputils']
124 $user_packages = ['emacs-nox', 'vim-enhanced']
125 $update_pkg_list_cmd = ''
128 $packages = ['parted', 'puppet', 'wget', 'iputils-ping']
129 case $::operatingsystemrelease {
130 /^(12|14)\.(04|10)$/: {
131 $user_packages = ['emacs23-nox', 'vim-nox', 'iftop',
135 $user_packages = ['emacs-nox', 'vim-nox']
138 $update_pkg_list_cmd = 'apt-get update >/dev/null 2>&1;'
141 fail("Unsupported osfamily: ${::osfamily} The 'openstack_project' module only supports osfamily Debian or RedHat (slaves only).")
148 ###########################################################
149 # Package resources for specific operating systems
153 # Purge and augment existing /etc/apt/sources.list if requested, and make
154 # sure apt-get update is run before any packages are installed
156 purge => { 'sources.list' => $purge_apt_sources }
159 # Make sure dig is installed
160 package { 'dnsutils':
165 # Make sure dig is installed
166 package { 'bind-utils':
172 ###########################################################
177 if ($::osfamily == "RedHat") {
178 # Utils in ntp-perl are included in Debian's ntp package; we
179 # add it here for consistency. See also
180 # https://tickets.puppetlabs.com/browse/MODULES-3660
181 package { 'ntp-perl':
184 # NOTE(pabelanger): We need to ensure ntpdate service starts on boot for
185 # centos-7. Currently, ntpd explicitly require ntpdate to be running before
186 # the sync process can happen in ntpd. As a result, if ntpdate is not
187 # running, ntpd will start but fail to sync because of DNS is not properly
194 require => Package['ntpdate'],
198 ###########################################################
201 $desired_virtualenv = '13.1.0'
203 optional_settings => {
204 'extra-index-url' => '',
206 manage_pip_conf => true,
209 if (( versioncmp($::virtualenv_version, $desired_virtualenv) < 0 )) {
210 $virtualenv_ensure = $desired_virtualenv
212 $virtualenv_ensure = present
214 package { 'virtualenv':
215 ensure => $virtualenv_ensure,
216 provider => openstack_pip,
217 require => Class['pip'],
221 create_resources('host', hiera_hash('hosts'))