aboutsummaryrefslogtreecommitdiffstats
path: root/docker/core
AgeCommit message (Expand)AuthorFilesLines
2017-09-14Select $OPENSTACK_TAG instead of stable/ocataCédric Ollivier1-1/+1
2017-09-06Fix all refstack-client requirements on-the-flyCédric Ollivier1-1/+1
2017-09-05Stop using master for pipCédric Ollivier1-3/+0
2017-09-02Allow building Alpine containers from any gerrit changesCédric Ollivier1-0/+3
2017-09-02Remove openstack-requirements from requirements.txtCédric Ollivier1-1/+4
2017-09-01Stop removing /src/openstack-requirements/.gitCédric Ollivier1-1/+1
2017-09-01Fix all rally requirements on-the-flyCédric Ollivier1-1/+6
2017-07-17Save space in Alpine containersCédric Ollivier1-1/+1
2017-07-11Add openssh-client in coreCédric Ollivier1-1/+1
2017-07-10Download Functest's upper-constraints.txtCédric Ollivier2-23/+9
2017-07-10Add upper-constraints.txt for FunctestCédric Ollivier2-5/+21
2017-07-10Add lesser containers based on AlpineCédric Ollivier1-0/+21
nt.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright 2016 Red Hat, Inc.
#
# 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.
#
# == Resource: tripleo::certmonger::haproxy
#
# Request a certificate for the HAProxy service and does the necessary logic to
# get it into a format that the service understands.
#
# === Parameters
#
# [*service_pem*]
#   The file in PEM format that the HAProxy service will use as a certificate.
#
# [*service_certificate*]
#   The certificate file that certmonger will be tracking.
#
# [*service_key*]
#   The key file that certmonger will use for the certificate.
#
# [*hostname*]
#   The hostname that certmonger will use as the common name for the
#   certificate.
#
# [*certmonger_ca*]
#   (Optional) The CA that certmonger will use to generate the certificates.
#   Defaults to hiera('certmonger_ca', 'local').
#
# [*dnsnames*]
#   (Optional) The DNS names that will be added for the SubjectAltNames entry
#   in the certificate. If left unset, the value will be set to the $hostname.
#   Defaults to undef
#
# [*principal*]
#   The haproxy service principal that is set for HAProxy in kerberos.
#
# [*postsave_cmd*]
#   The post-save-command that certmonger will use once it renews the
#   certificate.
#
define tripleo::certmonger::haproxy (
  $service_pem,
  $service_certificate,
  $service_key,
  $hostname,
  $certmonger_ca = hiera('certmonger_ca', 'local'),
  $dnsnames      = undef,
  $principal     = undef,
  $postsave_cmd  = undef,
){
    include ::certmonger
    include ::haproxy::params
    # This is only needed for certmonger's local CA. For any other CA this
    # operation (trusting the CA) should be done by the deployer.
    if $certmonger_ca == 'local' {
      class { '::tripleo::certmonger::ca::local':
        notify => Class['::tripleo::haproxy']
      }
    }

    if $dnsnames {
      $dnsnames_real = $dnsnames
    } else {
      $dnsnames_real = $hostname
    }

    if $certmonger_ca == 'local' {
      $ca_fragment = $ca_pem
    } else {
      $ca_fragment = ''
    }

    $concat_pem = "cat ${service_certificate} ${ca_fragment} ${service_key} > ${service_pem}"
    if $postsave_cmd {
      $postsave_cmd_real = "${concat_pem} && ${postsave_cmd}"
    } else {
      $reload_haproxy_cmd = 'if systemctl -q is-active haproxy; then systemctl reload haproxy; else true; fi'
      $postsave_cmd_real = "${concat_pem} && ${reload_haproxy_cmd}"
    }

    certmonger_certificate { "${title}-cert":
      ensure       => 'present',
      ca           => $certmonger_ca,
      hostname     => $hostname,
      dnsname      => $dnsnames_real,
      certfile     => $service_certificate,
      keyfile      => $service_key,
      postsave_cmd => $postsave_cmd_real,
      principal    => $principal,
      wait         => true,
      tag          => 'haproxy-cert',
      require      => Class['::certmonger'],
    }
    concat { $service_pem :
      ensure => present,
      mode   => '0640',
      owner  => 'haproxy',
      group  => 'haproxy',
      tag    => 'haproxy-cert',
    }
    Package<| name == $::haproxy::params::package_name |> -> Concat[$service_pem]

    concat::fragment { "${title}-cert-fragment":
      target  => $service_pem,
      source  => $service_certificate,
      order   => '01',
      tag     => 'haproxy-cert',
      require => Certmonger_certificate["${title}-cert"],
    }

    if $certmonger_ca == 'local' {
      $ca_pem = getparam(Class['tripleo::certmonger::ca::local'], 'ca_pem')
      concat::fragment { "${title}-ca-fragment":
        target  => $service_pem,
        source  => $ca_pem,
        order   => '10',
        tag     => 'haproxy-cert',
        require => Class['tripleo::certmonger::ca::local'],
      }
    }

    concat::fragment { "${title}-key-fragment":
      target  => $service_pem,
      source  => $service_key,
      order   => 20,
      tag     => 'haproxy-cert',
      require => Certmonger_certificate["${title}-cert"],
    }
}