Merge "[state] virtual_init: Limit to mas01 on baremetal"
[fuel.git] / mcp / scripts / docker-compose / docker-compose.yaml.j2
1 ##############################################################################
2 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {%- import 'net_map.j2' as nm with context %}
9 {%- import 'net_macros.j2' as ma with context %}
10 {#- conf.MCPCONTROL_NET & co are mandatory, defaults are set via globals.sh #}
11 {%- set net_mcpcontrol = [conf.MCPCONTROL_NET, conf.MCPCONTROL_PREFIX] | join("/") %}
12 version: '2'
13 services:
14   opnfv-fuel-salt-master:
15     container_name: "fuel"
16     image: "opnfv/fuel:saltmaster-reclass-{{ conf.MCP_DOCKER_TAG }}"
17     networks:
18       - mcpcontrol
19       - pxebr
20       - mgmt
21     volumes:
22        - /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro
23        - {{ conf.MCP_REPO_ROOT_PATH }}:/root/fuel
24        - {{ conf.MCP_REPO_ROOT_PATH }}/mcp/scripts/docker-compose/files/entrypoint.sh:/entrypoint.sh
25        - {{ conf.MCP_STORAGE_DIR }}/pod_config.yml:/root/pod_config.yml
26        - {{ conf.MCP_STORAGE_DIR }}/nodes:/srv/salt/reclass/nodes
27        - {{ conf.MCP_STORAGE_DIR }}/pki:/etc/pki
28        - {{ conf.MCP_STORAGE_DIR }}/salt:/etc/salt
29        - {{ conf.MCP_STORAGE_DIR }}/hosts:/etc/hosts
30 {%- if conf.MCP_VCP %}
31        - {{ conf.MCP_STORAGE_DIR }}/base_image_opnfv_fuel_vcp.img:/srv/salt/env/prd/salt/files/control/images/base_image_opnfv_fuel_vcp.img
32 {%- endif %}
33     hostname: cfg01
34     domainname: {{ conf.cluster.domain }}
35     privileged: true
36 networks:
37   mcpcontrol:
38     driver: macvlan
39     driver_opts:
40       parent: veth_mcp1  # Always untagged
41     ipam:
42       config:
43         - subnet: {{ net_mcpcontrol }}
44           gateway: {{ net_mcpcontrol | ipnet_hostaddr(1) }}
45           ip_range: {{ [conf.SALT_MASTER, conf.MCPCONTROL_PREFIX] | join("/") }}
46   pxebr:
47     driver: macvlan
48     driver_opts:
49       parent: veth_mcp3  # Always untagged
50     ipam:
51       config:
52         - subnet: {{ nm.net_admin }}
53           ip_range: {{ [nm.net_admin | ipnet_hostaddr(nm.start_ip[nm.net_admin] + nm.net_admin_hosts.index('opnfv_infra_config_pxe_admin_address') +1), nm.net_admin.split("/")[-1]] | join("/") }}
54   mgmt:
55     driver: macvlan
56     driver_opts:
57 {%- if conf.idf.fuel.jumphost.get('trunks', {}).get('mgmt', False) %}
58       parent: {{ ma.interface_str('veth_mcp5', nm.vlan_mgmt) }}
59 {%- else %}
60       parent: veth_mcp5  # Untagged by default
61 {%- endif %}
62     ipam:
63       config:
64         - subnet: {{ nm.net_mgmt }}
65           ip_range: {{ [nm.net_mgmt | ipnet_hostaddr(2), nm.net_mgmt.split("/")[-1]] | join("/") }}