aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/base/glance/registry.pp
blob: 9e2be9defc460b6f98d4ecd735c7596b976e4705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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.
#
# == Class: tripleo::profile::base::glance::registry
#
# Glance Registry profile for tripleo
#
# === Parameters
#
# [*bootstrap_node*]
#   (Optional) The hostname of the node responsible for bootstrapping tasks
#   Defaults to hiera('bootstrap_nodeid')
#
# [*glance_backend*]
#   (Optional) Glance backend(s) to use.
#   Defaults to downcase(hiera('glance_backend', 'swift'))
#
# [*step*]
#   (Optional) The current step in deployment. See tripleo-heat-templates
#   for more details.
#   Defaults to hiera('step')
#
class tripleo::profile::base::glance::registry (
  $bootstrap_node = hiera('bootstrap_nodeid', undef),
  $glance_backend = downcase(hiera('glance_backend', 'swift')),
  $step           = hiera('step'),
) {
  if $::hostname == downcase($bootstrap_node) {
    $sync_db = true
  } else {
    $sync_db = false
  }

  if $step >= 4 or ( $step >= 3 and $sync_db ) {
    # TODO: notifications, scrubber, etc.
    include ::glance
    include ::glance::config
    class { '::glance::registry' :
      sync_db        => $sync_db,
    }
    include ::glance::notify::rabbitmq
    include join(['::glance::backend::', $glance_backend])
  }

}
har *saddr); int parse_ip6_cidr(struct ip6_subnet *val, const char *saddr); int parse_ip(uint32_t *paddr, const char *saddr); int parse_ip6(struct ipv6_addr *addr, const char *saddr); int parse_mac(struct ether_addr *paddr, const char *saddr); /* return error on overflow or invalid suffix*/ int parse_kmg(uint32_t* val, const char *str); int parse_bool(uint32_t* val, const char *str); int parse_flag(uint32_t* val, uint32_t flag, const char *str); int parse_list_set(uint32_t *list, const char *str, uint32_t max_limit); int parse_task_set(struct core_task_set *val, const char *str); int parse_int(uint32_t* val, const char *str); int parse_float(float* val, const char *str); int parse_u64(uint64_t* val, const char *str); int parse_str(char* dst, const char *str, size_t max_len); int parse_path(char *dst, const char *str, size_t max_len); int parse_port_name(uint32_t *val, const char *str); /* The syntax for random fields is X0010101XXX... where X is a randomized bit and 0, 1 are fixed bit. The resulting mask and fixed arguments are in BE order. */ int parse_random_str(uint32_t *mask, uint32_t *fixed, uint32_t *len, const char *str); int parse_port_name_list(uint32_t *val, uint32_t *tot, uint8_t max_vals, const char *str); /* Parses a comma separated list containing a remapping of ports specified by their name. Hence, all port names referenced from the list have to be added using add_port_name() before this function can be used. The first elements in the list are mapped to 0, the second to 1, etc. Multiple elements can be mapped to the same index. If multiple elements are used, they are separated by pipes. An example would be p0|p1,p2|p3. In this example, p0 and p1 both map to 0 and p2 and p3 map both map to 1. The mapping should contain at least enough entries as port ids. */ int parse_remap(uint8_t *mapping, const char *str); /* Convert an lcore_id to socket notation */ int lcore_to_socket_core_ht(uint32_t lcore_id, char *dst, size_t len); int add_port_name(uint32_t val, const char *str); /* The $self variable is something that can change its value (i.e. its value represents the core that is currently being parsed). */ int set_self_var(const char *str); int add_var(const char* name, const char *val, uint8_t cli); /* Parses str and returns pointer to the key value */ char *get_cfg_key(char *str); /* Changes strings in place. */ void strip_spaces(char *strings[], const uint32_t count); /* Contains error string if any of the above returned an error. */ const char* get_parse_err(void); /* Returns true if running from a virtual machine. */ int is_virtualized(void); #endif /* _PARSE_UTILS_H_ */