95 lines
3.8 KiB
YAML
95 lines
3.8 KiB
YAML
dsl_version: 0.1.0
|
|
service:
|
|
name: neutron-l3-agent
|
|
kind: DaemonSet
|
|
hostNetwork: true
|
|
containers:
|
|
- name: neutron-l3-agent
|
|
image: neutron-l3-agent
|
|
privileged: true
|
|
volumes:
|
|
- name: ovs-socket
|
|
type: host
|
|
path: /run/openvswitch
|
|
- name: metadata-socket
|
|
type: host
|
|
path: /var/lib/neutron/ccp
|
|
daemon:
|
|
command: neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
|
|
dependencies:
|
|
- neutron-db-sync
|
|
- rabbitmq
|
|
files:
|
|
- neutron.conf
|
|
- ml2-conf.ini
|
|
- l3-agent.ini
|
|
post:
|
|
- name: neutron-bootstrap-router
|
|
type: single
|
|
dependencies:
|
|
- neutron-server
|
|
command: openstack router create {{ neutron.bootstrap.router.name }}
|
|
|
|
# {% set int = neutron.bootstrap.internal %}
|
|
# {% if int.enable %}
|
|
# {% if neutron.plugin_agent == 'vxlan' %}
|
|
- name: neutron-bootstrap-int-net-create
|
|
type: single
|
|
dependencies:
|
|
- neutron-server
|
|
command: openstack network create --provider-network-type vxlan --provider-segment 77 {{ int.net_name }}
|
|
# {% endif %}
|
|
- name: neutron-bootstrap-int-net-subnetpool-create
|
|
type: single
|
|
dependencies:
|
|
- neutron-server
|
|
command: openstack subnet pool create {{ int.subnetpool_name }} --default-prefix-length {{ int.subnet_prefix_length }} --pool-prefix {{ int.pool_prefix }} --share --default
|
|
- name: neutron-bootstrap-int-net-subnet-create
|
|
type: single
|
|
dependencies:
|
|
- neutron-bootstrap-int-net-create
|
|
- neutron-bootstrap-int-net-subnetpool-create
|
|
command: openstack subnet create --use-default-subnet-pool {% for svc in int.dns_servers %} --dns-nameserver {{ svc }} {% endfor %} --network {{ int.net_name }} {{ int.subnet_name }}
|
|
- name: neutron-bootstrap-int-net-add-route
|
|
type: single
|
|
dependencies:
|
|
- neutron-bootstrap-router
|
|
- neutron-bootstrap-int-net-subnet-create
|
|
command: openstack router add subnet {{ neutron.bootstrap.router.name }} {{ int.subnet_name }}
|
|
# {% endif %}
|
|
|
|
# {% set ext = neutron.bootstrap.external %}
|
|
# {% if ext.enable %}
|
|
# {% if "changeme" not in [ext.network, ext.physnet, ext.gateway, ext.nameserver, ext.pool.start, ext.pool.end] %}
|
|
- name: neutron-bootstrap-ext-net-create
|
|
type: single
|
|
dependencies:
|
|
- neutron-server
|
|
command: openstack network create --default --external --provider-network-type flat --provider-physical-network {{ ext.physnet }} {{ ext.net_name }}
|
|
- name: neutron-bootstrap-ext-subnet-create
|
|
type: single
|
|
dependencies:
|
|
- neutron-bootstrap-ext-net-create
|
|
command: openstack subnet create --subnet-range {{ ext.network }} --no-dhcp --gateway auto --network {{ ext.net_name }} --allocation-pool start={{ ext.pool.start }},end={{ ext.pool.end }} --dns-nameserver {{ ext.nameserver }} {{ ext.subnet_name }}
|
|
- name: neutron-bootstrap-ext-net-set-gateway
|
|
type: single
|
|
dependencies:
|
|
- neutron-bootstrap-router
|
|
- neutron-bootstrap-ext-subnet-create
|
|
command: neutron --os-endpoint-type internal router-gateway-set {{ neutron.bootstrap.router.name }} {{ ext.net_name }}
|
|
# {% endif %}
|
|
# {% endif %}
|
|
files:
|
|
neutron.conf:
|
|
path: /etc/neutron/neutron.conf
|
|
content: neutron.conf.j2
|
|
perm: "0600"
|
|
ml2-conf.ini:
|
|
path: /etc/neutron/plugins/ml2/ml2_conf.ini
|
|
content: ml2_conf.ini.j2
|
|
perm: "0600"
|
|
l3-agent.ini:
|
|
path: /etc/neutron/l3_agent.ini
|
|
content: l3_agent.ini.j2
|
|
perm: "0600"
|