aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst4
-rw-r--r--ansible/group_vars/all.yml21
-rw-r--r--ansible/inventory/all-in-one14
-rw-r--r--ansible/inventory/multinode14
-rw-r--r--ansible/library/kolla_docker.py49
-rw-r--r--ansible/roles/ceph/tasks/bootstrap_osds.yml8
-rw-r--r--ansible/roles/ceph/tasks/distribute_keyrings.yml1
-rw-r--r--ansible/roles/ceph/tasks/generate_cluster.yml18
-rw-r--r--ansible/roles/ceph/tasks/start_osds.yml2
-rw-r--r--ansible/roles/ceph/tasks/upgrade.yml1
-rw-r--r--ansible/roles/ceph/templates/ceph-mon.json.j27
-rw-r--r--ansible/roles/cinder/defaults/main.yml3
-rw-r--r--ansible/roles/cinder/tasks/bootstrap.yml8
-rw-r--r--ansible/roles/cinder/tasks/register.yml18
-rw-r--r--ansible/roles/cinder/tasks/start.yml10
-rw-r--r--ansible/roles/cinder/tasks/upgrade.yml1
-rw-r--r--ansible/roles/cinder/templates/cinder.conf.j28
-rw-r--r--ansible/roles/common/defaults/main.yml2
-rw-r--r--ansible/roles/common/tasks/pull.yml2
-rw-r--r--ansible/roles/common/tasks/start.yml11
-rw-r--r--ansible/roles/common/tasks/upgrade.yml1
-rw-r--r--ansible/roles/common/templates/admin-openrc.sh.j22
-rw-r--r--ansible/roles/common/templates/rsyslog.conf.j25
-rw-r--r--ansible/roles/glance/defaults/main.yml3
-rw-r--r--ansible/roles/glance/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/glance/tasks/check.yml2
-rw-r--r--ansible/roles/glance/tasks/register.yml10
-rw-r--r--ansible/roles/glance/tasks/start.yml4
-rw-r--r--ansible/roles/glance/tasks/upgrade.yml1
-rw-r--r--ansible/roles/glance/templates/glance-api.conf.j26
-rw-r--r--ansible/roles/glance/templates/glance-registry.conf.j26
-rw-r--r--ansible/roles/haproxy/tasks/upgrade.yml1
-rw-r--r--ansible/roles/haproxy/templates/haproxy.cfg.j28
-rw-r--r--ansible/roles/heat/defaults/main.yml3
-rw-r--r--ansible/roles/heat/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/heat/tasks/register.yml18
-rw-r--r--ansible/roles/heat/tasks/start.yml6
-rw-r--r--ansible/roles/heat/tasks/upgrade.yml1
-rw-r--r--ansible/roles/heat/templates/heat.conf.j228
-rw-r--r--ansible/roles/horizon/tasks/upgrade.yml5
-rw-r--r--ansible/roles/horizon/templates/local_settings.j22
-rw-r--r--ansible/roles/ironic/defaults/main.yml3
-rw-r--r--ansible/roles/ironic/tasks/bootstrap.yml25
-rw-r--r--ansible/roles/ironic/tasks/register.yml10
-rw-r--r--ansible/roles/ironic/tasks/upgrade.yml1
-rw-r--r--ansible/roles/ironic/templates/discoverd.conf.j22
-rw-r--r--ansible/roles/ironic/templates/ironic-pxe.json.j22
-rw-r--r--ansible/roles/ironic/templates/ironic.conf.j28
-rw-r--r--ansible/roles/keystone/defaults/main.yml3
-rw-r--r--ansible/roles/keystone/tasks/bootstrap.yml4
-rw-r--r--ansible/roles/keystone/tasks/bootstrap_service.yml2
-rw-r--r--ansible/roles/keystone/tasks/check.yml2
-rw-r--r--ansible/roles/keystone/tasks/register.yml10
-rw-r--r--ansible/roles/keystone/tasks/start.yml2
-rw-r--r--ansible/roles/kibana/defaults/main.yml24
-rw-r--r--ansible/roles/kibana/meta/main.yml3
-rw-r--r--ansible/roles/kibana/tasks/config.yml22
-rw-r--r--ansible/roles/kibana/tasks/deploy.yml4
-rw-r--r--ansible/roles/kibana/tasks/main.yml2
-rw-r--r--ansible/roles/kibana/tasks/pull.yml5
-rw-r--r--ansible/roles/kibana/tasks/start.yml9
-rw-r--r--ansible/roles/kibana/tasks/upgrade.yml1
-rw-r--r--ansible/roles/kibana/templates/kibana.json.j211
-rw-r--r--ansible/roles/kibana/templates/kibana.yml.j219
-rw-r--r--ansible/roles/magnum/defaults/main.yml3
-rw-r--r--ansible/roles/magnum/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/magnum/tasks/register.yml10
-rw-r--r--ansible/roles/magnum/tasks/start.yml4
-rw-r--r--ansible/roles/magnum/tasks/upgrade.yml1
-rw-r--r--ansible/roles/magnum/templates/magnum.conf.j210
-rw-r--r--ansible/roles/mariadb/tasks/bootstrap.yml31
-rw-r--r--ansible/roles/mariadb/tasks/check.yml8
-rw-r--r--ansible/roles/mariadb/tasks/deploy.yml3
-rw-r--r--ansible/roles/mariadb/tasks/register.yml2
-rw-r--r--ansible/roles/mariadb/tasks/start.yml2
-rw-r--r--ansible/roles/mariadb/tasks/upgrade.yml1
-rw-r--r--ansible/roles/mariadb/templates/galera.cnf.j22
-rw-r--r--ansible/roles/memcached/tasks/upgrade.yml5
-rw-r--r--ansible/roles/mistral/defaults/main.yml3
-rw-r--r--ansible/roles/mistral/tasks/bootstrap.yml19
-rw-r--r--ansible/roles/mistral/tasks/bootstrap_service.yml17
-rw-r--r--ansible/roles/mistral/tasks/register.yml10
-rw-r--r--ansible/roles/mistral/tasks/start.yml6
-rw-r--r--ansible/roles/mistral/tasks/upgrade.yml7
-rw-r--r--ansible/roles/mistral/templates/mistral.conf.j28
-rw-r--r--ansible/roles/mongodb/defaults/main.yml15
-rw-r--r--ansible/roles/mongodb/meta/main.yml3
-rw-r--r--ansible/roles/mongodb/tasks/bootstrap.yml15
-rw-r--r--ansible/roles/mongodb/tasks/config.yml23
-rw-r--r--ansible/roles/mongodb/tasks/deploy.yml9
-rw-r--r--ansible/roles/mongodb/tasks/main.yml2
-rw-r--r--ansible/roles/mongodb/tasks/pull.yml7
-rw-r--r--ansible/roles/mongodb/tasks/start.yml11
-rw-r--r--ansible/roles/mongodb/tasks/upgrade.yml1
-rw-r--r--ansible/roles/mongodb/templates/mongodb.conf.j215
-rw-r--r--ansible/roles/mongodb/templates/mongodb.json.j211
-rw-r--r--ansible/roles/murano/defaults/main.yml3
-rw-r--r--ansible/roles/murano/tasks/bootstrap.yml19
-rw-r--r--ansible/roles/murano/tasks/bootstrap_service.yml17
-rw-r--r--ansible/roles/murano/tasks/register.yml10
-rw-r--r--ansible/roles/murano/tasks/start.yml4
-rw-r--r--ansible/roles/murano/tasks/upgrade.yml7
-rw-r--r--ansible/roles/murano/templates/murano.conf.j28
-rw-r--r--ansible/roles/neutron/defaults/main.yml37
-rw-r--r--ansible/roles/neutron/tasks/bootstrap.yml6
-rw-r--r--ansible/roles/neutron/tasks/config-neutron-fake.yml4
-rw-r--r--ansible/roles/neutron/tasks/config.yml43
-rw-r--r--ansible/roles/neutron/tasks/deploy.yml16
-rw-r--r--ansible/roles/neutron/tasks/ironic-check.yml4
-rw-r--r--ansible/roles/neutron/tasks/pull.yml40
-rw-r--r--ansible/roles/neutron/tasks/register.yml10
-rw-r--r--ansible/roles/neutron/tasks/start.yml105
-rw-r--r--ansible/roles/neutron/tasks/upgrade.yml1
-rw-r--r--ansible/roles/neutron/templates/fwaas_driver.ini.j21
-rw-r--r--ansible/roles/neutron/templates/neutron-dhcp-agent.json.j2 (renamed from ansible/roles/neutron/templates/neutron-agents.json.j2)26
-rw-r--r--ansible/roles/neutron/templates/neutron-l3-agent.json.j229
-rw-r--r--ansible/roles/neutron/templates/neutron-metadata-agent.json.j223
-rw-r--r--ansible/roles/neutron/templates/neutron.conf.j213
-rw-r--r--ansible/roles/nova/defaults/main.yml6
-rw-r--r--ansible/roles/nova/tasks/bootstrap.yml48
-rw-r--r--ansible/roles/nova/tasks/config.yml2
-rw-r--r--ansible/roles/nova/tasks/register.yml10
-rw-r--r--ansible/roles/nova/tasks/start.yml19
-rw-r--r--ansible/roles/nova/tasks/upgrade.yml1
-rw-r--r--ansible/roles/nova/templates/libvirtd.conf.j29
-rw-r--r--ansible/roles/nova/templates/nova.conf.j221
-rw-r--r--ansible/roles/prechecks/tasks/package_checks.yml5
-rw-r--r--ansible/roles/prechecks/tasks/port_checks.yml24
-rw-r--r--ansible/roles/prechecks/vars/main.yml3
-rw-r--r--ansible/roles/rabbitmq/defaults/main.yml4
-rw-r--r--ansible/roles/rabbitmq/tasks/bootstrap.yml26
-rw-r--r--ansible/roles/rabbitmq/tasks/pull.yml7
-rw-r--r--ansible/roles/rabbitmq/tasks/start.yml5
-rw-r--r--ansible/roles/rabbitmq/tasks/upgrade.yml1
-rw-r--r--ansible/roles/swift/defaults/main.yml63
-rw-r--r--ansible/roles/swift/tasks/config.yml8
-rw-r--r--ansible/roles/swift/tasks/pull.yml88
-rw-r--r--ansible/roles/swift/tasks/register.yml10
-rw-r--r--ansible/roles/swift/tasks/start.yml147
-rw-r--r--ansible/roles/swift/tasks/upgrade.yml1
-rw-r--r--ansible/roles/swift/templates/proxy-server.conf.j24
-rw-r--r--ansible/site.yml17
-rw-r--r--dev/vagrant/Vagrantfile2
-rw-r--r--dev/vagrant/centos-bootstrap.sh8
-rw-r--r--dev/vagrant/newest_dhcp_lease.py131
-rw-r--r--dev/vagrant/ubuntu-bootstrap.sh4
-rw-r--r--doc/image-building.rst11
-rw-r--r--doc/quickstart.rst73
-rw-r--r--doc/swift-guide.rst72
-rw-r--r--docker/base/Dockerfile.j231
-rw-r--r--docker/base/set_configs.py2
-rw-r--r--docker/base/sources.list2
-rw-r--r--docker/base/start.sh10
-rw-r--r--docker/base/sudoers2
-rw-r--r--docker/ceilometer/ceilometer-base/Dockerfile.j25
-rw-r--r--docker/ceph/ceph-mon/extend_start.sh9
-rw-r--r--docker/cinder/cinder-api/Dockerfile.j26
-rw-r--r--docker/cinder/cinder-backup/Dockerfile.j210
-rw-r--r--docker/cinder/cinder-base/Dockerfile.j223
-rw-r--r--docker/cinder/cinder-base/cinder_sudoers1
-rw-r--r--docker/cinder/cinder-scheduler/Dockerfile.j210
-rw-r--r--docker/cinder/cinder-volume/Dockerfile.j26
-rw-r--r--docker/data/Dockerfile.j26
-rw-r--r--docker/designate/designate-api/Dockerfile.j28
-rw-r--r--docker/designate/designate-backend-bind9/Dockerfile.j26
-rw-r--r--docker/designate/designate-base/Dockerfile.j211
-rw-r--r--docker/designate/designate-central/Dockerfile.j26
-rw-r--r--docker/designate/designate-mdns/Dockerfile.j26
-rw-r--r--docker/designate/designate-poolmanager/Dockerfile.j27
-rw-r--r--docker/designate/designate-sink/Dockerfile.j27
-rw-r--r--docker/dind/start.sh4
-rw-r--r--docker/gnocchi/gnocchi-base/Dockerfile.j22
-rw-r--r--docker/heat/heat-api/extend_start.sh8
-rw-r--r--docker/horizon/Dockerfile.j25
-rw-r--r--docker/horizon/extend_start.sh13
-rw-r--r--docker/ironic/ironic-api/Dockerfile.j26
-rw-r--r--docker/ironic/ironic-base/Dockerfile.j29
-rw-r--r--docker/ironic/ironic-conductor/Dockerfile.j211
-rw-r--r--docker/ironic/ironic-pxe/Dockerfile.j213
-rw-r--r--docker/ironic/ironic-pxe/extend_start.sh14
-rw-r--r--docker/keystone/Dockerfile.j26
-rw-r--r--docker/kibana/Dockerfile.j219
-rw-r--r--docker/kolla-ansible/find_disks.py73
-rw-r--r--docker/kolla-toolbox/Dockerfile.j2 (renamed from docker/kolla-ansible/Dockerfile.j2)9
-rw-r--r--docker/kolla-toolbox/ansible.cfg (renamed from docker/kolla-ansible/ansible.cfg)0
-rw-r--r--docker/kolla-toolbox/find_disks.py115
-rw-r--r--docker/kolla-toolbox/kolla_keystone_service.py (renamed from docker/kolla-ansible/kolla_keystone_service.py)0
-rw-r--r--docker/kolla-toolbox/kolla_keystone_user.py (renamed from docker/kolla-ansible/kolla_keystone_user.py)0
-rw-r--r--docker/kolla-toolbox/kolla_sanity.py (renamed from docker/kolla-ansible/kolla_sanity.py)0
-rw-r--r--docker/kolla-toolbox/kolla_zookeeper.py (renamed from docker/kolla-ansible/kolla_zookeeper.py)0
-rw-r--r--docker/logging/rsyslog/Dockerfile.j22
-rw-r--r--docker/logging/rsyslog/extend_start.sh5
-rw-r--r--docker/magnum/magnum-base/Dockerfile.j217
-rw-r--r--docker/manila/manila-base/Dockerfile.j211
-rw-r--r--docker/manila/manila-share/Dockerfile.j29
-rw-r--r--docker/mariadb/extend_start.sh7
-rw-r--r--docker/mongodb/Dockerfile.j214
-rw-r--r--docker/mongodb/extend_start.sh10
-rw-r--r--docker/mongodb/mongodb_sudoers1
-rw-r--r--docker/neutron/neutron-agents/Dockerfile.j252
-rw-r--r--docker/neutron/neutron-agents/config-sudoers.sh12
l---------docker/neutron/neutron-agents/fwaas_driver.ini1
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-dhcp-agent/start.sh11
-rw-r--r--docker/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini3
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-l3-agent/start.sh11
-rwxr-xr-xdocker/neutron/neutron-agents/neutron-metadata-agent/start.sh11
-rwxr-xr-xdocker/neutron/neutron-agents/start.sh10
-rw-r--r--docker/neutron/neutron-agents/supervisord.conf40
-rw-r--r--docker/neutron/neutron-base/Dockerfile.j218
-rw-r--r--docker/neutron/neutron-base/extend_start.sh11
-rw-r--r--docker/neutron/neutron-base/ip_wrapper.py2
-rw-r--r--docker/neutron/neutron-base/neutron_sudoers1
-rw-r--r--docker/neutron/neutron-dhcp-agent/Dockerfile.j216
-rw-r--r--docker/neutron/neutron-l3-agent/Dockerfile.j216
-rw-r--r--docker/neutron/neutron-metadata-agent/Dockerfile.j223
-rw-r--r--docker/neutron/neutron-metadata-agent/extend_start.sh6
-rw-r--r--docker/neutron/neutron-metadata-agent/neutron_sudoers1
-rw-r--r--docker/neutron/neutron-openvswitch-agent/Dockerfile.j28
-rw-r--r--docker/neutron/neutron-server/Dockerfile.j22
-rw-r--r--docker/neutron/neutron-server/extend_start.sh12
-rw-r--r--docker/nova/nova-api/extend_start.sh1
-rw-r--r--docker/nova/nova-base/Dockerfile.j27
-rw-r--r--docker/nova/nova-compute-ironic/Dockerfile.j22
-rw-r--r--docker/nova/nova-compute/Dockerfile.j23
-rw-r--r--docker/nova/nova-compute/extend_start.sh6
-rw-r--r--docker/openstack-base/Dockerfile.j217
-rw-r--r--docker/openstack-base/oslo-log-bug1499620.patch18
-rw-r--r--docker/swift/swift-account-reaper/Dockerfile.j213
-rw-r--r--docker/swift/swift-account-replicator/Dockerfile.j213
-rw-r--r--docker/swift/swift-account-server/Dockerfile.j213
-rw-r--r--docker/swift/swift-account/Dockerfile.j2 (renamed from docker/swift/swift-account-auditor/Dockerfile.j2)0
-rw-r--r--docker/swift/swift-base/Dockerfile.j216
-rw-r--r--docker/swift/swift-base/build-swift-ring.py2
-rw-r--r--docker/swift/swift-container-replicator/Dockerfile.j213
-rw-r--r--docker/swift/swift-container-server/Dockerfile.j213
-rw-r--r--docker/swift/swift-container-updater/Dockerfile.j213
-rw-r--r--docker/swift/swift-container/Dockerfile.j2 (renamed from docker/swift/swift-container-auditor/Dockerfile.j2)0
-rw-r--r--docker/swift/swift-object-auditor/Dockerfile.j24
-rw-r--r--docker/swift/swift-object-expirer/Dockerfile.j215
-rw-r--r--docker/swift/swift-object-replicator/Dockerfile.j24
-rw-r--r--docker/swift/swift-object-server/Dockerfile.j24
-rw-r--r--docker/swift/swift-object-updater/Dockerfile.j24
-rw-r--r--docker/swift/swift-object/Dockerfile.j2 (renamed from docker/swift/swift-object-base/Dockerfile.j2)2
-rw-r--r--docker/swift/swift-proxy-server/Dockerfile.j23
-rw-r--r--docker/swift/swift-proxy-server/extend_start.sh3
-rw-r--r--docker/swift/swift-rsyncd/Dockerfile.j23
-rw-r--r--docker/swift/swift-rsyncd/extend_start.sh (renamed from docker/swift/swift-base/config-swift.sh)0
-rw-r--r--docker/zookeeper/extend_start.sh4
-rw-r--r--etc/kolla/globals.yml8
-rw-r--r--etc/kolla/passwords.yml3
-rwxr-xr-xkolla/cmd/build.py49
-rw-r--r--kolla/common/config.py26
-rw-r--r--kolla/tests/test_build.py64
-rw-r--r--requirements.txt2
-rw-r--r--setup.cfg2
-rw-r--r--specs/ansible-multi.rst4
-rw-r--r--specs/containerize-openstack.rst2
-rw-r--r--specs/template.rst2
-rwxr-xr-xtests/deploy_aio.sh37
-rwxr-xr-xtests/setup_Debian.sh42
-rwxr-xr-xtests/setup_RedHat.sh49
l---------[-rwxr-xr-x]tests/setup_gate.sh124
-rw-r--r--tests/test_build.py62
-rw-r--r--tools/__init__.py0
-rwxr-xr-xtools/cleanup-containers7
-rwxr-xr-xtools/deploy_aio.sh73
-rwxr-xr-xtools/dump_info.sh26
-rwxr-xr-xtools/kolla-ansible46
-rwxr-xr-xtools/setup_Debian.sh64
-rwxr-xr-xtools/setup_RedHat.sh59
-rwxr-xr-xtools/setup_gate.sh112
-rw-r--r--tools/setup_nodes.yml (renamed from tests/setup_nodes.yml)2
-rw-r--r--tox.ini40
273 files changed, 2444 insertions, 1507 deletions
diff --git a/README.rst b/README.rst
index 0fef552fe..b69bbc74c 100644
--- a/README.rst
+++ b/README.rst
@@ -70,7 +70,7 @@ contributing to the images can be found in the `image building
guide <http://docs.openstack.org/developer/kolla/image-building.html>`__.
The Kolla developers build images in the `kollaglue` namespace for every tagged
-release and implement Ansible deployment for them.
+release and implement an Ansible deployment for them.
You can view the available images on `Docker Hub
<https://hub.docker.com/u/kollaglue/>`__ or with the Docker CLI::
@@ -108,7 +108,7 @@ workflow <http://docs.openstack.org/infra/manual/developers.html>`__.
`Launchpad <https://launchpad.net/kolla>`__.
- Attend weekly
`meetings <https://wiki.openstack.org/wiki/Meetings/Kolla>`__.
-- Contribute `code <https://github.com/openstack/kolla>`__
+- Contribute `code <https://github.com/openstack/kolla>`__.
Contributors
============
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 0d09da0d6..51b63ec09 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -84,6 +84,9 @@ rabbitmq_management_port: "15672"
rabbitmq_cluster_port: "25672"
rabbitmq_epmd_port: "4369"
+mongodb_port: "27017"
+mongodb_web_port: "28017"
+
haproxy_stats_port: "1984"
keystone_public_port: "5000"
@@ -122,11 +125,17 @@ rgw_port: "6780"
mistral_api_port: "8989"
+kibana_port: "5601"
+elasticsearch_port: "9200"
+
+public_protocol: "http"
+internal_protocol: "http"
+admin_protocol: "http"
+
####################
-# Openstack options
+# OpenStack options
####################
openstack_release: "2.0.0"
-openstack_logging_verbose: "True"
openstack_logging_debug: "False"
openstack_region_name: "RegionOne"
@@ -137,10 +146,10 @@ set_sysctl: "yes"
# Valid options are [ novnc, spice ]
nova_console: "novnc"
-# Openstack authentication string. You should only need to override these if you
+# OpenStack authentication string. You should only need to override these if you
# are changing the admin tenant/project or user.
openstack_auth:
- auth_url: "http://{{ kolla_internal_address }}:{{ keystone_admin_port }}"
+ auth_url: "{{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}"
username: "admin"
password: "{{ keystone_admin_password }}"
project_name: "admin"
@@ -148,7 +157,7 @@ openstack_auth:
# This shouldn't be needed for long. It is only temporary until we get the
# ansible modules sorted out
openstack_auth_v2:
- auth_url: "http://{{ kolla_internal_address }}:{{ keystone_admin_port }}/v2.0"
+ auth_url: "{{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}/v2.0"
username: "admin"
password: "{{ keystone_admin_password }}"
project_name: "admin"
@@ -175,6 +184,8 @@ enable_murano: "no"
enable_ironic: "no"
enable_magnum: "no"
enable_mistral: "no"
+enable_elk: "no"
+enable_mongodb: "no"
ironic_keystone_user: "ironic"
diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one
index 0eb841b54..5e8a2187e 100644
--- a/ansible/inventory/all-in-one
+++ b/ansible/inventory/all-in-one
@@ -15,6 +15,9 @@ localhost ansible_connection=local
# You can explicitly specify which hosts run each project by updating the
# groups in the sections below. Common services are grouped together.
+[kibana:children]
+control
+
[haproxy:children]
network
@@ -24,6 +27,9 @@ control
[rabbitmq:children]
control
+[mongodb:children]
+control
+
[keystone:children]
control
@@ -112,7 +118,13 @@ nova
[neutron-server:children]
neutron
-[neutron-agents:children]
+[neutron-dhcp-agent:children]
+neutron
+
+[neutron-l3-agent:children]
+neutron
+
+[neutron-metadata-agent:children]
neutron
# Cinder
diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode
index 6b2302f4f..0265867db 100644
--- a/ansible/inventory/multinode
+++ b/ansible/inventory/multinode
@@ -27,6 +27,9 @@ storage01
# You can explicitly specify which hosts run each project by updating the
# groups in the sections below. Common services are grouped together.
+[kibana:children]
+control
+
[haproxy:children]
network
@@ -36,6 +39,9 @@ control
[rabbitmq:children]
control
+[mongodb:children]
+control
+
[keystone:children]
control
@@ -124,7 +130,13 @@ nova
[neutron-server:children]
control
-[neutron-agents:children]
+[neutron-dhcp-agent:children]
+neutron
+
+[neutron-l3-agent:children]
+neutron
+
+[neutron-metadata-agent:children]
neutron
# Cinder
diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py
index 3a1958c7c..705fc939b 100644
--- a/ansible/library/kolla_docker.py
+++ b/ansible/library/kolla_docker.py
@@ -85,6 +85,12 @@ options:
- Name of the docker image
required: False
type: str
+ labels:
+ description:
+ - List of labels to apply to container
+ required: False
+ type: dict
+ default: dict()
pid_mode:
description:
- Set docker pid namespace
@@ -232,6 +238,7 @@ class DockerWorker(object):
return (
self.compare_image(container_info) or
+ self.compare_labels(container_info) or
self.compare_privileged(container_info) or
self.compare_pid_mode(container_info) or
self.compare_volumes(container_info) or
@@ -260,6 +267,20 @@ class DockerWorker(object):
if new_image['Id'] != current_image:
return True
+ def compare_labels(self, container_info):
+ new_labels = self.params.get('labels')
+ current_labels = container_info['Config'].get('Labels', dict())
+ image_labels = self.check_image().get('Labels', dict())
+ for k, v in image_labels.iteritems():
+ if k in new_labels:
+ if v != new_labels[k]:
+ return True
+ else:
+ del current_labels[k]
+
+ if new_labels != current_labels:
+ return True
+
def compare_volumes_from(self, container_info):
new_vols_from = self.params.get('volumes_from')
current_vols_from = container_info['HostConfig'].get('VolumesFrom')
@@ -337,23 +358,35 @@ class DockerWorker(object):
]
for status in reversed(statuses):
- # NOTE(jeffrey4l): Get the last not empty status with status
- # property
+ if 'error' in status:
+ if status['error'].endswith('not found'):
+ self.module.fail_json(
+ msg="The requested image does not exist: {}:{}".format(
+ image, tag),
+ failed=True
+ )
+ else:
+ self.module.fail_json(
+ msg="Unknown error message: {}".format(
+ status['error']),
+ failed=True
+ )
+
if status and status.get('status'):
# NOTE(SamYaple): This allows us to use v1 and v2 docker
# registries. Eventually docker will stop supporting v1
# registries and when that happens we can remove this.
- if 'legacy registry' in status.get('status'):
+ if 'legacy registry' in status['status']:
continue
- elif "Downloaded newer image for" in status.get('status'):
+ elif 'Downloaded newer image for' in status['status']:
self.changed = True
return
- elif "Image is up to date for" in status.get('status'):
+ elif 'Image is up to date for' in status['status']:
return
else:
self.module.fail_json(
- msg="Invalid status returned from pull",
- changed=True,
+ msg="Unknown status message: {}".format(
+ status['status']),
failed=True
)
@@ -419,6 +452,7 @@ class DockerWorker(object):
'detach': self.params.get('detach'),
'environment': self.params.get('environment'),
'host_config': self.build_host_config(binds),
+ 'labels': self.params.get('labels'),
'image': self.params.get('image'),
'name': self.params.get('name'),
'volumes': volumes,
@@ -494,6 +528,7 @@ def generate_module():
auth_registry=dict(required=False, type='str'),
auth_username=dict(required=False, type='str'),
detach=dict(required=False, type='bool', default=True),
+ labels=dict(required=False, type='dict', default=dict()),
name=dict(required=False, type='str'),
environment=dict(required=False, type='dict'),
image=dict(required=False, type='str'),
diff --git a/ansible/roles/ceph/tasks/bootstrap_osds.yml b/ansible/roles/ceph/tasks/bootstrap_osds.yml
index 20b5bdaac..723d54a27 100644
--- a/ansible/roles/ceph/tasks/bootstrap_osds.yml
+++ b/ansible/roles/ceph/tasks/bootstrap_osds.yml
@@ -1,6 +1,6 @@
---
- name: Looking up disks to bootstrap for Ceph
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m find_disks
-a "partition_name='KOLLA_CEPH_OSD_BOOTSTRAP'"
register: osd_lookup
@@ -12,7 +12,7 @@
osds_bootstrap: "{{ (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).disks|from_json }}"
- name: Looking up disks to bootstrap for Ceph
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m find_disks
-a "partition_name='KOLLA_CEPH_OSD_CACHE_BOOTSTRAP'"
register: osd_cache_lookup
@@ -34,6 +34,8 @@
OSD_DEV: "{{ item.1.device }}"
OSD_INITIAL_WEIGHT: "{{ osd_initial_weight }}"
image: "{{ ceph_osd_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_osd_{{ item.0 }}"
privileged: True
restart_policy: "never"
@@ -54,6 +56,8 @@
OSD_DEV: "{{ item.1.device }}"
OSD_INITIAL_WEIGHT: "{{ osd_initial_weight }}"
image: "{{ ceph_osd_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_osd_cache_{{ item.0 }}"
privileged: True
restart_policy: "never"
diff --git a/ansible/roles/ceph/tasks/distribute_keyrings.yml b/ansible/roles/ceph/tasks/distribute_keyrings.yml
index 95658e455..ea4952a42 100644
--- a/ansible/roles/ceph/tasks/distribute_keyrings.yml
+++ b/ansible/roles/ceph/tasks/distribute_keyrings.yml
@@ -30,6 +30,7 @@
with_items:
- "{{ ceph_files['ceph.client.admin.keyring'] }}"
- "{{ ceph_files['ceph.client.mon.keyring'] }}"
+ - "{{ ceph_files['ceph.client.radosgw.keyring'] }}"
- "{{ ceph_files['ceph.monmap'] }}"
when: inventory_hostname in groups['ceph-mon']
diff --git a/ansible/roles/ceph/tasks/generate_cluster.yml b/ansible/roles/ceph/tasks/generate_cluster.yml
index 64be33ef8..1556e08c3 100644
--- a/ansible/roles/ceph/tasks/generate_cluster.yml
+++ b/ansible/roles/ceph/tasks/generate_cluster.yml
@@ -3,21 +3,31 @@
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
+ detach: False
environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
MON_IP: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
image: "{{ ceph_mon_image_full }}"
- name: "ceph_mon"
+ labels:
+ BOOTSTRAP:
+ name: "bootstrap_ceph_mon"
restart_policy: "never"
volumes:
- "{{ node_config_directory }}/ceph-mon/:{{ container_config_directory }}/:ro"
- "ceph_mon:/var/lib/ceph"
- "ceph_mon_config:/etc/ceph"
-- name: Waiting for a few settings for cluster to generate keys
- command: sleep 3
- changed_when: False
+- name: Starting ceph-mon container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ ceph_mon_image_full }}"
+ name: "ceph_mon"
+ volumes:
+ - "{{ node_config_directory }}/ceph-mon/:{{ container_config_directory }}/:ro"
+ - "ceph_mon:/var/lib/ceph"
+ - "ceph_mon_config:/etc/ceph"
- name: Setting host for cluster files
set_fact:
diff --git a/ansible/roles/ceph/tasks/start_osds.yml b/ansible/roles/ceph/tasks/start_osds.yml
index 151a28856..1324fd80e 100644
--- a/ansible/roles/ceph/tasks/start_osds.yml
+++ b/ansible/roles/ceph/tasks/start_osds.yml
@@ -1,6 +1,6 @@
---
- name: Looking up OSDs for Ceph
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m find_disks
-a "partition_name='KOLLA_CEPH_DATA'"
register: osd_lookup
diff --git a/ansible/roles/ceph/tasks/upgrade.yml b/ansible/roles/ceph/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/ceph/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/ceph/templates/ceph-mon.json.j2 b/ansible/roles/ceph/templates/ceph-mon.json.j2
index c4de81b8a..3ce4869e9 100644
--- a/ansible/roles/ceph/templates/ceph-mon.json.j2
+++ b/ansible/roles/ceph/templates/ceph-mon.json.j2
@@ -22,6 +22,13 @@
"optional": "True"
},
{
+ "source": "{{ container_config_directory }}/ceph.client.radosgw.keyring",
+ "dest": "/etc/ceph/ceph.client.radosgw.keyring",
+ "owner": "ceph",
+ "perm": "0600",
+ "optional": "True"
+ },
+ {
"source": "{{ container_config_directory }}/ceph.monmap",
"dest": "/etc/ceph/ceph.monmap",
"owner": "ceph",
diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml
index 688e67149..031ba942d 100644
--- a/ansible/roles/cinder/defaults/main.yml
+++ b/ansible/roles/cinder/defaults/main.yml
@@ -48,13 +48,12 @@ cinder_api_image_full: "{{ cinder_api_image }}:{{ cinder_api_tag }}"
####################
-# Openstack
+# OpenStack
####################
cinder_public_address: "{{ kolla_external_address }}"
cinder_admin_address: "{{ kolla_internal_address }}"
cinder_internal_address: "{{ kolla_internal_address }}"
-cinder_logging_verbose: "{{ openstack_logging_verbose }}"
cinder_logging_debug: "{{ openstack_logging_debug }}"
cinder_keystone_user: "cinder"
diff --git a/ansible/roles/cinder/tasks/bootstrap.yml b/ansible/roles/cinder/tasks/bootstrap.yml
index adafe2068..bf17ab6c3 100644
--- a/ansible/roles/cinder/tasks/bootstrap.yml
+++ b/ansible/roles/cinder/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Cinder database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -18,7 +18,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Cinder database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -43,8 +43,10 @@
environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- name: "bootstrap_cinder"
image: "{{ cinder_api_image_full }}"
+ labels:
+ BOOTSTRAP:
+ name: "bootstrap_cinder"
restart_policy: "never"
volumes: "{{ node_config_directory }}/cinder-api/:{{ container_config_directory }}/:ro"
run_once: True
diff --git a/ansible/roles/cinder/tasks/register.yml b/ansible/roles/cinder/tasks/register.yml
index aeb2e937d..3ce4fc858 100644
--- a/ansible/roles/cinder/tasks/register.yml
+++ b/ansible/roles/cinder/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Cinder service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=cinder
service_type=volume
description='Openstack Block Storage'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
- internal_url='http://{{ kolla_internal_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
- public_url='http://{{ kolla_external_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_cinder_auth }}' }}"
-e "{'openstack_cinder_auth':{{ openstack_cinder_auth }}}"
@@ -20,15 +20,15 @@
run_once: True
- name: Creating the Cinder v2 service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=cinderv2
service_type=volumev2
description='Openstack Block Storage'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
- internal_url='http://{{ kolla_internal_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
- public_url='http://{{ kolla_external_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ cinder_api_port }}/v2/%(tenant_id)s'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_cinder_auth }}' }}"
-e "{'openstack_cinder_auth':{{ openstack_cinder_auth }}}"
@@ -40,7 +40,7 @@
run_once: True
- name: Creating the Cinder project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=cinder
diff --git a/ansible/roles/cinder/tasks/start.yml b/ansible/roles/cinder/tasks/start.yml
index 16bce4ba3..909d238a3 100644
--- a/ansible/roles/cinder/tasks/start.yml
+++ b/ansible/roles/cinder/tasks/start.yml
@@ -7,7 +7,7 @@
image: "{{ cinder_api_image_full }}"
volumes:
- "{{ node_config_directory }}/cinder-api/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['cinder-api']
- name: Starting cinder-backup container
@@ -16,9 +16,11 @@
common_options: "{{ docker_common_options }}"
name: "cinder_backup"
image: "{{ cinder_backup_image_full }}"
+ privileged: True
volumes:
- "{{ node_config_directory }}/cinder-backup/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "/dev/mapper/:/dev/mapper/"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['cinder-backup']
- name: Starting cinder-scheduler container
@@ -29,7 +31,7 @@
image: "{{ cinder_scheduler_image_full }}"
volumes:
- "{{ node_config_directory }}/cinder-scheduler/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['cinder-scheduler']
- name: Starting cinder-volume container
@@ -43,5 +45,5 @@
- "{{ node_config_directory }}/cinder-volume/:{{ container_config_directory }}/:ro"
- "/dev/:/dev/"
- "/run/:/run/"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['cinder-volume']
diff --git a/ansible/roles/cinder/tasks/upgrade.yml b/ansible/roles/cinder/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/cinder/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2
index 95d6aa2ac..f7d4463c7 100644
--- a/ansible/roles/cinder/templates/cinder.conf.j2
+++ b/ansible/roles/cinder/templates/cinder.conf.j2
@@ -1,5 +1,5 @@
[DEFAULT]
-debug = true
+debug = {{ cinder_logging_debug }}
use_syslog = True
syslog_log_facility = LOG_LOCAL0
@@ -7,7 +7,7 @@ syslog_log_facility = LOG_LOCAL0
enable_v1_api=false
volume_name_template = %s
-glance_api_servers = http://{{ kolla_internal_address }}:{{ glance_api_port }}
+glance_api_servers = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ glance_api_port }}
glance_api_version = 2
os_region_name = {{ openstack_region_name }}
@@ -43,8 +43,8 @@ auth_strategy = keystone
connection = mysql+pymysql://{{ cinder_database_user }}:{{ cinder_database_password }}@{{ cinder_database_address }}/{{ cinder_database_name }}
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
diff --git a/ansible/roles/common/defaults/main.yml b/ansible/roles/common/defaults/main.yml
index e3895f118..7cf4384c5 100644
--- a/ansible/roles/common/defaults/main.yml
+++ b/ansible/roles/common/defaults/main.yml
@@ -6,7 +6,7 @@ common_run: False
####################
# Docker
####################
-ansible_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-kolla-ansible"
+ansible_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-kolla-toolbox"
ansible_tag: "{{ openstack_release }}"
ansible_image_full: "{{ ansible_image }}:{{ ansible_tag }}"
diff --git a/ansible/roles/common/tasks/pull.yml b/ansible/roles/common/tasks/pull.yml
index 1bd963bb8..c5ebeb621 100644
--- a/ansible/roles/common/tasks/pull.yml
+++ b/ansible/roles/common/tasks/pull.yml
@@ -5,7 +5,7 @@
common_options: "{{ docker_common_options }}"
image: "{{ rsyslog_image_full }}"
-- name: Pulling kolla-ansible image
+- name: Pulling kolla-toolbox image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
diff --git a/ansible/roles/common/tasks/start.yml b/ansible/roles/common/tasks/start.yml
index bbe9de2ce..ef94a684a 100644
--- a/ansible/roles/common/tasks/start.yml
+++ b/ansible/roles/common/tasks/start.yml
@@ -3,15 +3,18 @@
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
+ environment:
+ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
+ SKIP_LOG_SETUP:
image: "{{ rsyslog_image_full }}"
name: "rsyslog"
privileged: True
volumes:
- "{{ node_config_directory }}/rsyslog/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev:/dev"
- "rsyslog:/var/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
-- name: Starting kolla-ansible container
+- name: Starting kolla-toolbox container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
@@ -19,9 +22,9 @@
ANSIBLE_NOCOLOR: "1"
ANSIBLE_LIBRARY: "/usr/share/ansible"
image: "{{ ansible_image_full }}"
- name: "kolla_ansible"
+ name: "kolla_toolbox"
privileged: True
volumes:
- "/dev/:/dev/"
- "/run/:/run/"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
diff --git a/ansible/roles/common/tasks/upgrade.yml b/ansible/roles/common/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/common/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/common/templates/admin-openrc.sh.j2 b/ansible/roles/common/templates/admin-openrc.sh.j2
index 9ab250f6a..0626818cd 100644
--- a/ansible/roles/common/templates/admin-openrc.sh.j2
+++ b/ansible/roles/common/templates/admin-openrc.sh.j2
@@ -4,5 +4,5 @@ export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD={{ keystone_admin_password }}
-export OS_AUTH_URL=http://{{ kolla_internal_address }}:{{ keystone_admin_port }}/v3
+export OS_AUTH_URL={{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}/v3
export OS_IDENTITY_API_VERSION=3
diff --git a/ansible/roles/common/templates/rsyslog.conf.j2 b/ansible/roles/common/templates/rsyslog.conf.j2
index 280ff5ba9..e4d6e9ee8 100644
--- a/ansible/roles/common/templates/rsyslog.conf.j2
+++ b/ansible/roles/common/templates/rsyslog.conf.j2
@@ -1,13 +1,14 @@
# provides support for local system logging
$ModLoad imuxsock
+$AddUnixListenSocket /var/lib/kolla/rsyslog/log
$ModLoad imklog
$KLogPermitNonKernelFacility on
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$RepeatedMsgReduction on
-$template KollaAnsibleFile,"/var/log/kolla_ansible.log"
-:syslogtag,contains,"ansible" ?KollaAnsibleFile
+$template KollaToolboxFile,"/var/log/kolla_toolbox.log"
+:syslogtag,contains,"toolbox" ?KollaToolboxFile
$template GlanceApiFile,"/var/log/glance/glance_api.log"
:syslogtag,contains,"glance-api" ?GlanceApiFile
diff --git a/ansible/roles/glance/defaults/main.yml b/ansible/roles/glance/defaults/main.yml
index 0a3f9eb5b..c8035c61b 100644
--- a/ansible/roles/glance/defaults/main.yml
+++ b/ansible/roles/glance/defaults/main.yml
@@ -35,13 +35,12 @@ glance_api_image_full: "{{ glance_api_image }}:{{ glance_api_tag }}"
####################
-# Openstack
+# OpenStack
####################
glance_public_address: "{{ kolla_external_address }}"
glance_admin_address: "{{ kolla_internal_address }}"
glance_internal_address: "{{ kolla_internal_address }}"
-glance_logging_verbose: "{{ openstack_logging_verbose }}"
glance_logging_debug: "{{ openstack_logging_debug }}"
glance_keystone_user: "glance"
diff --git a/ansible/roles/glance/tasks/bootstrap.yml b/ansible/roles/glance/tasks/bootstrap.yml
index e06014ba4..800a04e54 100644
--- a/ansible/roles/glance/tasks/bootstrap.yml
+++ b/ansible/roles/glance/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Glance database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -19,7 +19,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Glance database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -45,6 +45,8 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ glance_api_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_glance"
restart_policy: "never"
volumes:
diff --git a/ansible/roles/glance/tasks/check.yml b/ansible/roles/glance/tasks/check.yml
index 73303b2ec..0ce7bf547 100644
--- a/ansible/roles/glance/tasks/check.yml
+++ b/ansible/roles/glance/tasks/check.yml
@@ -1,7 +1,7 @@
---
- name: Glance sanity checks
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_sanity
-a "service=glance
project=service
diff --git a/ansible/roles/glance/tasks/register.yml b/ansible/roles/glance/tasks/register.yml
index f5655e63e..9e2a11a67 100644
--- a/ansible/roles/glance/tasks/register.yml
+++ b/ansible/roles/glance/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Glance service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=glance
service_type=image
description='Openstack Image'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ glance_api_port }}'
- internal_url='http://{{ kolla_internal_address }}:{{ glance_api_port }}'
- public_url='http://{{ kolla_external_address }}:{{ glance_api_port }}'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ glance_api_port }}'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ glance_api_port }}'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ glance_api_port }}'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_glance_auth }}' }}"
-e "{'openstack_glance_auth':{{ openstack_glance_auth }}}"
@@ -20,7 +20,7 @@
run_once: True
- name: Creating the Glance project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=glance
diff --git a/ansible/roles/glance/tasks/start.yml b/ansible/roles/glance/tasks/start.yml
index 51e6cb4a3..50718cc38 100644
--- a/ansible/roles/glance/tasks/start.yml
+++ b/ansible/roles/glance/tasks/start.yml
@@ -7,7 +7,7 @@
name: "glance_registry"
volumes:
- "{{ node_config_directory }}/glance-registry/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['glance-registry']
- name: Starting glance-api container
@@ -18,6 +18,6 @@
name: "glance_api"
volumes:
- "{{ node_config_directory }}/glance-api/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- "glance:/var/lib/glance/"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['glance-api']
diff --git a/ansible/roles/glance/tasks/upgrade.yml b/ansible/roles/glance/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/glance/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/glance/templates/glance-api.conf.j2 b/ansible/roles/glance/templates/glance-api.conf.j2
index 7dcff9150..685b2049e 100644
--- a/ansible/roles/glance/templates/glance-api.conf.j2
+++ b/ansible/roles/glance/templates/glance-api.conf.j2
@@ -1,5 +1,5 @@
[DEFAULT]
-debug = true
+debug = {{ glance_logging_debug }}
bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
bind_port = {{ glance_api_port }}
@@ -18,8 +18,8 @@ show_image_direct_url= True
connection = mysql+pymysql://{{ glance_database_user }}:{{ glance_database_password }}@{{ glance_database_address }}/{{ glance_database_name }}
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
diff --git a/ansible/roles/glance/templates/glance-registry.conf.j2 b/ansible/roles/glance/templates/glance-registry.conf.j2
index a49e945aa..db3e58c80 100644
--- a/ansible/roles/glance/templates/glance-registry.conf.j2
+++ b/ansible/roles/glance/templates/glance-registry.conf.j2
@@ -1,5 +1,5 @@
[DEFAULT]
-debug = true
+debug = {{ glance_logging_debug }}
bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
bind_port = {{ glance_registry_port }}
@@ -12,8 +12,8 @@ syslog_log_facility = LOG_LOCAL0
connection = mysql+pymysql://{{ glance_database_user }}:{{ glance_database_password }}@{{ glance_database_address }}/{{ glance_database_name }}
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
diff --git a/ansible/roles/haproxy/tasks/upgrade.yml b/ansible/roles/haproxy/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/haproxy/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2
index fd520d6ed..e8af22ea1 100644
--- a/ansible/roles/haproxy/templates/haproxy.cfg.j2
+++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2
@@ -42,6 +42,14 @@ listen rabbitmq_management
{% endfor %}
{% endif %}
+{% if enable_mongodb | bool %}
+listen mongodb
+ bind {{ kolla_internal_address }}:{{ mongodb_port }}
+{% for host in groups['mongodb'] %}
+ server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mongodb_port }} check inter 2000 rise 2 fall 5
+{% endfor %}
+{% endif %}
+
{% if enable_keystone | bool %}
listen keystone_public
bind {{ kolla_internal_address }}:{{ keystone_public_port }}
diff --git a/ansible/roles/heat/defaults/main.yml b/ansible/roles/heat/defaults/main.yml
index de9d644a8..ae0d1729b 100644
--- a/ansible/roles/heat/defaults/main.yml
+++ b/ansible/roles/heat/defaults/main.yml
@@ -25,13 +25,12 @@ heat_engine_tag: "{{ openstack_release }}"
heat_engine_image_full: "{{ heat_engine_image }}:{{ heat_engine_tag }}"
####################
-# Openstack
+# OpenStack
####################
heat_public_address: "{{ kolla_external_address }}"
heat_admin_address: "{{ kolla_internal_address }}"
heat_internal_address: "{{ kolla_internal_address }}"
-heat_logging_verbose: "{{ openstack_logging_verbose }}"
heat_logging_debug: "{{ openstack_logging_debug }}"
heat_keystone_user: "heat"
diff --git a/ansible/roles/heat/tasks/bootstrap.yml b/ansible/roles/heat/tasks/bootstrap.yml
index fb23a6c36..fa6fde538 100644
--- a/ansible/roles/heat/tasks/bootstrap.yml
+++ b/ansible/roles/heat/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Heat database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -18,7 +18,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Heat database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -50,6 +50,8 @@
OS_PROJECT_NAME: "{{ openstack_auth.project_name }}"
HEAT_DOMAIN_ADMIN_PASSWORD: "{{ heat_domain_admin_password }}"
image: "{{ heat_api_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_heat"
volumes: "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro"
run_once: True
diff --git a/ansible/roles/heat/tasks/register.yml b/ansible/roles/heat/tasks/register.yml
index 3cd89b94b..e9b8127d4 100644
--- a/ansible/roles/heat/tasks/register.yml
+++ b/ansible/roles/heat/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Heat service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=heat
service_type=orchestration
description='Openstack Orchestration'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ heat_api_port }}/v1/%(tenant_id)s'
- internal_url='http://{{ kolla_internal_address }}:{{ heat_api_port }}/v1/%(tenant_id)s'
- public_url='http://{{ kolla_external_address }}:{{ heat_api_port }}/v1/%(tenant_id)s'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ heat_api_port }}/v1/%(tenant_id)s'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ heat_api_port }}/v1/%(tenant_id)s'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ heat_api_port }}/v1/%(tenant_id)s'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_heat_auth }}' }}"
-e "{'openstack_heat_auth':{{ openstack_heat_auth }}}"
@@ -20,15 +20,15 @@
run_once: True
- name: Creating the Heat-cfn service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=heat-cfn
service_type=orchestration
description='Openstack Orchestration'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ heat_api_port }}/v1'
- internal_url='http://{{ kolla_internal_address }}:{{ heat_api_cfn_port }}/v1'
- public_url='http://{{ kolla_external_address }}:{{ heat_api_cfn_port }}/v1'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ heat_api_port }}/v1'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ heat_api_cfn_port }}/v1'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ heat_api_cfn_port }}/v1'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_heat_auth }}' }}"
-e "{'openstack_heat_auth':{{ openstack_heat_auth }}}"
@@ -40,7 +40,7 @@
run_once: True
- name: Creating the Heat project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=heat
diff --git a/ansible/roles/heat/tasks/start.yml b/ansible/roles/heat/tasks/start.yml
index 29571818e..6699ab472 100644
--- a/ansible/roles/heat/tasks/start.yml
+++ b/ansible/roles/heat/tasks/start.yml
@@ -7,7 +7,7 @@
name: "heat_api"
volumes:
- "{{ node_config_directory }}/heat-api/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['heat-api']
- name: Starting heat-api-cfn container
@@ -18,7 +18,7 @@
name: "heat_api_cfn"
volumes:
- "{{ node_config_directory }}/heat-api-cfn/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['heat-api-cfn']
- name: Starting heat-engine container
@@ -29,5 +29,5 @@
name: "heat_engine"
volumes:
- "{{ node_config_directory }}/heat-engine/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['heat-engine']
diff --git a/ansible/roles/heat/tasks/upgrade.yml b/ansible/roles/heat/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/heat/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/heat/templates/heat.conf.j2 b/ansible/roles/heat/templates/heat.conf.j2
index 27e0162ea..5d8afa05e 100644
--- a/ansible/roles/heat/templates/heat.conf.j2
+++ b/ansible/roles/heat/templates/heat.conf.j2
@@ -1,14 +1,18 @@
[DEFAULT]
-heat_watch_server_url = http://{{ kolla_external_address }}:{{ heat_api_cfn_port }}
-heat_metadata_server_url = http://{{ kolla_external_address }}:{{ heat_api_cfn_port }}
-heat_waitcondition_server_url = http://{{ kolla_external_address }}:{{ heat_api_cfn_port }}/v1/waitcondition
+debug = {{ heat_logging_debug }}
+
+heat_watch_server_url = {{ public_protocol }}://{{ kolla_external_address }}:{{ heat_api_cfn_port }}
+heat_metadata_server_url = {{ public_protocol }}://{{ kolla_external_address }}:{{ heat_api_cfn_port }}
+heat_waitcondition_server_url = {{ public_protocol }}://{{ kolla_external_address }}:{{ heat_api_cfn_port }}/v1/waitcondition
stack_domain_admin = heat_domain_admin
stack_domain_admin_password = {{ heat_domain_admin_password }}
stack_user_domain_name = heat_user_domain
rpc_backend = rabbit
-deferred_auth_method = password
+notification_driver = noop
+deferred_auth_method = trusts
+trusts_delegated_role = heat_stack_owner
syslog_log_facility=LOG_LOCAL0
use_syslog=yes
@@ -35,9 +39,19 @@ bind_port = {{ heat_api_cfn_port }}
connection = mysql+pymysql://{{ heat_database_user }}:{{ heat_database_password }}@{{ heat_database_address }}/{{ heat_database_name }}
[keystone_authtoken]
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_type = password
+project_domain_id = default
+user_domain_id = default
+project_name = service
+username = heat
+password = {{ heat_keystone_password }}
+
+[trustee]
auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
-auth_type = password
+auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
@@ -45,10 +59,10 @@ username = heat
password = {{ heat_keystone_password }}
[ec2authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
[clients_keystone]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
[oslo_messaging_notifications]
driver = noop
diff --git a/ansible/roles/horizon/tasks/upgrade.yml b/ansible/roles/horizon/tasks/upgrade.yml
new file mode 100644
index 000000000..4586b4fab
--- /dev/null
+++ b/ansible/roles/horizon/tasks/upgrade.yml
@@ -0,0 +1,5 @@
+---
+- include: config.yml
+
+- include: start.yml
+ serial: "30%"
diff --git a/ansible/roles/horizon/templates/local_settings.j2 b/ansible/roles/horizon/templates/local_settings.j2
index 9b7279b67..65d9586bd 100644
--- a/ansible/roles/horizon/templates/local_settings.j2
+++ b/ansible/roles/horizon/templates/local_settings.j2
@@ -148,7 +148,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
#]
OPENSTACK_HOST = "{{ kolla_external_address }}"
-OPENSTACK_KEYSTONE_URL = "http://%s:{{ keystone_public_port }}/v3" % OPENSTACK_HOST
+OPENSTACK_KEYSTONE_URL = "{{ public_protocol }}://%s:{{ keystone_public_port }}/v3" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_"
# Enables keystone web single-sign-on if set to True.
diff --git a/ansible/roles/ironic/defaults/main.yml b/ansible/roles/ironic/defaults/main.yml
index 8a9ee32cd..a670905ac 100644
--- a/ansible/roles/ironic/defaults/main.yml
+++ b/ansible/roles/ironic/defaults/main.yml
@@ -30,13 +30,12 @@ ironic_pxe_image_full: "{{ ironic_pxe_image }}:{{ ironic_pxe_tag }}"
####################
-# Openstack
+# OpenStack
####################
ironic_public_address: "{{ kolla_external_address }}"
ironic_admin_address: "{{ kolla_internal_address }}"
ironic_internal_address: "{{ kolla_internal_address }}"
-ironic_logging_verbose: "{{ openstack_logging_verbose }}"
ironic_logging_debug: "{{ openstack_logging_debug }}"
openstack_ironic_auth: "{'auth_url':'{{ openstack_auth_v2.auth_url }}','username':'{{ openstack_auth_v2.username }}','password':'{{ openstack_auth_v2.password }}','project_name':'{{ openstack_auth_v2.project_name }}'}"
diff --git a/ansible/roles/ironic/tasks/bootstrap.yml b/ansible/roles/ironic/tasks/bootstrap.yml
index d33859fae..3f7ceca5f 100644
--- a/ansible/roles/ironic/tasks/bootstrap.yml
+++ b/ansible/roles/ironic/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Ironic database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_port='{{ mariadb_port }}'
@@ -19,7 +19,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Ironic database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_port='{{ mariadb_port }}'
@@ -46,9 +46,30 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ ironic_api_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_ironic"
restart_policy: "never"
volumes: "{{ node_config_directory }}/ironic-api/:{{ container_config_directory }}/:ro"
run_once: True
delegate_to: "{{ groups['ironic-api'][0] }}"
when: database_created
+
+- name: Running Ironic-PXE bootstrap container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ detach: False
+ environment:
+ KOLLA_BOOTSTRAP:
+ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
+ image: "{{ ironic_pxe_image_full }}"
+ labels:
+ BOOTSTRAP:
+ name: "bootstrap_ironic_pxe"
+ restart_policy: "never"
+ volumes:
+ - "{{ node_config_directory }}/ironic-pxe/:{{ container_config_directory }}/:ro"
+ - "ironic-pxe:/tftpboot/"
+ run_once: True
+ delegate_to: "{{ groups['ironic-pxe'][0] }}"
diff --git a/ansible/roles/ironic/tasks/register.yml b/ansible/roles/ironic/tasks/register.yml
index 518fa3a49..fc44611b3 100644
--- a/ansible/roles/ironic/tasks/register.yml
+++ b/ansible/roles/ironic/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Ironic service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=ironic
service_type=baremetal
description='Ironic bare metal provisioning service'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ ironic_admin_address }}:{{ ironic_api_port }}'
- internal_url='http://{{ ironic_internal_address }}:{{ ironic_api_port }}'
- public_url='http://{{ ironic_public_address }}:{{ ironic_api_port }}'
+ admin_url='{{ admin_protocol }}://{{ ironic_admin_address }}:{{ ironic_api_port }}'
+ internal_url='{{ internal_protocol }}://{{ ironic_internal_address }}:{{ ironic_api_port }}'
+ public_url='{{ public_protocol }}://{{ ironic_public_address }}:{{ ironic_api_port }}'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_ironic_auth }}' }}"
-e "{'openstack_ironic_auth':{{ openstack_ironic_auth }}}"
@@ -20,7 +20,7 @@
run_once: True
- name: Creating the Ironic project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user={{ ironic_keystone_user }}
diff --git a/ansible/roles/ironic/tasks/upgrade.yml b/ansible/roles/ironic/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/ironic/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/ironic/templates/discoverd.conf.j2 b/ansible/roles/ironic/templates/discoverd.conf.j2
index 1f64d564a..151fcfa9d 100644
--- a/ansible/roles/ironic/templates/discoverd.conf.j2
+++ b/ansible/roles/ironic/templates/discoverd.conf.j2
@@ -1,6 +1,6 @@
[discoverd]
database = inspector.sqlite3
-os_auth_url = http://{{ kolla_internal_address }}:{{ keystone_public_port }}/v2.0
+os_auth_url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}/v2.0
os_username = {{ openstack_auth.username }}
os_password = {{ openstack_auth.password }}
os_tenant_name = {{ openstack_auth.project_name }}
diff --git a/ansible/roles/ironic/templates/ironic-pxe.json.j2 b/ansible/roles/ironic/templates/ironic-pxe.json.j2
index f8f1666e7..3fdf9d88b 100644
--- a/ansible/roles/ironic/templates/ironic-pxe.json.j2
+++ b/ansible/roles/ironic/templates/ironic-pxe.json.j2
@@ -1,4 +1,4 @@
{
- "command": "/usr/sbin/in.tftpd --verbose --foreground --user root --address 0.0.0.0:69 --map-file /tftpboot/map-file /tftpboot",
+ "command": "/usr/sbin/in.tftpd --verbose --foreground --user root --address 0.0.0.0:69 --map-file /map-file /tftpboot",
"config_files": []
}
diff --git a/ansible/roles/ironic/templates/ironic.conf.j2 b/ansible/roles/ironic/templates/ironic.conf.j2
index 0a0634991..f100b681f 100644
--- a/ansible/roles/ironic/templates/ironic.conf.j2
+++ b/ansible/roles/ironic/templates/ironic.conf.j2
@@ -10,7 +10,7 @@ host_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['a
{% if service_name == 'ironic-conductor' %}
[conductor]
-api_url = http://{{ kolla_internal_address }}:{{ ironic_api_port }}
+api_url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ ironic_api_port }}
clean_nodes = false
{% endif %}
@@ -18,8 +18,8 @@ clean_nodes = false
connection = mysql+pymysql://{{ ironic_database_user }}:{{ ironic_database_password }}@{{ ironic_database_address }}/{{ ironic_database_name }}
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
@@ -31,7 +31,7 @@ password = {{ ironic_keystone_password }}
glance_host = {{ kolla_internal_address }}
[neutron]
-url = http://{{ kolla_internal_address }}:{{ neutron_server_port }}
+url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ neutron_server_port }}
[oslo_messaging_rabbit]
rabbit_userid = {{ rabbitmq_user }}
diff --git a/ansible/roles/keystone/defaults/main.yml b/ansible/roles/keystone/defaults/main.yml
index 2f3b15524..8c7a4a0ef 100644
--- a/ansible/roles/keystone/defaults/main.yml
+++ b/ansible/roles/keystone/defaults/main.yml
@@ -18,13 +18,12 @@ keystone_image_full: "{{ keystone_image }}:{{ keystone_tag }}"
####################
-# Openstack
+# OpenStack
####################
keystone_public_address: "{{ kolla_external_address }}"
keystone_admin_address: "{{ kolla_internal_address }}"
keystone_internal_address: "{{ kolla_internal_address }}"
-keystone_logging_verbose: "{{ openstack_logging_verbose }}"
keystone_logging_debug: "{{ openstack_logging_debug }}"
openstack_keystone_auth: "{'auth_url':'{{ openstack_auth_v2.auth_url }}','username':'{{ openstack_auth_v2.username }}','password':'{{ openstack_auth_v2.password }}','project_name':'{{ openstack_auth_v2.project_name }}'}"
diff --git a/ansible/roles/keystone/tasks/bootstrap.yml b/ansible/roles/keystone/tasks/bootstrap.yml
index dc1ecd626..1694cdb79 100644
--- a/ansible/roles/keystone/tasks/bootstrap.yml
+++ b/ansible/roles/keystone/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Keystone database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_port='{{ mariadb_port }}'
@@ -19,7 +19,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Keystone database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_port='{{ mariadb_port }}'
diff --git a/ansible/roles/keystone/tasks/bootstrap_service.yml b/ansible/roles/keystone/tasks/bootstrap_service.yml
index 6b8ad2bfa..b522ea036 100644
--- a/ansible/roles/keystone/tasks/bootstrap_service.yml
+++ b/ansible/roles/keystone/tasks/bootstrap_service.yml
@@ -8,6 +8,8 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ keystone_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_keystone"
restart_policy: "never"
volumes: "{{ node_config_directory }}/keystone/:{{ container_config_directory }}/:ro"
diff --git a/ansible/roles/keystone/tasks/check.yml b/ansible/roles/keystone/tasks/check.yml
index 328a5e387..53842721b 100644
--- a/ansible/roles/keystone/tasks/check.yml
+++ b/ansible/roles/keystone/tasks/check.yml
@@ -1,7 +1,7 @@
---
- name: Keystone sanity checks
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_sanity
-a "service=keystone
project=service
diff --git a/ansible/roles/keystone/tasks/register.yml b/ansible/roles/keystone/tasks/register.yml
index a401624cf..2b9af5a60 100644
--- a/ansible/roles/keystone/tasks/register.yml
+++ b/ansible/roles/keystone/tasks/register.yml
@@ -1,6 +1,6 @@
---
- name: Creating the admin project, user and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=admin
user=admin
@@ -18,15 +18,15 @@
run_once: True
- name: Creating the Keystone service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=keystone
service_type=identity
description='Openstack Identity'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ keystone_admin_port }}'
- internal_url='http://{{ kolla_internal_address }}:{{ keystone_admin_port }}'
- public_url='http://{{ kolla_external_address }}:{{ keystone_public_port }}'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ keystone_public_port }}'
region_name={{ openstack_region_name }}
auth_type=admin_token
auth={{ '{{ openstack_keystone_token_auth }}' }}"
diff --git a/ansible/roles/keystone/tasks/start.yml b/ansible/roles/keystone/tasks/start.yml
index c70f8e723..c9271ef59 100644
--- a/ansible/roles/keystone/tasks/start.yml
+++ b/ansible/roles/keystone/tasks/start.yml
@@ -7,7 +7,7 @@
name: "keystone"
volumes:
- "{{ node_config_directory }}/keystone/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
- name: Wait for keystone startup
wait_for: host={{ keystone_admin_address }} port={{ keystone_admin_port }}
diff --git a/ansible/roles/kibana/defaults/main.yml b/ansible/roles/kibana/defaults/main.yml
new file mode 100644
index 000000000..be14a522e
--- /dev/null
+++ b/ansible/roles/kibana/defaults/main.yml
@@ -0,0 +1,24 @@
+---
+####################
+# Kibana
+####################
+kibana_port: "{{ kibana_port }}"
+kibana_host: "{{ kolla_internal_address }}"
+kibana_app_id: "discover"
+kibana_request_timeout: 300000
+kibana_shard_timeout: 0
+kibana_verify_ssl: false
+
+
+####################
+# Docker
+####################
+kibana_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-kibana"
+kibana_tag: "{{ openstack_release }}"
+kibana_image_full: "{{ kibana_image }}:{{ kibana_tag }}"
+
+
+####################
+# Elasticsearch
+####################
+elasticsearch_preserve_host: "true"
diff --git a/ansible/roles/kibana/meta/main.yml b/ansible/roles/kibana/meta/main.yml
new file mode 100644
index 000000000..6b4fff8fe
--- /dev/null
+++ b/ansible/roles/kibana/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - { role: common }
diff --git a/ansible/roles/kibana/tasks/config.yml b/ansible/roles/kibana/tasks/config.yml
new file mode 100644
index 000000000..edccb229c
--- /dev/null
+++ b/ansible/roles/kibana/tasks/config.yml
@@ -0,0 +1,22 @@
+---
+- name: Ensuring kibana config directories exist
+ file:
+ path: "{{ node_config_directory }}/{{ item }}"
+ state: "directory"
+ recurse: yes
+ with_items:
+ - "kibana"
+
+- name: Copying over config.json files for services
+ template:
+ src: "{{ item }}.json.j2"
+ dest: "{{ node_config_directory }}/{{ item }}/config.json"
+ with_items:
+ - "kibana"
+
+- name: Copying over Kibana configuration file
+ template:
+ src: "{{ item }}.yml.j2"
+ dest: "{{ node_config_directory }}/{{ item }}/{{ item }}.yml"
+ with_items:
+ - "kibana"
diff --git a/ansible/roles/kibana/tasks/deploy.yml b/ansible/roles/kibana/tasks/deploy.yml
new file mode 100644
index 000000000..1f16915ad
--- /dev/null
+++ b/ansible/roles/kibana/tasks/deploy.yml
@@ -0,0 +1,4 @@
+---
+- include: config.yml
+
+- include: start.yml
diff --git a/ansible/roles/kibana/tasks/main.yml b/ansible/roles/kibana/tasks/main.yml
new file mode 100644
index 000000000..b017e8b4a
--- /dev/null
+++ b/ansible/roles/kibana/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+- include: "{{ action }}.yml"
diff --git a/ansible/roles/kibana/tasks/pull.yml b/ansible/roles/kibana/tasks/pull.yml
new file mode 100644
index 000000000..b97d0029d
--- /dev/null
+++ b/ansible/roles/kibana/tasks/pull.yml
@@ -0,0 +1,5 @@
+- name: Pulling Kibana image
+ kolla_docker:
+ action: "pull_image"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ kibana_image_full }}"
diff --git a/ansible/roles/kibana/tasks/start.yml b/ansible/roles/kibana/tasks/start.yml
new file mode 100644
index 000000000..104ff8e37
--- /dev/null
+++ b/ansible/roles/kibana/tasks/start.yml
@@ -0,0 +1,9 @@
+---
+- name: Starting Kibana container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ kibana_image_full }}"
+ name: "kibana"
+ volumes:
+ - "{{ node_config_directory }}/kibana/:{{ container_config_directory }}/:ro"
diff --git a/ansible/roles/kibana/tasks/upgrade.yml b/ansible/roles/kibana/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/kibana/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/kibana/templates/kibana.json.j2 b/ansible/roles/kibana/templates/kibana.json.j2
new file mode 100644
index 000000000..9410a07d9
--- /dev/null
+++ b/ansible/roles/kibana/templates/kibana.json.j2
@@ -0,0 +1,11 @@
+{
+ "command": "/opt/kibana/bin/kibana",
+ "config_files": [
+ {
+ "source": "{{ container_config_directory }}/kibana.yml",
+ "dest": "/opt/kibana/config/kibana.yml",
+ "owner": "kibana",
+ "perm": "0640"
+ }
+ ]
+}
diff --git a/ansible/roles/kibana/templates/kibana.yml.j2 b/ansible/roles/kibana/templates/kibana.yml.j2
new file mode 100644
index 000000000..00186c4f4
--- /dev/null
+++ b/ansible/roles/kibana/templates/kibana.yml.j2
@@ -0,0 +1,19 @@
+port: {{ kibana_port }}
+host: {{ kibana_host }}
+elasticsearch_url: "{{ internal_protocol }}://{{ kolla_internal_address }}:{{ elasticsearch_port }}"
+elasticsearch_preserve_host: {{ elasticsearch_preserve_host }}
+default_app_id: {{ kibana_app_id }}
+request_timeout: {{ kibana_request_timeout }}
+shard_timeout: {{ kibana_shard_timeout }}
+verify_ssl: {{ kibana_verify_ssl }}
+bundled_plugin_ids:
+ - plugins/dashboard/index
+ - plugins/discover/index
+ - plugins/doc/index
+ - plugins/kibana/index
+ - plugins/markdown_vis/index
+ - plugins/metric_vis/index
+ - plugins/settings/index
+ - plugins/table_vis/index
+ - plugins/vis_types/index
+ - plugins/visualize/index
diff --git a/ansible/roles/magnum/defaults/main.yml b/ansible/roles/magnum/defaults/main.yml
index 6d3ec0032..9faaf67e4 100644
--- a/ansible/roles/magnum/defaults/main.yml
+++ b/ansible/roles/magnum/defaults/main.yml
@@ -21,13 +21,12 @@ magnum_conductor_image_full: "{{ magnum_conductor_image }}:{{ magnum_conductor_t
####################
-# Openstack
+# OpenStack
####################
magnum_public_address: "{{ kolla_external_address }}"
magnum_admin_address: "{{ kolla_internal_address }}"
magnum_internal_address: "{{ kolla_internal_address }}"
-magnum_logging_verbose: "{{ openstack_logging_verbose }}"
magnum_logging_debug: "{{ openstack_logging_debug }}"
magnum_keystone_user: "magnum"
diff --git a/ansible/roles/magnum/tasks/bootstrap.yml b/ansible/roles/magnum/tasks/bootstrap.yml
index e72df328b..21a4f9698 100644
--- a/ansible/roles/magnum/tasks/bootstrap.yml
+++ b/ansible/roles/magnum/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Magnum database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -18,7 +18,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Magnum database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -44,6 +44,8 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ magnum_api_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_magnum"
restart_policy: "never"
volumes: "{{ node_config_directory }}/magnum-api/:{{ container_config_directory }}/:ro"
diff --git a/ansible/roles/magnum/tasks/register.yml b/ansible/roles/magnum/tasks/register.yml
index aff9c38b2..6e17ccd7a 100644
--- a/ansible/roles/magnum/tasks/register.yml
+++ b/ansible/roles/magnum/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Magnum service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=magnum
service_type=container
description='Openstack Container Service'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ magnum_api_port }}/v1'
- internal_url='http://{{ kolla_internal_address }}:{{ magnum_api_port }}/v1'
- public_url='http://{{ kolla_external_address }}:{{ magnum_api_port }}/v1'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ magnum_api_port }}/v1'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ magnum_api_port }}/v1'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ magnum_api_port }}/v1'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_magnum_auth }}' }}"
-e "{'openstack_magnum_auth':{{ openstack_magnum_auth }}}"
@@ -20,7 +20,7 @@
run_once: True
- name: Creating the Magnum project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=magnum
diff --git a/ansible/roles/magnum/tasks/start.yml b/ansible/roles/magnum/tasks/start.yml
index e103321eb..51b713684 100644
--- a/ansible/roles/magnum/tasks/start.yml
+++ b/ansible/roles/magnum/tasks/start.yml
@@ -7,7 +7,7 @@
name: "magnum_api"
volumes:
- "{{ node_config_directory }}/magnum-api/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['magnum-api']
- name: Starting magnum-conductor container
@@ -18,5 +18,5 @@
name: "magnum_conductor"
volumes:
- "{{ node_config_directory }}/magnum-conductor/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['magnum-conductor']
diff --git a/ansible/roles/magnum/tasks/upgrade.yml b/ansible/roles/magnum/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/magnum/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/magnum/templates/magnum.conf.j2 b/ansible/roles/magnum/templates/magnum.conf.j2
index b673887c5..6a2572064 100644
--- a/ansible/roles/magnum/templates/magnum.conf.j2
+++ b/ansible/roles/magnum/templates/magnum.conf.j2
@@ -1,5 +1,5 @@
[DEFAULT]
-debug = {{ openstack_logging_debug }}
+debug = {{ magnum_logging_debug }}
use_syslog = true
syslog_log_facility = LOG_LOCAL0
@@ -17,8 +17,8 @@ connection = mysql+pymysql://{{ magnum_database_user }}:{{ magnum_database_passw
region_name = {{ openstack_region_name }}
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
@@ -27,8 +27,8 @@ username = {{ magnum_keystone_user }}
password = {{ magnum_keystone_password }}
[trustee]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
diff --git a/ansible/roles/mariadb/tasks/bootstrap.yml b/ansible/roles/mariadb/tasks/bootstrap.yml
index af7d8f308..aef939226 100644
--- a/ansible/roles/mariadb/tasks/bootstrap.yml
+++ b/ansible/roles/mariadb/tasks/bootstrap.yml
@@ -11,20 +11,18 @@
always_run: True
run_once: True
-# TODO(SamYaple): Improve failed_when check
-- name: Checking if a previous cluster exists
- command: docker exec mariadb stat /var/lib/mysql/grastate.dat
- register: exists
- changed_when: False
- failed_when: False
- always_run: True
- run_once: True
+- name: Creating mariadb volume
+ kolla_docker:
+ action: "create_volume"
+ common_options: "{{ docker_common_options }}"
+ name: "mariadb"
+ register: mariadb_volume
- name: Writing hostname of host with existing cluster files to temp file
local_action: copy content={{ ansible_hostname }} dest=/tmp/kolla_mariadb_cluster mode=0600
changed_when: False
always_run: True
- when: exists.rc == 0
+ when: not mariadb_volume | changed
- name: Registering host from temp file
set_fact:
@@ -44,21 +42,26 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
DB_ROOT_PASSWORD: "{{ database_password }}"
- DB_PID_FILE: "/var/lib/mysql/{{ hostvars[inventory_hostname]['ansible_hostname'] }}-galera.pid"
DB_MAX_TIMEOUT: "{{ database_max_timeout }}"
image: "{{ mariadb_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "mariadb"
restart_policy: "never"
volumes:
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
- "mariadb:/var/lib/mysql"
- when: delegate_host == 'None' and inventory_hostname == groups['mariadb'][0]
+ when:
+ - delegate_host == 'None'
+ - inventory_hostname == groups['mariadb'][0]
- name: Waiting for MariaDB service to be ready
- command: "docker exec mariadb ls /var/lib/mysql/{{ hostvars[inventory_hostname]['ansible_hostname'] }}-galera.pid /var/lib/mysql/cluster.exists"
+ command: "docker exec mariadb ls /var/lib/mysql/mariadb.pid"
register: bootstrap_result
- when: delegate_host == 'None' and inventory_hostname == groups['mariadb'][0]
- until: bootstrap_result|success
+ when:
+ - delegate_host == 'None'
+ - inventory_hostname == groups['mariadb'][0]
+ until: bootstrap_result | success
changed_when: False
retries: 6
delay: 10
diff --git a/ansible/roles/mariadb/tasks/check.yml b/ansible/roles/mariadb/tasks/check.yml
new file mode 100644
index 000000000..80a4e5240
--- /dev/null
+++ b/ansible/roles/mariadb/tasks/check.yml
@@ -0,0 +1,8 @@
+---
+- name: Waiting for MariaDB service to be ready through VIP
+ command: "docker exec mariadb mysql -h {{ kolla_internal_address }} -u haproxy -e 'show databases;'"
+ register: result
+ until: result | success
+ changed_when: False
+ retries: 6
+ delay: 10
diff --git a/ansible/roles/mariadb/tasks/deploy.yml b/ansible/roles/mariadb/tasks/deploy.yml
index c13e4eb0a..93f19edce 100644
--- a/ansible/roles/mariadb/tasks/deploy.yml
+++ b/ansible/roles/mariadb/tasks/deploy.yml
@@ -18,3 +18,6 @@
# Since the last start.yml may have recreated some containers we must wait and
# check the health again to ensure the hosts are active.
- include: register.yml
+
+# Test haproxy user through VIP
+- include: check.yml
diff --git a/ansible/roles/mariadb/tasks/register.yml b/ansible/roles/mariadb/tasks/register.yml
index 0aa72d2c3..279e4cb61 100644
--- a/ansible/roles/mariadb/tasks/register.yml
+++ b/ansible/roles/mariadb/tasks/register.yml
@@ -1,6 +1,6 @@
---
- name: Creating haproxy mysql user
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}'
login_port='{{ mariadb_port }}'
diff --git a/ansible/roles/mariadb/tasks/start.yml b/ansible/roles/mariadb/tasks/start.yml
index cfc12c063..8216b5eb8 100644
--- a/ansible/roles/mariadb/tasks/start.yml
+++ b/ansible/roles/mariadb/tasks/start.yml
@@ -13,7 +13,7 @@
( delegate_host == 'None' and inventory_hostname != groups['mariadb'][0] )
- name: Waiting for MariaDB service to be ready
- command: "docker exec mariadb ls /var/lib/mysql/{{ hostvars[inventory_hostname]['ansible_hostname'] }}-galera.pid"
+ command: "docker exec mariadb ls /var/lib/mysql/mariadb.pid"
register: bootstrap_result
when: delegate_host != 'None' or
( groups['mariadb'] | length ) == 1 or
diff --git a/ansible/roles/mariadb/tasks/upgrade.yml b/ansible/roles/mariadb/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/mariadb/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/mariadb/templates/galera.cnf.j2 b/ansible/roles/mariadb/templates/galera.cnf.j2
index 4e1039268..9f9ed3ecd 100644
--- a/ansible/roles/mariadb/templates/galera.cnf.j2
+++ b/ansible/roles/mariadb/templates/galera.cnf.j2
@@ -26,4 +26,4 @@ wsrep_slave_threads=4
max_connections=1000
[server]
-pid-file=/var/lib/mysql/{{ ansible_hostname }}-galera.pid
+pid-file=/var/lib/mysql/mariadb.pid
diff --git a/ansible/roles/memcached/tasks/upgrade.yml b/ansible/roles/memcached/tasks/upgrade.yml
new file mode 100644
index 000000000..4586b4fab
--- /dev/null
+++ b/ansible/roles/memcached/tasks/upgrade.yml
@@ -0,0 +1,5 @@
+---
+- include: config.yml
+
+- include: start.yml
+ serial: "30%"
diff --git a/ansible/roles/mistral/defaults/main.yml b/ansible/roles/mistral/defaults/main.yml
index 8de4c38a2..d72baa8a6 100644
--- a/ansible/roles/mistral/defaults/main.yml
+++ b/ansible/roles/mistral/defaults/main.yml
@@ -26,13 +26,12 @@ mistral_api_image_full: "{{ mistral_api_image }}:{{ mistral_api_tag }}"
####################
-# Openstack
+# OpenStack
####################
mistral_public_address: "{{ kolla_external_address }}"
mistral_admin_address: "{{ kolla_internal_address }}"
mistral_internal_address: "{{ kolla_internal_address }}"
-mistral_logging_verbose: "{{ openstack_logging_verbose }}"
mistral_logging_debug: "{{ openstack_logging_debug }}"
mistral_keystone_user: "mistral"
diff --git a/ansible/roles/mistral/tasks/bootstrap.yml b/ansible/roles/mistral/tasks/bootstrap.yml
index 0373842a5..ff659c026 100644
--- a/ansible/roles/mistral/tasks/bootstrap.yml
+++ b/ansible/roles/mistral/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Mistral database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -19,7 +19,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Mistral database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -36,18 +36,5 @@
run_once: True
delegate_to: "{{ groups['mistral-api'][0] }}"
-- name: Running Mistral bootstrap container
- kolla_docker:
- action: "start_container"
- common_options: "{{docker_common_options}}"
- detach: False
- environment:
- KOLLA_BOOTSTRAP:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- image: "{{ mistral_api_image_full }}"
- name: "bootstrap_mistral"
- restart_policy: "never"
- volumes: "{{ node_config_directory }}/mistral-api/:{{ container_config_directory }}/:ro"
- run_once: True
- delegate_to: "{{ groups['mistral-api'][0] }}"
+- include: bootstrap_service.yml
when: database_created
diff --git a/ansible/roles/mistral/tasks/bootstrap_service.yml b/ansible/roles/mistral/tasks/bootstrap_service.yml
new file mode 100644
index 000000000..538d85056
--- /dev/null
+++ b/ansible/roles/mistral/tasks/bootstrap_service.yml
@@ -0,0 +1,17 @@
+---
+- name: Running Mistral bootstrap container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{docker_common_options}}"
+ detach: False
+ environment:
+ KOLLA_BOOTSTRAP:
+ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
+ image: "{{ mistral_api_image_full }}"
+ labels:
+ BOOTSTRAP:
+ name: "bootstrap_mistral"
+ restart_policy: "never"
+ volumes: "{{ node_config_directory }}/mistral-api/:{{ container_config_directory }}/:ro"
+ run_once: True
+ delegate_to: "{{ groups['mistral-api'][0] }}"
diff --git a/ansible/roles/mistral/tasks/register.yml b/ansible/roles/mistral/tasks/register.yml
index fe1059d51..5994ccb85 100644
--- a/ansible/roles/mistral/tasks/register.yml
+++ b/ansible/roles/mistral/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Mistral service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=mistral
service_type=application_catalog
description='Openstack Application Catalog'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ mistral_api_port }}'
- internal_url='http://{{ kolla_internal_address }}:{{ mistral_api_port }}'
- public_url='http://{{ kolla_external_address }}:{{ mistral_api_port }}'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ mistral_api_port }}'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ mistral_api_port }}'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ mistral_api_port }}'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_mistral_auth }}' }}"
-e "{'openstack_mistral_auth':{{ openstack_mistral_auth }}}"
@@ -20,7 +20,7 @@
run_once: True
- name: Creating the Mistral project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=mistral
diff --git a/ansible/roles/mistral/tasks/start.yml b/ansible/roles/mistral/tasks/start.yml
index 4045401d4..52677ccc1 100644
--- a/ansible/roles/mistral/tasks/start.yml
+++ b/ansible/roles/mistral/tasks/start.yml
@@ -7,7 +7,7 @@
image: "{{ mistral_engine_image_full }}"
volumes:
- "{{ node_config_directory }}/mistral-engine/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['mistral-engine']
- name: Starting mistral-executor container
@@ -18,7 +18,7 @@
image: "{{ mistral_executor_image_full }}"
volumes:
- "{{ node_config_directory }}/mistral-executor/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['mistral-executor']
- name: Starting mistral-api container
@@ -29,5 +29,5 @@
image: "{{ mistral_api_image_full }}"
volumes:
- "{{ node_config_directory }}/mistral-api/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['mistral-api']
diff --git a/ansible/roles/mistral/tasks/upgrade.yml b/ansible/roles/mistral/tasks/upgrade.yml
new file mode 100644
index 000000000..c0e3b19a4
--- /dev/null
+++ b/ansible/roles/mistral/tasks/upgrade.yml
@@ -0,0 +1,7 @@
+---
+- include: config.yml
+
+- include: bootstrap_service.yml
+
+- include: start.yml
+ serial: "30%"
diff --git a/ansible/roles/mistral/templates/mistral.conf.j2 b/ansible/roles/mistral/templates/mistral.conf.j2
index 8ea16abe1..1c2f24c0a 100644
--- a/ansible/roles/mistral/templates/mistral.conf.j2
+++ b/ansible/roles/mistral/templates/mistral.conf.j2
@@ -1,5 +1,5 @@
[DEFAULT]
-debug = {{ openstack_logging_debug }}
+debug = {{ mistral_logging_debug }}
use_syslog = True
@@ -14,8 +14,8 @@ bind_port = {{ mistral_api_port }}
connection = mysql+pymysql://{{ mistral_database_user }}:{{ mistral_database_password }}@{{ mistral_database_address }}/{{ mistral_database_name }}
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
@@ -24,7 +24,7 @@ username = {{ mistral_keystone_user }}
password = {{ mistral_keystone_password }}
[mistral]
-url = http://{{ kolla_internal_address }}:{{ mistral_api_port }}
+url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ mistral_api_port }}
[oslo_messaging_rabbit]
rabbit_userid = {{ rabbitmq_user }}
diff --git a/ansible/roles/mongodb/defaults/main.yml b/ansible/roles/mongodb/defaults/main.yml
new file mode 100644
index 000000000..168ab153c
--- /dev/null
+++ b/ansible/roles/mongodb/defaults/main.yml
@@ -0,0 +1,15 @@
+---
+project_name: "mongodb"
+
+
+####################
+# Docker
+####################
+mongodb_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-mongodb"
+mongodb_tag: "{{ openstack_release }}"
+mongodb_image_full: "{{ mongodb_image }}:{{ mongodb_tag }}"
+
+####################
+# Mongodb
+####################
+
diff --git a/ansible/roles/mongodb/meta/main.yml b/ansible/roles/mongodb/meta/main.yml
new file mode 100644
index 000000000..6b4fff8fe
--- /dev/null
+++ b/ansible/roles/mongodb/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - { role: common }
diff --git a/ansible/roles/mongodb/tasks/bootstrap.yml b/ansible/roles/mongodb/tasks/bootstrap.yml
new file mode 100644
index 000000000..3c7de0f39
--- /dev/null
+++ b/ansible/roles/mongodb/tasks/bootstrap.yml
@@ -0,0 +1,15 @@
+---
+- name: Starting mongodb bootstrap container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ detach: False
+ environment:
+ KOLLA_BOOTSTRAP:
+ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
+ image: "{{ mongodb_image_full }}"
+ name: "bootstrap_mongodb"
+ restart_policy: "never"
+ volumes:
+ - "{{ node_config_directory }}/mongodb/:{{ container_config_directory }}/:ro"
+ - "mongodb:/var/lib/mongodb/"
diff --git a/ansible/roles/mongodb/tasks/config.yml b/ansible/roles/mongodb/tasks/config.yml
new file mode 100644
index 000000000..def44cefd
--- /dev/null
+++ b/ansible/roles/mongodb/tasks/config.yml
@@ -0,0 +1,23 @@
+---
+- name: Ensuring config directories exist
+ file:
+ path: "{{ node_config_directory }}/{{ item }}"
+ state: "directory"
+ recurse: yes
+ with_items:
+ - "mongodb"
+
+- name: Copying over config.json files for services
+ template:
+ src: "{{ item }}.json.j2"
+ dest: "{{ node_config_directory }}/{{ item }}/config.json"
+ with_items:
+ - "mongodb"
+
+- name: Copying over mongodb.conf
+ template:
+ src: "{{ item }}.j2"
+ dest: "{{ node_config_directory }}/mongodb/{{ item }}"
+ with_items:
+ - "mongodb.conf"
+
diff --git a/ansible/roles/mongodb/tasks/deploy.yml b/ansible/roles/mongodb/tasks/deploy.yml
new file mode 100644
index 000000000..fd4ed2593
--- /dev/null
+++ b/ansible/roles/mongodb/tasks/deploy.yml
@@ -0,0 +1,9 @@
+---
+- include: config.yml
+ when: inventory_hostname in groups['mongodb']
+
+- include: bootstrap.yml
+ when: inventory_hostname in groups['mongodb']
+
+- include: start.yml
+ when: inventory_hostname in groups['mongodb']
diff --git a/ansible/roles/mongodb/tasks/main.yml b/ansible/roles/mongodb/tasks/main.yml
new file mode 100644
index 000000000..b017e8b4a
--- /dev/null
+++ b/ansible/roles/mongodb/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+- include: "{{ action }}.yml"
diff --git a/ansible/roles/mongodb/tasks/pull.yml b/ansible/roles/mongodb/tasks/pull.yml
new file mode 100644
index 000000000..642e132c0
--- /dev/null
+++ b/ansible/roles/mongodb/tasks/pull.yml
@@ -0,0 +1,7 @@
+---
+- name: Pulling mongodb image
+ kolla_docker:
+ action: "pull_image"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ mongodb_image_full }}"
+ when: inventory_hostname in groups['mongodb']
diff --git a/ansible/roles/mongodb/tasks/start.yml b/ansible/roles/mongodb/tasks/start.yml
new file mode 100644
index 000000000..3c5fd3ff3
--- /dev/null
+++ b/ansible/roles/mongodb/tasks/start.yml
@@ -0,0 +1,11 @@
+---
+- name: Starting mongodb container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ mongodb_image_full }}"
+ name: "mongodb"
+ privileged: True
+ volumes:
+ - "{{ node_config_directory }}/mongodb/:{{ container_config_directory }}/:ro"
+ - "mongodb:/var/lib/mongodb"
diff --git a/ansible/roles/mongodb/tasks/upgrade.yml b/ansible/roles/mongodb/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/mongodb/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/mongodb/templates/mongodb.conf.j2 b/ansible/roles/mongodb/templates/mongodb.conf.j2
new file mode 100644
index 000000000..0fbc4f494
--- /dev/null
+++ b/ansible/roles/mongodb/templates/mongodb.conf.j2
@@ -0,0 +1,15 @@
+# mongodb.conf
+
+# Where to store the data.
+dbpath = /var/lib/mongodb
+
+# where to log
+logpath = /var/log/mongodb/mongodb.log
+
+logappend = true
+
+bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
+port = {{ mongodb_port }}
+
+# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
+journal = true
diff --git a/ansible/roles/mongodb/templates/mongodb.json.j2 b/ansible/roles/mongodb/templates/mongodb.json.j2
new file mode 100644
index 000000000..12a25fc5c
--- /dev/null
+++ b/ansible/roles/mongodb/templates/mongodb.json.j2
@@ -0,0 +1,11 @@
+{
+ "command": "/usr/bin/mongod --unixSocketPrefix=/var/run/mongodb --config /etc/mongodb.conf run",
+ "config_files": [
+ {
+ "source": "{{ container_config_directory }}/mongodb.conf",
+ "dest": "/etc/mongodb.conf",
+ "owner": "mongodb",
+ "perm": "0644"
+ }
+ ]
+}
diff --git a/ansible/roles/murano/defaults/main.yml b/ansible/roles/murano/defaults/main.yml
index 45ac3dd73..2385db89e 100644
--- a/ansible/roles/murano/defaults/main.yml
+++ b/ansible/roles/murano/defaults/main.yml
@@ -22,13 +22,12 @@ murano_api_image_full: "{{ murano_api_image }}:{{ murano_api_tag }}"
####################
-# Openstack
+# OpenStack
####################
murano_public_address: "{{ kolla_external_address }}"
murano_admin_address: "{{ kolla_internal_address }}"
murano_internal_address: "{{ kolla_internal_address }}"
-murano_logging_verbose: "{{ openstack_logging_verbose }}"
murano_logging_debug: "{{ openstack_logging_debug }}"
murano_keystone_user: "murano"
diff --git a/ansible/roles/murano/tasks/bootstrap.yml b/ansible/roles/murano/tasks/bootstrap.yml
index 7c58727bb..4bd551dcf 100644
--- a/ansible/roles/murano/tasks/bootstrap.yml
+++ b/ansible/roles/murano/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Murano database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -19,7 +19,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Murano database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -36,18 +36,5 @@
run_once: True
delegate_to: "{{ groups['murano-api'][0] }}"
-- name: Running Murano bootstrap container
- kolla_docker:
- action: "start_container"
- common_options: "{{ docker_common_options }}"
- detach: False
- environment:
- KOLLA_BOOTSTRAP:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- image: "{{ murano_api_image_full }}"
- name: "bootstrap_murano"
- restart_policy: "never"
- volumes: "{{ node_config_directory }}/murano-api/:{{ container_config_directory }}/:ro"
- run_once: True
- delegate_to: "{{ groups['murano-api'][0] }}"
+- include: bootstrap_service.yml
when: database_created
diff --git a/ansible/roles/murano/tasks/bootstrap_service.yml b/ansible/roles/murano/tasks/bootstrap_service.yml
new file mode 100644
index 000000000..887f05cc5
--- /dev/null
+++ b/ansible/roles/murano/tasks/bootstrap_service.yml
@@ -0,0 +1,17 @@
+---
+- name: Running Murano bootstrap container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ detach: False
+ environment:
+ KOLLA_BOOTSTRAP:
+ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
+ image: "{{ murano_api_image_full }}"
+ labels:
+ BOOTSTRAP:
+ name: "bootstrap_murano"
+ restart_policy: "never"
+ volumes: "{{ node_config_directory }}/murano-api/:{{ container_config_directory }}/:ro"
+ run_once: True
+ delegate_to: "{{ groups['murano-api'][0] }}"
diff --git a/ansible/roles/murano/tasks/register.yml b/ansible/roles/murano/tasks/register.yml
index c1ea88daf..2872cc76e 100644
--- a/ansible/roles/murano/tasks/register.yml
+++ b/ansible/roles/murano/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Murano service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=murano
service_type=application_catalog
description='Openstack Application Catalogue'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ murano_api_port }}'
- internal_url='http://{{ kolla_internal_address }}:{{ murano_api_port }}'
- public_url='http://{{ kolla_external_address }}:{{ murano_api_port }}'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ murano_api_port }}'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ murano_api_port }}'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ murano_api_port }}'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_murano_auth }}' }}"
-e "{'openstack_murano_auth':{{ openstack_murano_auth }}}"
@@ -20,7 +20,7 @@
run_once: True
- name: Creating the Murano project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=murano
diff --git a/ansible/roles/murano/tasks/start.yml b/ansible/roles/murano/tasks/start.yml
index 0bdb46ac2..9a8bd5e79 100644
--- a/ansible/roles/murano/tasks/start.yml
+++ b/ansible/roles/murano/tasks/start.yml
@@ -7,7 +7,7 @@
name: "murano_engine"
volumes:
- "{{ node_config_directory }}/murano-engine/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['murano-engine']
- name: Starting murano-api container
@@ -18,5 +18,5 @@
name: "murano_api"
volumes:
- "{{ node_config_directory }}/murano-api/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['murano-api']
diff --git a/ansible/roles/murano/tasks/upgrade.yml b/ansible/roles/murano/tasks/upgrade.yml
new file mode 100644
index 000000000..c0e3b19a4
--- /dev/null
+++ b/ansible/roles/murano/tasks/upgrade.yml
@@ -0,0 +1,7 @@
+---
+- include: config.yml
+
+- include: bootstrap_service.yml
+
+- include: start.yml
+ serial: "30%"
diff --git a/ansible/roles/murano/templates/murano.conf.j2 b/ansible/roles/murano/templates/murano.conf.j2
index 3843ecad8..e0bdda137 100644
--- a/ansible/roles/murano/templates/murano.conf.j2
+++ b/ansible/roles/murano/templates/murano.conf.j2
@@ -1,5 +1,5 @@
[DEFAULT]
-debug = {{ openstack_logging_debug }}
+debug = {{ murano_logging_debug }}
use_syslog = True
@@ -14,8 +14,8 @@ bind_port = {{ murano_api_port }}
connection = mysql+pymysql://{{ murano_database_user }}:{{ murano_database_password }}@{{ murano_database_address }}/{{ murano_database_name }}
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
@@ -24,7 +24,7 @@ username = {{ murano_keystone_user }}
password = {{ murano_keystone_password }}
[murano]
-url = http://{{ kolla_internal_address }}:{{ murano_api_port }}
+url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ murano_api_port }}
[oslo_messaging_rabbit]
rabbit_userid = {{ rabbitmq_user }}
diff --git a/ansible/roles/neutron/defaults/main.yml b/ansible/roles/neutron/defaults/main.yml
index 9bb9939f2..0c2e03fed 100644
--- a/ansible/roles/neutron/defaults/main.yml
+++ b/ansible/roles/neutron/defaults/main.yml
@@ -12,39 +12,46 @@ neutron_database_address: "{{ kolla_internal_address }}"
####################
# Docker
####################
-neutron_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-server"
-neutron_server_tag: "{{ openstack_release }}"
-neutron_server_image_full: "{{ neutron_server_image }}:{{ neutron_server_tag }}"
+neutron_dhcp_agent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-dhcp-agent"
+neutron_dhcp_agent_tag: "{{ openstack_release }}"
+neutron_dhcp_agent_image_full: "{{ neutron_dhcp_agent_image }}:{{ neutron_dhcp_agent_tag }}"
-neutron_agents_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-agents"
-neutron_agents_tag: "{{ openstack_release }}"
-neutron_agents_image_full: "{{ neutron_agents_image }}:{{ neutron_agents_tag }}"
-
-neutron_openvswitch_agent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-openvswitch-agent"
-neutron_openvswitch_agent_tag: "{{ openstack_release }}"
-neutron_openvswitch_agent_image_full: "{{ neutron_openvswitch_agent_image }}:{{ neutron_openvswitch_agent_tag }}"
+neutron_l3_agent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-l3-agent"
+neutron_l3_agent_tag: "{{ openstack_release }}"
+neutron_l3_agent_image_full: "{{ neutron_l3_agent_image }}:{{ neutron_l3_agent_tag }}"
neutron_linuxbridge_agent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-linuxbridge-agent"
neutron_linuxbridge_agent_tag: "{{ openstack_release }}"
neutron_linuxbridge_agent_image_full: "{{ neutron_linuxbridge_agent_image }}:{{ neutron_linuxbridge_agent_tag }}"
-openvswitch_vswitchd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-openvswitch-vswitchd"
-openvswitch_vswitchd_tag: "{{ openstack_release }}"
-openvswitch_vswitchd_image_full: "{{ openvswitch_vswitchd_image }}:{{ openvswitch_vswitchd_tag }}"
+neutron_metadata_agent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-metadata-agent"
+neutron_metadata_agent_tag: "{{ openstack_release }}"
+neutron_metadata_agent_image_full: "{{ neutron_metadata_agent_image }}:{{ neutron_metadata_agent_tag }}"
+
+neutron_openvswitch_agent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-openvswitch-agent"
+neutron_openvswitch_agent_tag: "{{ openstack_release }}"
+neutron_openvswitch_agent_image_full: "{{ neutron_openvswitch_agent_image }}:{{ neutron_openvswitch_agent_tag }}"
+
+neutron_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-neutron-server"
+neutron_server_tag: "{{ openstack_release }}"
+neutron_server_image_full: "{{ neutron_server_image }}:{{ neutron_server_tag }}"
openvswitch_db_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-openvswitch-db-server"
openvswitch_db_tag: "{{ openstack_release }}"
openvswitch_db_image_full: "{{ openvswitch_db_image }}:{{ openvswitch_db_tag }}"
+openvswitch_vswitchd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-openvswitch-vswitchd"
+openvswitch_vswitchd_tag: "{{ openstack_release }}"
+openvswitch_vswitchd_image_full: "{{ openvswitch_vswitchd_image }}:{{ openvswitch_vswitchd_tag }}"
+
####################
-# Openstack
+# OpenStack
####################
neutron_public_address: "{{ kolla_external_address }}"
neutron_admin_address: "{{ kolla_internal_address }}"
neutron_internal_address: "{{ kolla_internal_address }}"
-neutron_logging_verbose: "{{ openstack_logging_verbose }}"
neutron_logging_debug: "{{ openstack_logging_debug }}"
neutron_keystone_user: "neutron"
diff --git a/ansible/roles/neutron/tasks/bootstrap.yml b/ansible/roles/neutron/tasks/bootstrap.yml
index db1654fa2..9eba99be1 100644
--- a/ansible/roles/neutron/tasks/bootstrap.yml
+++ b/ansible/roles/neutron/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Neutron database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -18,7 +18,7 @@
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- name: Creating Neutron database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -44,6 +44,8 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ neutron_server_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_neutron"
restart_policy: "never"
volumes: "{{ node_config_directory }}/neutron-server/:{{ container_config_directory }}/:ro"
diff --git a/ansible/roles/neutron/tasks/config-neutron-fake.yml b/ansible/roles/neutron/tasks/config-neutron-fake.yml
index c04420cb0..5f2720e8c 100644
--- a/ansible/roles/neutron/tasks/config-neutron-fake.yml
+++ b/ansible/roles/neutron/tasks/config-neutron-fake.yml
@@ -14,7 +14,6 @@
with_sequence: start=1 end={{ num_nova_fake_per_node }}
when:
- inventory_hostname in groups['compute']
- - enable_nova_fake | bool
- neutron_plugin_agent == "openvswitch"
- name: Copying over neutron.conf
@@ -31,7 +30,6 @@
when:
- inventory_hostname in groups['compute']
- neutron_plugin_agent == "openvswitch"
- - enable_nova_fake | bool
- name: Copying over ml2_conf.ini
merge_configs:
@@ -43,5 +41,3 @@
when:
- inventory_hostname in groups['compute']
- neutron_plugin_agent == "openvswitch"
- - enable_nova_fake | bool
-
diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml
index 62aaa3e10..f7c58baed 100644
--- a/ansible/roles/neutron/tasks/config.yml
+++ b/ansible/roles/neutron/tasks/config.yml
@@ -3,7 +3,7 @@
sysctl: name="net.ipv4.ip_forward" value=1 sysctl_set=yes
when:
- set_sysctl | bool
- - inventory_hostname in groups['neutron-agents']
+ - inventory_hostname in groups['neutron-l3-agent']
- name: Disabling reverse path filter on network node
sysctl: name="net.ipv4.conf.{{ item }}.rp_filter" value=0 sysctl_set=yes
@@ -12,7 +12,7 @@
- "default"
when:
- set_sysctl | bool
- - inventory_hostname in groups['neutron-agents']
+ - inventory_hostname in groups['neutron-l3-agent']
- name: Ensuring config directories exist
file:
@@ -20,8 +20,10 @@
state: "directory"
recurse: yes
with_items:
- - "neutron-agents"
+ - "neutron-dhcp-agent"
+ - "neutron-l3-agent"
- "neutron-linuxbridge-agent"
+ - "neutron-metadata-agent"
- "neutron-openvswitch-agent"
- "neutron-server"
- "openvswitch-db-server"
@@ -32,8 +34,10 @@
src: "{{ item }}.json.j2"
dest: "{{ node_config_directory }}/{{ item }}/config.json"
with_items:
- - "neutron-agents"
+ - "neutron-dhcp-agent"
+ - "neutron-l3-agent"
- "neutron-linuxbridge-agent"
+ - "neutron-metadata-agent"
- "neutron-openvswitch-agent"
- "neutron-server"
- "openvswitch-db-server"
@@ -52,8 +56,10 @@
- "/etc/kolla/config/neutron/{{ item }}.conf"
dest: "{{ node_config_directory }}/{{ item }}/neutron.conf"
with_items:
- - "neutron-agents"
+ - "neutron-dhcp-agent"
+ - "neutron-l3-agent"
- "neutron-linuxbridge-agent"
+ - "neutron-metadata-agent"
- "neutron-openvswitch-agent"
- "neutron-server"
@@ -66,10 +72,12 @@
- "/etc/kolla/config/neutron/ml2_conf.ini"
dest: "{{ node_config_directory }}/{{ item }}/ml2_conf.ini"
with_items:
- - "neutron-server"
- - "neutron-agents"
+ - "neutron-dhcp-agent"
+ - "neutron-l3-agent"
- "neutron-linuxbridge-agent"
+ - "neutron-metadata-agent"
- "neutron-openvswitch-agent"
+ - "neutron-server"
- name: Copying over dhcp_agent.ini
merge_configs:
@@ -80,12 +88,14 @@
- "/etc/kolla/config/neutron/dhcp_agent.ini"
dest: "{{ node_config_directory }}/{{ item }}/dhcp_agent.ini"
with_items:
- - "neutron-agents"
+ - "neutron-dhcp-agent"
- name: Copying over dnsmasq.conf
template:
src: "dnsmasq.conf.j2"
- dest: "{{ node_config_directory }}/neutron-agents/dnsmasq.conf"
+ dest: "{{ node_config_directory }}/{{ item }}/dnsmasq.conf"
+ with_items:
+ - "neutron-dhcp-agent"
- name: Copying over l3_agent.ini
merge_configs:
@@ -96,7 +106,18 @@
- "/etc/kolla/config/neutron/l3_agent.ini"
dest: "{{ node_config_directory }}/{{ item }}/l3_agent.ini"
with_items:
- - "neutron-agents"
+ - "neutron-l3-agent"
+
+- name: Copying over fwaas_driver.ini
+ merge_configs:
+ vars:
+ service_name: "{{ item }}"
+ sources:
+ - "{{ role_path }}/templates/fwaas_driver.ini.j2"
+ - "/etc/kolla/config/neutron/fwaas_driver.ini"
+ dest: "{{ node_config_directory }}/{{ item }}/fwaas_driver.ini"
+ with_items:
+ - "neutron-l3-agent"
- name: Copying over metadata_agent.ini
merge_configs:
@@ -107,4 +128,4 @@
- "/etc/kolla/config/neutron/metadata_agent.ini"
dest: "{{ node_config_directory }}/{{ item }}/metadata_agent.ini"
with_items:
- - "neutron-agents"
+ - "neutron-metadata-agent"
diff --git a/ansible/roles/neutron/tasks/deploy.yml b/ansible/roles/neutron/tasks/deploy.yml
index 19bf5d384..6b5609c75 100644
--- a/ansible/roles/neutron/tasks/deploy.yml
+++ b/ansible/roles/neutron/tasks/deploy.yml
@@ -6,9 +6,11 @@
when: inventory_hostname in groups['neutron-server']
- include: config.yml
- when: inventory_hostname in groups['compute'] or
- inventory_hostname in groups['neutron-agents'] or
- inventory_hostname in groups['neutron-server']
+ when: inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent']
+ or inventory_hostname in groups['neutron-server']
- include: config-neutron-fake.yml
when:
@@ -19,6 +21,8 @@
when: inventory_hostname in groups['neutron-server']
- include: start.yml
- when: inventory_hostname in groups['compute'] or
- inventory_hostname in groups['neutron-agents'] or
- inventory_hostname in groups['neutron-server']
+ when: inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent']
+ or inventory_hostname in groups['neutron-server']
diff --git a/ansible/roles/neutron/tasks/ironic-check.yml b/ansible/roles/neutron/tasks/ironic-check.yml
index f32a58a72..a578ce2c7 100644
--- a/ansible/roles/neutron/tasks/ironic-check.yml
+++ b/ansible/roles/neutron/tasks/ironic-check.yml
@@ -1,4 +1,6 @@
---
# TODO(SamYaple): run verification checks at start of playbook
- fail: msg="neutron_plugin_agent must use openvswitch with Ironic"
- when: enable_ironic | bool and neutron_plugin_agent != "openvswitch"
+ when:
+ - enable_ironic | bool
+ - neutron_plugin_agent != "openvswitch"
diff --git a/ansible/roles/neutron/tasks/pull.yml b/ansible/roles/neutron/tasks/pull.yml
index 01c77d278..057ced152 100644
--- a/ansible/roles/neutron/tasks/pull.yml
+++ b/ansible/roles/neutron/tasks/pull.yml
@@ -1,10 +1,17 @@
---
-- name: Pulling neutron-agents image
+- name: Pulling neutron-dhcp-agent image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
- image: "{{ neutron_agents_image_full }}"
- when: inventory_hostname in groups['neutron-agents']
+ image: "{{ neutron_dhcp_agent_image_full }}"
+ when: inventory_hostname in groups['neutron-dhcp-agent']
+
+- name: Pulling neutron-l3-agent image
+ kolla_docker:
+ action: "pull_image"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ neutron_l3_agent_image_full }}"
+ when: inventory_hostname in groups['neutron-l3-agent']
- name: Pulling neutron-linuxbridge-agent image
kolla_docker:
@@ -12,16 +19,29 @@
common_options: "{{ docker_common_options }}"
image: "{{ neutron_linuxbridge_agent_image_full }}"
when:
- - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
- neutron_plugin_agent == "linuxbridge"
+- name: Pulling neutron-metadata-agent image
+ kolla_docker:
+ action: "pull_image"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ neutron_metadata_agent_image_full }}"
+ when: inventory_hostname in groups['neutron-metadata-agent']
+
- name: Pulling neutron-openvswitch-agent image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ neutron_openvswitch_agent_image_full }}"
when:
- - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
- neutron_plugin_agent == "openvswitch"
- name: Pulling neutron-server image
@@ -37,7 +57,10 @@
common_options: "{{ docker_common_options }}"
image: "{{ openvswitch_db_image_full }}"
when:
- - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
- neutron_plugin_agent == "openvswitch"
- name: Pulling openvswitch-vswitchd image
@@ -46,5 +69,8 @@
common_options: "{{ docker_common_options }}"
image: "{{ openvswitch_vswitchd_image_full }}"
when:
- - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
- neutron_plugin_agent == "openvswitch"
diff --git a/ansible/roles/neutron/tasks/register.yml b/ansible/roles/neutron/tasks/register.yml
index 221e3de59..d400d6ca7 100644
--- a/ansible/roles/neutron/tasks/register.yml
+++ b/ansible/roles/neutron/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Neutron service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=neutron
service_type=network
description='Openstack Networking'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ neutron_server_port }}'
- internal_url='http://{{ kolla_internal_address }}:{{ neutron_server_port }}'
- public_url='http://{{ kolla_external_address }}:{{ neutron_server_port }}'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ neutron_server_port }}'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ neutron_server_port }}'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ neutron_server_port }}'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_neutron_auth }}' }}"
-e "{'openstack_neutron_auth':{{ openstack_neutron_auth }}}"
@@ -20,7 +20,7 @@
run_once: True
- name: Creating the Neutron project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=neutron
diff --git a/ansible/roles/neutron/tasks/start.yml b/ansible/roles/neutron/tasks/start.yml
index c7b04b256..31b3405b5 100644
--- a/ansible/roles/neutron/tasks/start.yml
+++ b/ansible/roles/neutron/tasks/start.yml
@@ -10,7 +10,24 @@
- "/run:/run"
- "openvswitch_db:/var/lib/openvswitch/"
when:
- - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
+ - neutron_plugin_agent == "openvswitch"
+
+- name: Waiting the openvswtich_db service to be ready
+ command: docker exec openvswitch_db ovs-vsctl --no-wait show
+ register: check_result
+ until: check_result | success
+ changed_when: False
+ retries: 30
+ delay: 2
+ when:
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
- neutron_plugin_agent == "openvswitch"
- name: Ensuring OVS bridge is properly setup
@@ -18,7 +35,10 @@
register: status
changed_when: status.stdout.find('changed') != -1
when:
- - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
- neutron_plugin_agent == "openvswitch"
- name: Starting openvswitch-vswitchd container
@@ -33,7 +53,10 @@
- "/lib/modules:/lib/modules:ro"
- "/run:/run"
when:
- - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
- neutron_plugin_agent == "openvswitch"
- name: Starting neutron-server container
@@ -44,7 +67,7 @@
name: "neutron_server"
volumes:
- "{{ node_config_directory }}/neutron-server/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['neutron-server']
- name: Starting neutron-openvswitch-agent container
@@ -58,13 +81,24 @@
- "{{ node_config_directory }}/neutron-openvswitch-agent/:{{ container_config_directory }}/:ro"
- "/lib/modules:/lib/modules:ro"
- "/run:/run"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when:
+ - (
+ ( inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent']
+ and not enable_nova_fake | bool
+ ) or
+ ( inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent']
+ and enable_nova_fake | bool
+ )
+ )
- neutron_plugin_agent == "openvswitch"
- - ((inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents']) and not (enable_nova_fake | bool)) or
- ((inventory_hostname in groups['neutron-agents']) and (enable_nova_fake | bool))
-- name: Starting Neutron-openvswitch-agent container for fake nova compute
+- name: Starting neutron-openvswitch-agent container for fake nova compute
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
@@ -75,7 +109,7 @@
- "{{ node_config_directory }}/neutron-openvswitch-agent-fake-{{ item }}/:{{ container_config_directory }}/:ro"
- "/lib/modules:/lib/modules:ro"
- "/run:/run"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
with_sequence: start=1 end={{ num_nova_fake_per_node }}
when:
- inventory_hostname in groups['compute']
@@ -97,20 +131,57 @@
- "{{ node_config_directory }}/neutron-linuxbridge-agent/:{{ container_config_directory }}/:ro"
- "/lib/modules:/lib/modules:ro"
- "/run:/run"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when:
- - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - (inventory_hostname in groups['compute']
+ or inventory_hostname in groups['neutron-dhcp-agent']
+ or inventory_hostname in groups['neutron-l3-agent']
+ or inventory_hostname in groups['neutron-metadata-agent'])
- neutron_plugin_agent == "linuxbridge"
-- name: Starting neutron-agents container
+- name: Starting neutron-dhcp-agent container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ neutron_dhcp_agent_image_full }}"
+ name: "neutron_dhcp_agent"
+ privileged: True
+ volumes:
+ - "{{ node_config_directory }}/neutron-dhcp-agent/:{{ container_config_directory }}/:ro"
+ - "/run/:/run/"
+ - "/run/netns/:/run/netns/:shared"
+ - "neutron_metadata_socket:/var/lib/neutron/kolla/"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
+ when:
+ - inventory_hostname in groups['neutron-dhcp-agent']
+
+- name: Starting neutron-l3-agent container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ neutron_agents_image_full }}"
- name: "neutron_agents"
+ image: "{{ neutron_l3_agent_image_full }}"
+ name: "neutron_l3_agent"
privileged: True
volumes:
- - "{{ node_config_directory }}/neutron-agents/:{{ container_config_directory }}/:ro"
+ - "{{ node_config_directory }}/neutron-l3-agent/:{{ container_config_directory }}/:ro"
- "/run:/run"
- - "/var/lib/kolla/dev/log:/dev/log"
- when: inventory_hostname in groups['neutron-agents']
+ - "/run/netns/:/run/netns/:shared"
+ - "neutron_metadata_socket:/var/lib/neutron/kolla/"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
+ when:
+ - inventory_hostname in groups['neutron-l3-agent']
+
+- name: Starting neutron-metadata-agent container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ neutron_metadata_agent_image_full }}"
+ name: "neutron_metadata_agent"
+ privileged: True
+ volumes:
+ - "{{ node_config_directory }}/neutron-metadata-agent/:{{ container_config_directory }}/:ro"
+ - "/run/netns/:/run/netns/:shared"
+ - "neutron_metadata_socket:/var/lib/neutron/kolla/"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
+ when:
+ - inventory_hostname in groups['neutron-metadata-agent']
diff --git a/ansible/roles/neutron/tasks/upgrade.yml b/ansible/roles/neutron/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/neutron/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/neutron/templates/fwaas_driver.ini.j2 b/ansible/roles/neutron/templates/fwaas_driver.ini.j2
new file mode 100644
index 000000000..b020e6bbd
--- /dev/null
+++ b/ansible/roles/neutron/templates/fwaas_driver.ini.j2
@@ -0,0 +1 @@
+[fwaas]
diff --git a/ansible/roles/neutron/templates/neutron-agents.json.j2 b/ansible/roles/neutron/templates/neutron-dhcp-agent.json.j2
index e33bf823f..bd98c532d 100644
--- a/ansible/roles/neutron/templates/neutron-agents.json.j2
+++ b/ansible/roles/neutron/templates/neutron-dhcp-agent.json.j2
@@ -1,5 +1,5 @@
{
- "command": "",
+ "command": "neutron-dhcp-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini",
"config_files": [
{
"source": "{{ container_config_directory }}/neutron.conf",
@@ -8,32 +8,20 @@
"perm": "0600"
},
{
- "source": "{{ container_config_directory }}/dhcp_agent.ini",
- "dest": "/etc/neutron/dhcp_agent.ini",
- "owner": "neutron",
- "perm": "0600"
- },
- {
- "source": "{{ container_config_directory }}/dnsmasq.conf",
- "dest": "/etc/neutron/dnsmasq.conf",
- "owner": "neutron",
- "perm": "0600"
- },
- {
- "source": "{{ container_config_directory }}/l3_agent.ini",
- "dest": "/etc/neutron/l3_agent.ini",
+ "source": "{{ container_config_directory }}/ml2_conf.ini",
+ "dest": "/etc/neutron/plugins/ml2/ml2_conf.ini",
"owner": "neutron",
"perm": "0600"
},
{
- "source": "{{ container_config_directory }}/ml2_conf.ini",
- "dest": "/etc/neutron/plugins/ml2/ml2_conf.ini",
+ "source": "{{ container_config_directory }}/dhcp_agent.ini",
+ "dest": "/etc/neutron/dhcp_agent.ini",
"owner": "neutron",
"perm": "0600"
},
{
- "source": "{{ container_config_directory }}/metadata_agent.ini",
- "dest": "/etc/neutron/metadata_agent.ini",
+ "source": "{{ container_config_directory }}/dnsmasq.conf",
+ "dest": "/etc/neutron/dnsmasq.conf",
"owner": "neutron",
"perm": "0600"
}
diff --git a/ansible/roles/neutron/templates/neutron-l3-agent.json.j2 b/ansible/roles/neutron/templates/neutron-l3-agent.json.j2
new file mode 100644
index 000000000..24bcc2849
--- /dev/null
+++ b/ansible/roles/neutron/templates/neutron-l3-agent.json.j2
@@ -0,0 +1,29 @@
+{
+ "command": "neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini",
+ "config_files": [
+ {
+ "source": "{{ container_config_directory }}/neutron.conf",
+ "dest": "/etc/neutron/neutron.conf",
+ "owner": "neutron",
+ "perm": "0600"
+ },
+ {
+ "source": "{{ container_config_directory }}/ml2_conf.ini",
+ "dest": "/etc/neutron/plugins/ml2/ml2_conf.ini",
+ "owner": "neutron",
+ "perm": "0600"
+ },
+ {
+ "source": "{{ container_config_directory }}/fwaas_driver.ini",
+ "dest": "/etc/neutron/fwaas_driver.ini",
+ "owner": "neutron",
+ "perm": "0600"
+ },
+ {
+ "source": "{{ container_config_directory }}/l3_agent.ini",
+ "dest": "/etc/neutron/l3_agent.ini",
+ "owner": "neutron",
+ "perm": "0600"
+ }
+ ]
+}
diff --git a/ansible/roles/neutron/templates/neutron-metadata-agent.json.j2 b/ansible/roles/neutron/templates/neutron-metadata-agent.json.j2
new file mode 100644
index 000000000..ba0d1b9c9
--- /dev/null
+++ b/ansible/roles/neutron/templates/neutron-metadata-agent.json.j2
@@ -0,0 +1,23 @@
+{
+ "command": "neutron-metadata-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini",
+ "config_files": [
+ {
+ "source": "{{ container_config_directory }}/neutron.conf",
+ "dest": "/etc/neutron/neutron.conf",
+ "owner": "neutron",
+ "perm": "0600"
+ },
+ {
+ "source": "{{ container_config_directory }}/ml2_conf.ini",
+ "dest": "/etc/neutron/plugins/ml2/ml2_conf.ini",
+ "owner": "neutron",
+ "perm": "0600"
+ },
+ {
+ "source": "{{ container_config_directory }}/metadata_agent.ini",
+ "dest": "/etc/neutron/metadata_agent.ini",
+ "owner": "neutron",
+ "perm": "0600"
+ }
+ ]
+}
diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2
index fb2fdb1b5..8db961e8e 100644
--- a/ansible/roles/neutron/templates/neutron.conf.j2
+++ b/ansible/roles/neutron/templates/neutron.conf.j2
@@ -1,6 +1,6 @@
# neutron.conf
[DEFAULT]
-debug = true
+debug = {{ neutron_logging_debug }}
use_syslog = True
syslog_log_facility = LOG_LOCAL0
@@ -8,9 +8,12 @@ syslog_log_facility = LOG_LOCAL0
bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
bind_port = {{ neutron_server_port }}
-#lock_path = /var/lock/neutron
api_paste_config = /usr/share/neutron/api-paste.ini
+# NOTE(SamYaple): We must specify this value here rather than the metadata conf
+# because it is used by the l3 and dhcp agents. The reason the path has 'kolla'
+# in it is because we are sharing this socket in a volume which is it's own dir
+metadata_proxy_socket = /var/lib/neutron/kolla/metadata_proxy
{% if neutron_plugin_agent == "openvswitch" %}
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
@@ -28,7 +31,7 @@ core_plugin = ml2
service_plugins = router
[nova]
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
@@ -53,8 +56,8 @@ root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf
connection = mysql+pymysql://{{ neutron_database_user }}:{{ neutron_database_password }}@{{ neutron_database_address }}/{{ neutron_database_name }}
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
diff --git a/ansible/roles/nova/defaults/main.yml b/ansible/roles/nova/defaults/main.yml
index 635224ed3..707e4950f 100644
--- a/ansible/roles/nova/defaults/main.yml
+++ b/ansible/roles/nova/defaults/main.yml
@@ -21,6 +21,9 @@ nova_database_name: "nova"
nova_database_user: "nova"
nova_database_address: "{{ kolla_internal_address }}"
+nova_api_database_name: "nova_api"
+nova_api_database_user: "nova_api"
+nova_api_database_address: "{{ kolla_internal_address }}"
####################
# Docker
@@ -62,13 +65,12 @@ nova_compute_ironic_tag: "{{ openstack_release }}"
nova_compute_ironic_image_full: "{{ nova_compute_ironic_image }}:{{ nova_compute_ironic_tag }}"
####################
-# Openstack
+# OpenStack
####################
nova_public_address: "{{ kolla_external_address }}"
nova_admin_address: "{{ kolla_internal_address }}"
nova_internal_address: "{{ kolla_internal_address }}"
-nova_logging_verbose: "{{ openstack_logging_verbose }}"
nova_logging_debug: "{{ openstack_logging_debug }}"
nova_keystone_user: "nova"
diff --git a/ansible/roles/nova/tasks/bootstrap.yml b/ansible/roles/nova/tasks/bootstrap.yml
index fcdd2a707..f67d44091 100644
--- a/ansible/roles/nova/tasks/bootstrap.yml
+++ b/ansible/roles/nova/tasks/bootstrap.yml
@@ -1,6 +1,6 @@
---
- name: Creating Nova database
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -17,8 +17,26 @@
set_fact:
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
+- name: Creating Nova-api database
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
+ -m mysql_db
+ -a "login_host='{{ database_address }}'
+ login_user='{{ database_user }}'
+ login_password='{{ database_password }}'
+ name='{{ nova_api_database_name }}'"
+ register: database_api
+ changed_when: "{{ database_api.stdout.find('localhost | SUCCESS => ') != -1 and
+ (database_api.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
+ failed_when: database_api.stdout.split()[2] != 'SUCCESS'
+ run_once: True
+ delegate_to: "{{ groups['nova-api'][0] }}"
+
+- name: Reading json from variable
+ set_fact:
+ database_api_created: "{{ (database_api.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
+
- name: Creating Nova database user and setting permissions
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ database_address }}'
login_user='{{ database_user }}'
@@ -35,7 +53,25 @@
run_once: True
delegate_to: "{{ groups['nova-api'][0] }}"
-- name: Starting Nova bootstrap container
+- name: Creating Nova-api database user and setting permissions
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
+ -m mysql_user
+ -a "login_host='{{ database_address }}'
+ login_user='{{ database_user }}'
+ login_password='{{ database_password }}'
+ name='{{ nova_api_database_name }}'
+ password='{{ nova_api_database_password }}'
+ host='%'
+ priv='{{ nova_api_database_name }}.*:ALL'
+ append_privs='yes'"
+ register: database_api_user_create
+ changed_when: "{{ database_api_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
+ (database_api_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
+ failed_when: database_api_user_create.stdout.split()[2] != 'SUCCESS'
+ run_once: True
+ delegate_to: "{{ groups['nova-api'][0] }}"
+
+- name: Running Nova bootstrap container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
@@ -44,6 +80,8 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ nova_api_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_nova"
restart_policy: "never"
volumes: "{{ node_config_directory }}/nova-api/:{{ container_config_directory }}/:ro"
@@ -61,7 +99,7 @@
- inventory_hostname in groups['compute']
- not enable_nova_fake | bool
-- name: Starting Nova compute bootstrap container
+- name: Running Nova compute bootstrap container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
@@ -70,6 +108,8 @@
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
image: "{{ nova_compute_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "bootstrap_nova_compute"
restart_policy: "never"
volumes:
diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml
index b1685965d..b082d1bc4 100644
--- a/ansible/roles/nova/tasks/config.yml
+++ b/ansible/roles/nova/tasks/config.yml
@@ -15,7 +15,7 @@
- "default"
when:
- set_sysctl | bool
- - inventory_hostname in groups['neutron-agents']
+ - inventory_hostname in groups['compute']
- name: Ensuring config directories exist
file:
diff --git a/ansible/roles/nova/tasks/register.yml b/ansible/roles/nova/tasks/register.yml
index 8a82319f2..95f0f968d 100644
--- a/ansible/roles/nova/tasks/register.yml
+++ b/ansible/roles/nova/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Nova service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=nova
service_type=compute
description='Openstack Compute'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ nova_api_port }}/v2/%(tenant_id)s'
- internal_url='http://{{ kolla_internal_address }}:{{ nova_api_port }}/v2/%(tenant_id)s'
- public_url='http://{{ kolla_external_address }}:{{ nova_api_port }}/v2/%(tenant_id)s'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ nova_api_port }}/v2/%(tenant_id)s'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ nova_api_port }}/v2/%(tenant_id)s'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ nova_api_port }}/v2/%(tenant_id)s'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_nova_auth }}' }}"
-e "{'openstack_nova_auth':{{ openstack_nova_auth }}}"
@@ -21,7 +21,7 @@
- name: Creating the Nova project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user=nova
diff --git a/ansible/roles/nova/tasks/start.yml b/ansible/roles/nova/tasks/start.yml
index 4df7f4d84..795e2ca5d 100644
--- a/ansible/roles/nova/tasks/start.yml
+++ b/ansible/roles/nova/tasks/start.yml
@@ -10,6 +10,7 @@
volumes:
- "{{ node_config_directory }}/nova-libvirt/:{{ container_config_directory }}/:ro"
- "/lib/modules:/lib/modules:ro"
+ - "/run/:/run/"
- "/sys/fs/cgroup:/sys/fs/cgroup"
- "nova_compute:/var/lib/nova/"
- "nova_libvirt:/var/lib/libvirt"
@@ -25,7 +26,7 @@
volumes:
- "{{ node_config_directory }}/nova-api/:{{ container_config_directory }}/:ro"
- "/lib/modules:/lib/modules:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['nova-api']
- name: Starting nova-conductor container
@@ -36,7 +37,7 @@
image: "{{ nova_conductor_image_full }}"
volumes:
- "{{ node_config_directory }}/nova-conductor/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['nova-conductor']
- name: Starting nova-consoleauth container
@@ -47,7 +48,7 @@
name: "nova_consoleauth"
volumes:
- "{{ node_config_directory }}/nova-consoleauth/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['nova-consoleauth']
- name: Starting nova-novncproxy container
@@ -58,7 +59,7 @@
name: "nova_novncproxy"
volumes:
- "{{ node_config_directory }}/nova-novncproxy/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when:
- inventory_hostname in groups['nova-novncproxy']
- nova_console == 'novnc'
@@ -71,7 +72,7 @@
name: "nova_scheduler"
volumes:
- "{{ node_config_directory }}/nova-scheduler/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['nova-scheduler']
- name: Starting nova-spicehtml5proxy container
@@ -82,7 +83,7 @@
name: "nova_spicehtml5proxy"
volumes:
- "{{ node_config_directory }}/nova-spicehtml5proxy/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when:
- inventory_hostname in groups['nova-spicehtml5proxy']
- nova_console == 'spice'
@@ -98,9 +99,9 @@
- "{{ node_config_directory }}/nova-compute/:{{ container_config_directory }}/:ro"
- "/lib/modules:/lib/modules:ro"
- "/run:/run"
- - "/var/lib/kolla/dev/log:/dev/log"
- "nova_compute:/var/lib/nova/"
- "nova_libvirt:/var/lib/libvirt"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when:
- inventory_hostname in groups['compute']
- not enable_nova_fake | bool
@@ -113,7 +114,7 @@
name: "nova_compute_ironic"
volumes:
- "{{ node_config_directory }}/nova-compute-ironic/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when:
- inventory_hostname in groups['nova-compute-ironic']
- enable_ironic | bool
@@ -129,7 +130,7 @@
- "{{ node_config_directory }}/nova-compute-fake-{{ item }}/:{{ container_config_directory }}/:ro"
- "/lib/modules:/lib/modules:ro"
- "/run:/run"
- - "/var/lib/kolla/dev/log:/dev/log"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
with_sequence: start=1 end={{ num_nova_fake_per_node }}
when:
- inventory_hostname in groups['compute']
diff --git a/ansible/roles/nova/tasks/upgrade.yml b/ansible/roles/nova/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/nova/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/nova/templates/libvirtd.conf.j2 b/ansible/roles/nova/templates/libvirtd.conf.j2
index 93137e798..9b43fc710 100644
--- a/ansible/roles/nova/templates/libvirtd.conf.j2
+++ b/ansible/roles/nova/templates/libvirtd.conf.j2
@@ -1,11 +1,6 @@
listen_tcp = 1
auth_tcp = "none"
ca_file = ""
-log_level = 2
-log_outputs = "2:file:/var/log/libvirt/libvirtd.log"
+log_level = 3
+log_outputs = "3:file:/var/log/libvirt/libvirtd.log"
listen_addr = "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
-unix_sock_group = "nova"
-unix_sock_ro_perms = "0777"
-unix_sock_rw_perms = "0770"
-auth_unix_ro = "none"
-auth_unix_rw = "none"
diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2
index 5d7a02197..e99c80209 100644
--- a/ansible/roles/nova/templates/nova.conf.j2
+++ b/ansible/roles/nova/templates/nova.conf.j2
@@ -1,6 +1,6 @@
# nova.conf
[DEFAULT]
-debug = true
+debug = {{ nova_logging_debug }}
syslog_log_facility=LOG_LOCAL0
use_syslog=yes
@@ -60,7 +60,7 @@ novncproxy_port = {{ nova_novncproxy_port }}
vncserver_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
vncserver_proxyclient_address = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
{% if inventory_hostname in groups['compute'] %}
-novncproxy_base_url = http://{{ kolla_internal_address }}:{{ nova_novncproxy_port }}/vnc_auto.html
+novncproxy_base_url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ nova_novncproxy_port }}/vnc_auto.html
{% endif %}
{% elif nova_console == 'spice' %}
[vnc]
@@ -70,7 +70,7 @@ enabled = false
server_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
server_proxyclient_address = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
{% if inventory_hostname in groups['compute'] %}
-html5proxy_base_url = http://{{ kolla_internal_address }}:{{ nova_spicehtml5proxy_port }}/spice_auto.html
+html5proxy_base_url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ nova_spicehtml5proxy_port }}/spice_auto.html
{% endif %}
html5proxy_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
html5proxy_port = {{ nova_spicehtml5proxy_port }}
@@ -83,7 +83,7 @@ admin_username = {{ ironic_keystone_user }}
admin_password = {{ ironic_keystone_password }}
admin_url = {{ openstack_auth_v2.auth_url }}
admin_tenant_name = service
-api_endpoint = http://{{ kolla_internal_address }}:{{ ironic_api_port }}/v1
+api_endpoint = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ ironic_api_port }}/v1
{% endif %}
[oslo_messaging_rabbit]
@@ -109,13 +109,13 @@ num_retries = {{ groups['glance-api'] | length }}
catalog_info = volume:cinder:internalURL
[neutron]
-url = http://{{ kolla_internal_address }}:{{ neutron_server_port }}
+url = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ neutron_server_port }}
auth_strategy = keystone
metadata_proxy_shared_secret = {{ metadata_secret }}
service_metadata_proxy = true
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
-auth_type = password
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_plugin = password
project_domain_name = default
user_domain_id = default
project_name = service
@@ -125,9 +125,12 @@ password = {{ neutron_keystone_password }}
[database]
connection = mysql+pymysql://{{ nova_database_user }}:{{ nova_database_password }}@{{ nova_database_address }}/{{ nova_database_name }}
+[api_database]
+connection = mysql+pymysql://{{ nova_api_database_user }}:{{ nova_api_database_password }}@{{ nova_api_database_address }}/{{ nova_api_database_name }}
+
[keystone_authtoken]
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
diff --git a/ansible/roles/prechecks/tasks/package_checks.yml b/ansible/roles/prechecks/tasks/package_checks.yml
index 15500d294..5c927e63e 100644
--- a/ansible/roles/prechecks/tasks/package_checks.yml
+++ b/ansible/roles/prechecks/tasks/package_checks.yml
@@ -4,3 +4,8 @@
register: result
failed_when: result | failed or
result.stdout | version_compare(docker_py_version_min, '<')
+
+- name: Checking Ansible version
+ local_action: command ansible --version
+ register: result
+ failed_when: result.stdout | regex_replace('ansible (\\d+\\.\\d+\\.\\d+)', '\\1') | version_compare(ansible_version_max, '>=')
diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml
index d62ba6ed3..5771742e5 100644
--- a/ansible/roles/prechecks/tasks/port_checks.yml
+++ b/ansible/roles/prechecks/tasks/port_checks.yml
@@ -359,6 +359,30 @@
state: stopped
when: inventory_hostname in groups['rabbitmq']
+- name: Checking free port for Mongodb
+ wait_for:
+ host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
+ port: "{{ mongodb_port }}"
+ connect_timeout: 1
+ state: stopped
+ when: inventory_hostname in groups['mongodb']
+
+- name: Checking free port for Mongodb Web
+ wait_for:
+ host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
+ port: "{{ mongodb_web_port }}"
+ connect_timeout: 1
+ state: stopped
+ when: inventory_hostname in groups['mongodb']
+
+- name: Checking free port for Mongodb HAProxy
+ wait_for:
+ host: "{{ kolla_internal_address }}"
+ port: "{{ mongodb_port }}"
+ connect_timeout: 1
+ state: stopped
+ when: inventory_hostname in groups['haproxy']
+
- name: Checking free port for Rsync
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }}"
diff --git a/ansible/roles/prechecks/vars/main.yml b/ansible/roles/prechecks/vars/main.yml
index ada1bca7b..3de7faad1 100644
--- a/ansible/roles/prechecks/vars/main.yml
+++ b/ansible/roles/prechecks/vars/main.yml
@@ -1,2 +1,3 @@
-docker_version_min: '1.9.0'
+docker_version_min: '1.10.0'
docker_py_version_min: '1.6.0'
+ansible_version_max: '2.0.0'
diff --git a/ansible/roles/rabbitmq/defaults/main.yml b/ansible/roles/rabbitmq/defaults/main.yml
index 6cf3246bc..b3ae1e9ca 100644
--- a/ansible/roles/rabbitmq/defaults/main.yml
+++ b/ansible/roles/rabbitmq/defaults/main.yml
@@ -8,10 +8,6 @@ rabbitmq_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker
rabbitmq_tag: "{{ openstack_release }}"
rabbitmq_image_full: "{{ rabbitmq_image }}:{{ rabbitmq_tag }}"
-rabbitmq_data_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-data"
-rabbitmq_data_tag: "{{ openstack_release }}"
-rabbitmq_data_image_full: "{{ rabbitmq_data_image }}:{{ rabbitmq_data_tag }}"
-
####################
# Message-Broker
diff --git a/ansible/roles/rabbitmq/tasks/bootstrap.yml b/ansible/roles/rabbitmq/tasks/bootstrap.yml
index 8567ce6aa..881d19553 100644
--- a/ansible/roles/rabbitmq/tasks/bootstrap.yml
+++ b/ansible/roles/rabbitmq/tasks/bootstrap.yml
@@ -1,19 +1,10 @@
---
-# TODO(SamYaple): Improve check with a custom docker module to check if alive
-- name: Checking if a rabbitmq_data exists
- command: docker exec rabbitmq_data stat /var/lib/rabbitmq/.erlang.cookie
- register: exists
- changed_when: False
- failed_when: False
- always_run: True
-
-- name: Starting rabbitmq-data container
+- name: Creating rabbitmq volume
kolla_docker:
- action: "start_container"
+ action: "create_volume"
common_options: "{{ docker_common_options }}"
- image: "{{ rabbitmq_data_image_full }}"
- name: "rabbitmq_data"
- volumes: "/var/lib/rabbitmq/"
+ name: "rabbitmq"
+ register: rabbitmq_volume
- name: Running RabbitMQ bootstrap container
kolla_docker:
@@ -25,8 +16,11 @@
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
RABBITMQ_CLUSTER_COOKIE: "{{ rabbitmq_cluster_cookie }}"
image: "{{ rabbitmq_image_full }}"
+ labels:
+ BOOTSTRAP:
name: "rabbitmq_bootstrap"
restart_policy: "never"
- volumes: "{{ node_config_directory }}/rabbitmq/:{{ container_config_directory }}/:ro"
- volumes_from: "rabbitmq_data"
- when: exists.rc != 0
+ volumes:
+ - "{{ node_config_directory }}/rabbitmq/:{{ container_config_directory }}/:ro"
+ - "rabbitmq:/var/lib/rabbitmq/"
+ when: rabbitmq_volume | changed
diff --git a/ansible/roles/rabbitmq/tasks/pull.yml b/ansible/roles/rabbitmq/tasks/pull.yml
index 55520a10a..cb289fabf 100644
--- a/ansible/roles/rabbitmq/tasks/pull.yml
+++ b/ansible/roles/rabbitmq/tasks/pull.yml
@@ -5,10 +5,3 @@
common_options: "{{ docker_common_options }}"
image: "{{ rabbitmq_image_full }}"
when: inventory_hostname in groups['rabbitmq']
-
-- name: Pulling rabbitmq-data image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ rabbitmq_data_image_full }}"
- when: inventory_hostname in groups['rabbitmq']
diff --git a/ansible/roles/rabbitmq/tasks/start.yml b/ansible/roles/rabbitmq/tasks/start.yml
index 59d693f3d..9ed544290 100644
--- a/ansible/roles/rabbitmq/tasks/start.yml
+++ b/ansible/roles/rabbitmq/tasks/start.yml
@@ -5,5 +5,6 @@
common_options: "{{ docker_common_options }}"
image: "{{ rabbitmq_image_full }}"
name: "rabbitmq"
- volumes: "{{ node_config_directory }}/rabbitmq/:{{ container_config_directory }}/:ro"
- volumes_from: "rabbitmq_data"
+ volumes:
+ - "{{ node_config_directory }}/rabbitmq/:{{ container_config_directory }}/:ro"
+ - "rabbitmq:/var/lib/rabbitmq/"
diff --git a/ansible/roles/rabbitmq/tasks/upgrade.yml b/ansible/roles/rabbitmq/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/rabbitmq/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/swift/defaults/main.yml b/ansible/roles/swift/defaults/main.yml
index 5e36ac132..b4fcb34e7 100644
--- a/ansible/roles/swift/defaults/main.yml
+++ b/ansible/roles/swift/defaults/main.yml
@@ -8,75 +8,36 @@ swift_proxy_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }
swift_proxy_server_tag: "{{ openstack_release }}"
swift_proxy_server_image_full: "{{ swift_proxy_server_image }}:{{ swift_proxy_server_tag }}"
-swift_account_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-account-server"
-swift_account_server_tag: "{{ openstack_release }}"
-swift_account_server_image_full: "{{ swift_account_server_image }}:{{ swift_account_server_tag }}"
+swift_account_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-account"
+swift_account_tag: "{{ openstack_release }}"
+swift_account_image_full: "{{ swift_account_image }}:{{ swift_account_tag }}"
-swift_account_auditor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-account-auditor"
-swift_account_auditor_tag: "{{ openstack_release }}"
-swift_account_auditor_image_full: "{{ swift_account_auditor_image }}:{{ swift_account_auditor_tag }}"
+swift_container_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container"
+swift_container_tag: "{{ openstack_release }}"
+swift_container_image_full: "{{ swift_container_image }}:{{ swift_container_tag }}"
-swift_account_replicator_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-account-replicator"
-swift_account_replicator_tag: "{{ openstack_release }}"
-swift_account_replicator_image_full: "{{ swift_account_replicator_image }}:{{ swift_account_replicator_tag }}"
-
-swift_account_reaper_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-account-reaper"
-swift_account_reaper_tag: "{{ openstack_release }}"
-swift_account_reaper_image_full: "{{ swift_account_reaper_image }}:{{ swift_account_reaper_tag }}"
-
-swift_container_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container-server"
-swift_container_server_tag: "{{ openstack_release }}"
-swift_container_server_image_full: "{{ swift_container_server_image }}:{{ swift_container_server_tag }}"
-
-swift_container_auditor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container-auditor"
-swift_container_auditor_tag: "{{ openstack_release }}"
-swift_container_auditor_image_full: "{{ swift_container_auditor_image }}:{{ swift_container_auditor_tag }}"
-
-swift_container_replicator_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container-replicator"
-swift_container_replicator_tag: "{{ openstack_release }}"
-swift_container_replicator_image_full: "{{ swift_container_replicator_image }}:{{ swift_container_replicator_tag }}"
-
-swift_container_updater_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-container-updater"
-swift_container_updater_tag: "{{ openstack_release }}"
-swift_container_updater_image_full: "{{ swift_container_updater_image }}:{{ swift_container_updater_tag }}"
-
-swift_object_auditor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-object-auditor"
-swift_object_auditor_tag: "{{ openstack_release }}"
-swift_object_auditor_image_full: "{{ swift_object_auditor_image }}:{{ swift_object_auditor_tag }}"
-
-swift_object_expirer_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-object-expirer"
-swift_object_expirer_tag: "{{ openstack_release }}"
-swift_object_expirer_image_full: "{{ swift_object_expirer_image }}:{{ swift_object_expirer_tag }}"
-
-swift_object_replicator_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-object-replicator"
-swift_object_replicator_tag: "{{ openstack_release }}"
-swift_object_replicator_image_full: "{{ swift_object_replicator_image }}:{{ swift_object_replicator_tag }}"
-
-swift_object_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-object-server"
-swift_object_server_tag: "{{ openstack_release }}"
-swift_object_server_image_full: "{{ swift_object_server_image }}:{{ swift_object_server_tag }}"
-
-swift_object_updater_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-object-updater"
-swift_object_updater_tag: "{{ openstack_release }}"
-swift_object_updater_image_full: "{{ swift_object_updater_image }}:{{ swift_object_updater_tag }}"
+swift_object_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-object"
+swift_object_tag: "{{ openstack_release }}"
+swift_object_image_full: "{{ swift_object_image }}:{{ swift_object_tag }}"
swift_rsyncd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-swift-rsyncd"
swift_rsyncd_tag: "{{ openstack_release }}"
swift_rsyncd_image_full: "{{ swift_rsyncd_image }}:{{ swift_rsyncd_tag }}"
####################
-# Openstack
+# OpenStack
####################
swift_public_address: "{{ kolla_external_address }}"
swift_admin_address: "{{ kolla_internal_address }}"
swift_internal_address: "{{ kolla_internal_address }}"
-swift_logging_verbose: "{{ openstack_logging_verbose }}"
swift_logging_debug: "{{ openstack_logging_debug }}"
swift_keystone_user: "swift"
swift_admin_tenant_name: "admin"
swift_devices_mount_point: "/srv/node"
+swift_devices_match_mode: "strict"
+swift_devices_name: "KOLLA_SWIFT_DATA"
openstack_swift_auth: "{'auth_url':'{{ openstack_auth_v2.auth_url }}','username':'{{ openstack_auth_v2.username }}','password':'{{ openstack_auth_v2.password }}','project_name':'{{ openstack_auth_v2.project_name }}'}"
diff --git a/ansible/roles/swift/tasks/config.yml b/ansible/roles/swift/tasks/config.yml
index 29410f78a..b5cfbf7e5 100644
--- a/ansible/roles/swift/tasks/config.yml
+++ b/ansible/roles/swift/tasks/config.yml
@@ -48,7 +48,7 @@
vars:
service_name: "swift-{{ item }}"
sources:
- - "roles/swift/templates/swift.conf.j2"
+ - "{{ role_path }}/templates/swift.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/swift.conf"
- "/etc/kolla/config/swift/{{ item }}.conf"
@@ -141,9 +141,9 @@
dest: "{{ node_config_directory }}/swift/{{ item }}"
backup: yes
with_items:
- - "account.ring"
+ - "account.builder"
- "account.ring.gz"
+ - "container.builder"
- "container.ring.gz"
- - "container.ring"
- - "object.ring"
+ - "object.builder"
- "object.ring.gz"
diff --git a/ansible/roles/swift/tasks/pull.yml b/ansible/roles/swift/tasks/pull.yml
index a0ca0c694..65cd6bb34 100644
--- a/ansible/roles/swift/tasks/pull.yml
+++ b/ansible/roles/swift/tasks/pull.yml
@@ -8,100 +8,30 @@
inventory_hostname in groups['swift-container-server'] or
inventory_hostname in groups['swift-object-server']
-- name: Pulling swift-account-auditor image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_account_auditor_image_full }}"
- when: inventory_hostname in groups['swift-account-server']
-
-- name: Pulling swift-account-reaper image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_account_reaper_image_full }}"
- when: inventory_hostname in groups['swift-account-server']
-
-- name: Pulling swift-account-replicator image
+- name: Pulling swift-proxy-server image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_account_replicator_image_full }}"
- when: inventory_hostname in groups['swift-account-server']
+ image: "{{ swift_proxy_server_image_full }}"
+ when: inventory_hostname in groups['swift-proxy-server']
-- name: Pulling swift-account-server image
+- name: Pulling swift-account image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_account_server_image_full }}"
+ image: "{{ swift_account_image_full }}"
when: inventory_hostname in groups['swift-account-server']
-- name: Pulling swift-container-auditor image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_container_auditor_image_full }}"
- when: inventory_hostname in groups['swift-container-server']
-
-- name: Pulling swift-container-replicator image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_container_replicator_image_full }}"
- when: inventory_hostname in groups['swift-container-server']
-
-- name: Pulling swift-container-server image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_container_server_image_full }}"
- when: inventory_hostname in groups['swift-container-server']
-
-- name: Pulling swift-container-updater image
+- name: Pulling swift-container image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_container_updater_image_full }}"
+ image: "{{ swift_container_image_full }}"
when: inventory_hostname in groups['swift-container-server']
-- name: Pulling swift-object-auditor image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_auditor_image_full }}"
- when: inventory_hostname in groups['swift-object-server']
-
-- name: Pulling swift-object-expirer image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_expirer_image_full }}"
- when: inventory_hostname in groups['swift-object-server']
-
-- name: Pulling swift-object-replicator image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_replicator_image_full }}"
- when: inventory_hostname in groups['swift-object-server']
-
-- name: Pulling swift-object-server image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_server_image_full }}"
- when: inventory_hostname in groups['swift-object-server']
-
-- name: Pulling swift-object-updater image
+- name: Pulling swift-object image
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_updater_image_full }}"
+ image: "{{ swift_object_image_full }}"
when: inventory_hostname in groups['swift-object-server']
-
-- name: Pulling swift-proxy-server image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ swift_proxy_server_image_full }}"
- when: inventory_hostname in groups['swift-proxy-server']
diff --git a/ansible/roles/swift/tasks/register.yml b/ansible/roles/swift/tasks/register.yml
index d2d61dd76..27e558a85 100644
--- a/ansible/roles/swift/tasks/register.yml
+++ b/ansible/roles/swift/tasks/register.yml
@@ -1,14 +1,14 @@
---
- name: Creating the Swift service and endpoint
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_service
-a "service_name=swift
service_type=object-store
description='Openstack Object Storage'
endpoint_region={{ openstack_region_name }}
- admin_url='http://{{ kolla_internal_address }}:{{ swift_proxy_server_port }}'
- internal_url='http://{{ kolla_internal_address }}:{{ swift_proxy_server_port }}/v1/AUTH_%(tenant_id)s'
- public_url='http://{{ kolla_external_address }}:{{ swift_proxy_server_port }}/v1/AUTH_%(tenant_id)s'
+ admin_url='{{ admin_protocol }}://{{ kolla_internal_address }}:{{ swift_proxy_server_port }}'
+ internal_url='{{ internal_protocol }}://{{ kolla_internal_address }}:{{ swift_proxy_server_port }}/v1/AUTH_%(tenant_id)s'
+ public_url='{{ public_protocol }}://{{ kolla_external_address }}:{{ swift_proxy_server_port }}/v1/AUTH_%(tenant_id)s'
region_name={{ openstack_region_name }}
auth={{ '{{ openstack_swift_auth }}' }}"
-e "{'openstack_swift_auth':{{ openstack_swift_auth }}}"
@@ -20,7 +20,7 @@
run_once: True
- name: Creating the Swift project, user, and role
- command: docker exec -t kolla_ansible /usr/bin/ansible localhost
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m kolla_keystone_user
-a "project=service
user={{ swift_keystone_user }}
diff --git a/ansible/roles/swift/tasks/start.yml b/ansible/roles/swift/tasks/start.yml
index 980c00b0a..11cb8eb11 100644
--- a/ansible/roles/swift/tasks/start.yml
+++ b/ansible/roles/swift/tasks/start.yml
@@ -1,4 +1,36 @@
---
+- name: Looking up disks for Swift
+ command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
+ -m find_disks
+ -a "name={{ swift_devices_name }}
+ match_mode={{ swift_devices_match_mode }}"
+ register: swift_disk_lookup
+ changed_when: "{{ swift_disk_lookup.stdout.find('localhost | SUCCESS => ') != -1 and
+ (swift_disk_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
+ failed_when: swift_disk_lookup.stdout.split()[2] != 'SUCCESS'
+ when: inventory_hostname in groups['swift-account-server'] or
+ inventory_hostname in groups['swift-container-server'] or
+ inventory_hostname in groups['swift-object-server']
+
+- name: Reading data from variable
+ set_fact:
+ swift_disks: "{{ (swift_disk_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).disks|from_json }}"
+ when: inventory_hostname in groups['swift-account-server'] or
+ inventory_hostname in groups['swift-container-server'] or
+ inventory_hostname in groups['swift-object-server']
+
+- name: Mounting Swift disks
+ mount:
+ src: "UUID={{ item.fs_uuid }}"
+ fstype: xfs
+ opts: "noatime,nodiratime,nobarrier,logbufs=8"
+ state: mounted
+ name: "{{ swift_devices_mount_point }}/{{ item['fs_label'] }}"
+ with_items: swift_disks
+ when: inventory_hostname in groups['swift-account-server'] or
+ inventory_hostname in groups['swift-container-server'] or
+ inventory_hostname in groups['swift-object-server']
+
- name: Starting swift-rsyncd container
kolla_docker:
action: "start_container"
@@ -7,10 +39,8 @@
name: "swift_rsyncd"
volumes:
- "{{ node_config_directory }}/swift-rsyncd/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname not in groups['swift-proxy-server']
- name: Starting swift-proxy-server container
@@ -22,10 +52,7 @@
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-proxy-server/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-proxy-server']
- name: Starting swift-account-server container
@@ -33,192 +60,166 @@
action: "start_container"
common_options: "{{ docker_common_options }}"
name: "swift_account_server"
- image: "{{ swift_account_server_image_full }}"
+ image: "{{ swift_account_image_full }}"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-server/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-auditor container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_account_auditor_image_full }}"
+ image: "{{ swift_account_image_full }}"
name: "swift_account_auditor"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-auditor/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-replicator container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_account_replicator_image_full }}"
+ image: "{{ swift_account_image_full }}"
name: "swift_account_replicator"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-replicator/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-reaper container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_account_reaper_image_full }}"
+ image: "{{ swift_account_image_full }}"
name: "swift_account_reaper"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-reaper/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-container-server container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_container_server_image_full }}"
+ image: "{{ swift_container_image_full }}"
name: "swift_container_server"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-server/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-auditor container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_container_auditor_image_full }}"
+ image: "{{ swift_container_image_full }}"
name: "swift_container_auditor"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-auditor/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-replicator container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_container_replicator_image_full }}"
+ image: "{{ swift_container_image_full }}"
name: "swift_container_replicator"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-replicator/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-updater container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_container_updater_image_full }}"
+ image: "{{ swift_container_image_full }}"
name: "swift_container_updater"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-updater/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-object-server container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_server_image_full }}"
+ image: "{{ swift_object_image_full }}"
name: "swift_object_server"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-server/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-auditor container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_auditor_image_full }}"
+ image: "{{ swift_object_image_full }}"
name: "swift_object_auditor"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-auditor/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-replicator container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_replicator_image_full }}"
+ image: "{{ swift_object_image_full }}"
name: "swift_object_replicator"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-replicator/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-updater container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_updater_image_full }}"
+ image: "{{ swift_object_image_full }}"
name: "swift_object_updater"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-updater/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-expirer container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
- image: "{{ swift_object_expirer_image_full }}"
+ image: "{{ swift_object_image_full }}"
name: "swift_object_expirer"
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-expirer/:{{ container_config_directory }}/:ro"
- - "/var/lib/kolla/dev/log:/dev/log"
- - "swift_sdb1:/srv/node/sdb1"
- - "swift_sdb2:/srv/node/sdb2"
- - "swift_sdb3:/srv/node/sdb3"
+ - "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
+ - "rsyslog_socket:/var/lib/kolla/rsyslog/"
when: inventory_hostname in groups['swift-object-server']
diff --git a/ansible/roles/swift/tasks/upgrade.yml b/ansible/roles/swift/tasks/upgrade.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/swift/tasks/upgrade.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/swift/templates/proxy-server.conf.j2 b/ansible/roles/swift/templates/proxy-server.conf.j2
index cea708a95..71a15c8a7 100644
--- a/ansible/roles/swift/templates/proxy-server.conf.j2
+++ b/ansible/roles/swift/templates/proxy-server.conf.j2
@@ -29,8 +29,8 @@ use = egg:swift#proxy_logging
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
-auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
-auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
+auth_uri = {{ internal_protocol }}://{{ kolla_internal_address }}:{{ keystone_public_port }}
+auth_url = {{ admin_protocol }}://{{ kolla_internal_address }}:{{ keystone_admin_port }}
auth_type = password
project_domain_id = default
user_domain_id = default
diff --git a/ansible/site.yml b/ansible/site.yml
index e4f7ff964..4bb48e0b4 100644
--- a/ansible/site.yml
+++ b/ansible/site.yml
@@ -26,6 +26,12 @@
tags: haproxy,
when: enable_haproxy | bool }
+- hosts: kibana
+ roles:
+ - { role: kibana,
+ tags: kibana,
+ when: enable_elk | bool }
+
- hosts: memcached
roles:
- { role: memcached,
@@ -88,7 +94,9 @@
- hosts:
- compute
- - neutron-agents
+ - neutron-dhcp-agent
+ - neutron-l3-agent
+ - neutron-metadata-agent
- neutron-server
- rabbitmq
roles:
@@ -162,3 +170,10 @@
- { role: mistral,
tags: mistral,
when: enable_mistral | bool }
+
+- hosts:
+ - mongodb
+ roles:
+ - { role: mongodb,
+ tags: mongodb,
+ when: enable_mongodb | bool }
diff --git a/dev/vagrant/Vagrantfile b/dev/vagrant/Vagrantfile
index aa1d2b342..a7e46533e 100644
--- a/dev/vagrant/Vagrantfile
+++ b/dev/vagrant/Vagrantfile
@@ -141,7 +141,7 @@ Vagrant.configure(2) do |config|
case PROVIDER
when "libvirt"
if vm.name
- `virsh -c qemu:///system net-dhcp-leases vagrant-private-dhcp | awk -F'[ /]+' '/#{vm.name} / {print $6}'`.chop
+ `python newest_dhcp_lease.py #{vm.name}`.chop
end
when "virtualbox_ubuntu"
when "virtualbox_centos"
diff --git a/dev/vagrant/centos-bootstrap.sh b/dev/vagrant/centos-bootstrap.sh
index 4589bd360..83d10c074 100644
--- a/dev/vagrant/centos-bootstrap.sh
+++ b/dev/vagrant/centos-bootstrap.sh
@@ -19,6 +19,7 @@ else
SUPPORT_NODE=support01
fi
REGISTRY=operator.local:${REGISTRY_PORT}
+ADMIN_PROTOCOL="http"
# Install common packages and do some prepwork.
function prep_work {
@@ -58,7 +59,8 @@ EOF
# Despite it shipping with /etc/sysconfig/docker, Docker is not configured to
# load it from it's service file.
- sed -i -r "s,(ExecStart)=(.+),\1=/usr/bin/docker -d --insecure-registry ${REGISTRY} --registry-mirror=http://${REGISTRY}," /usr/lib/systemd/system/docker.service
+ sed -i -r "s|(ExecStart)=(.+)|\1=/usr/bin/docker daemon --insecure-registry ${REGISTRY} --registry-mirror=http://${REGISTRY}|" /usr/lib/systemd/system/docker.service
+ sed -i 's|^MountFlags=.*|MountFlags=shared|' /usr/lib/systemd/system/docker.service
systemctl daemon-reload
systemctl enable docker
@@ -117,7 +119,7 @@ EOF
# The openrc file.
cat > ~vagrant/openrc <<EOF
-export OS_AUTH_URL="http://${SUPPORT_NODE}:35357/v3"
+export OS_AUTH_URL="$(ADMIN_PROTOCOL)://${SUPPORT_NODE}:35357/v3"
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_TENANT_NAME=admin
@@ -139,7 +141,7 @@ EOF
-e MIRROR_SOURCE_INDEX=https://index.docker.io \
-e STORAGE_PATH=/var/lib/registry \
-v /data/host/registry-storage:/var/lib/registry \
- registry:0.9.1
+ registry:2
fi
}
diff --git a/dev/vagrant/newest_dhcp_lease.py b/dev/vagrant/newest_dhcp_lease.py
new file mode 100644
index 000000000..1ade75bc4
--- /dev/null
+++ b/dev/vagrant/newest_dhcp_lease.py
@@ -0,0 +1,131 @@
+#!/usr/bin/env python
+
+# 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.
+
+"""
+Command-line utility to get the IP address from the newest DHCP lease.
+
+It's written for using with vagrant-hostmanager and vagrant-libvirt plugins.
+Vagrant-hostmanager by default fetches only IP addresses from eth0 interfaces
+on VM-s. Therefore, the first purpose of this utility is to be able to fetch
+the address also from the other interfaces.
+
+Libvirt/virsh only lists all DHCP leases for the given network with timestamps.
+DHCP leases have their expiration time, but are not cleaned up after destroying
+VM. If someone destroys and sets up the VM with the same hostname, we have
+many DHCP leases for the same hostname and we have to look up for timestamp.
+That's the second purpose of this script.
+"""
+
+import argparse
+import csv
+import functools
+import operator
+import xml.etree.ElementTree as etree
+
+import libvirt
+
+
+class NoBridgeInterfaceException(Exception):
+ pass
+
+
+class NoDHCPLeaseException(Exception):
+ pass
+
+
+def libvirt_conn(f):
+ @functools.wraps(f)
+ def wrapper(*args, **kwargs):
+ conn = libvirt.openReadOnly('qemu:///system')
+ return f(conn, *args, **kwargs)
+ return wrapper
+
+
+@libvirt_conn
+def get_vir_network_dhcp_lease(conn, vm_name):
+ """Libvirt since 1.2.6 version provides DHCPLeases method in virNetwork.
+
+ That's the current official way for getting DHCP leases and this
+ information isn't stored anywhere else anymore.
+ """
+ network = conn.networkLookupByName('vagrant-private-dhcp')
+ dhcp_leases = libvirt.virNetwork.DHCPLeases(network)
+
+ vm_dhcp_leases = filter(lambda lease: lease['hostname'] == vm_name,
+ dhcp_leases)
+
+ newest_vm_dhcp_lease = sorted(vm_dhcp_leases,
+ key=operator.itemgetter('expirytime'),
+ reverse=True)[0]['ipaddr']
+ return newest_vm_dhcp_lease
+
+
+def get_mac_address(conn, domain_name):
+ """Get MAC address from domain XML."""
+ domain = conn.lookupByName(domain_name)
+ domain_xml = domain.XMLDesc()
+ domain_tree = etree.fromstring(domain_xml)
+ devices = domain_tree.find('devices')
+ interfaces = devices.iterfind('interface')
+
+ for interface in interfaces:
+ interface_type = interface.get('type')
+ if interface_type != 'bridge':
+ continue
+ mac_element = interface.find('mac')
+ mac_address = mac_element.get('address')
+ return mac_address
+
+ raise NoBridgeInterfaceException()
+
+
+@libvirt_conn
+def get_dnsmasq_dhcp_lease(conn, vm_name):
+ """In libvirt under 1.2.6 DHCP leases are stored in file.
+
+ There is no API for DHCP leases yet.
+ """
+ domain_name = 'vagrant_' + vm_name
+ mac_address = get_mac_address(conn, domain_name)
+
+ with open(
+ '/var/lib/libvirt/dnsmasq/vagrant-private-dhcp.leases'
+ ) as leases_file:
+ reader = csv.reader(leases_file, delimiter=' ')
+ for row in reader:
+ lease_mac, lease_ip, lease_vm_name = row[1:4]
+ if not (lease_mac == mac_address and lease_vm_name == vm_name):
+ continue
+ return lease_ip
+
+ raise NoDHCPLeaseException()
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('vm_name', help='Name of the virtual machine')
+
+ args = parser.parse_args()
+ vm_name = args.vm_name
+
+ if libvirt.getVersion() >= 1002006:
+ newest_dhcp_lease = get_vir_network_dhcp_lease(vm_name)
+ else:
+ newest_dhcp_lease = get_dnsmasq_dhcp_lease(vm_name)
+
+ print(newest_dhcp_lease)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/dev/vagrant/ubuntu-bootstrap.sh b/dev/vagrant/ubuntu-bootstrap.sh
index 2c0b2cde7..028d09d1e 100644
--- a/dev/vagrant/ubuntu-bootstrap.sh
+++ b/dev/vagrant/ubuntu-bootstrap.sh
@@ -70,10 +70,10 @@ configure_kolla() {
}
echo "Kernel version $(uname -r)"
-if [[ $(uname -r) != *"3.19"* ]]; then
+if [[ $(uname -r) != *"4.2"* ]]; then
echo "Going to update kernel image"
apt-get update
- apt-get install -y linux-image-generic-lts-vivid
+ apt-get install -y linux-image-generic-lts-wily
# VM needs to be rebooted for docker to pickup the changes
echo "Rebooting for kernel changes"
echo "After reboot re-run vagrant provision to finish provising the box"
diff --git a/doc/image-building.rst b/doc/image-building.rst
index 935df31d4..ba07bbad4 100644
--- a/doc/image-building.rst
+++ b/doc/image-building.rst
@@ -67,9 +67,14 @@ To trigger build.py to pull images from local registry,
the Docker configuration needs to be modified. See
`Docker Insecure Registry Config`_.
-The build script reads its configuration from ``/etc/kolla/kolla-build.conf``
-or ``etc/kolla/kolla-build.conf``. This is where to change the default
-settings.
+The build configuration can be customised using a config file, the default
+location being one of ``/etc/kolla/kolla-build.conf`` or
+``etc/kolla/kolla-build.conf``. This file can be generated using the following
+command:
+
+::
+
+ tox -e genconfig
Build OpenStack from Source
diff --git a/doc/quickstart.rst b/doc/quickstart.rst
index bfb305e2d..ed87c62b3 100644
--- a/doc/quickstart.rst
+++ b/doc/quickstart.rst
@@ -29,6 +29,8 @@ The recommended deployment target requirements:
- More than 8gb main memory.
- At least 40gb disk space.
+.. NOTE:: Some commands below may require root permissions (e.g. pip, apt-get).
+
Installing Dependencies
-----------------------
@@ -49,7 +51,7 @@ and OverlayFS. In order to update kernel in Ubuntu 14.04 LTS to 4.2, run:
::
- sudo apt-get install linux-image-generic-lts-wily
+ apt-get install linux-image-generic-lts-wily
.. NOTE:: Install is *very* sensitive about version of components. Please
review carefully because default Operating System repos are likely out of
@@ -59,7 +61,7 @@ and OverlayFS. In order to update kernel in Ubuntu 14.04 LTS to 4.2, run:
Component Min Version Max Version Comment
===================== =========== =========== =========================
Ansible 1.9.4 < 2.0.0 On deployment host
-Docker 1.9.0 none On target nodes
+Docker 1.10.0 none On target nodes
Docker Python 1.6.0 none On target nodes
Python Jinja2 2.6.0 none On deployment host
===================== =========== =========== =========================
@@ -72,7 +74,7 @@ Make sure "pip" package manager is installed before procceed:
easy_install pip
# Ubuntu 14.04 LTS
- sudo apt-get install python-pip
+ apt-get install python-pip
To install Kolla tools and Python dependencies use:
@@ -116,7 +118,24 @@ is 1.8.3 or later and you are running Liberty, downgrade using these commands:
systemctl restart docker.service
# Ubuntu 14.04 LTS
- sudo apt-get install docker-engine=1.8.2-0~trusty
+ apt-get install docker-engine=1.8.2-0~trusty
+
+When running with systemd you must setup docker-engine with the appropriate
+information in the Docker daemon to launch with. This means setting up the
+following information in the docker.service file. If you do not set the
+MountFlags option correctly then Kolla-Ansible will fail to deploy on
+neutron-dhcp-agent container. After changing the service file you must reload
+and restart the docker service:
+
+::
+
+ # /lib/systemd/system/docker.service
+ [Service]
+ MountFlags=shared
+
+ # Run these commands to reload the daemon
+ systemctl daemon-reload
+ systemctl restart docker
On the system where the OpenStack CLI/Python code is run, the Kolla community
recommends installing the OpenStack python clients if they are not installed.
@@ -127,7 +146,7 @@ following requirements are needed to build the client code:
::
# Ubuntu
- sudo apt-get install -y python-dev libffi-dev libssl-dev gcc
+ apt-get install -y python-dev libffi-dev libssl-dev gcc
# Centos 7
yum install -y python-devel libffi-devel openssl-devel gcc
@@ -181,36 +200,43 @@ Kolla deploys OpenStack using
`Ansible <http://www.ansible.com>`__. Install Ansible from distribution
packaging if the distro packaging has recommended version available.
-Currently all implemented distro versions of Ansible are too old to use distro
-packaging. Once distro packaging is updated install from packaging using:
+Some implemented distro versions of Ansible are too old to use distro
+packaging. Currently, CentOS and RHEL package Ansible 1.9.4 which is
+suitable for use with Kolla.
+
+On CentOS or RHEL systems, this can be done using:
::
yum -y install ansible
-On DEB based systems this can be done using:
+Many DEB based systems do not meet Kolla's Ansible version requirements.
+It is recommended to use pip to install Ansible 1.9.4.
+
+Some ansible dependencies, like pycrypto, may need gcc installed on the build
+system. Install it using system packaging tools if it's not installed already:
::
- apt-get install ansible
+ # Centos 7
+ yum -y install gcc
+
+ # Ubuntu
+ apt-get install gcc
-If the distro packaged version of Ansible is too old, install Ansible using
-pip:
+Finally Ansible 1.9.4 may be installed using:
::
- pip install -U ansible
+ pip install -U ansible==1.9.4
-Some ansible dependencies, like pycrypto, may need gcc installed on the build
-system. Install it using system packaging tools if it's not installed already:
+If DEB based systems include a version of Ansible that meets Kolla's
+version requirements it can be installed by:
::
- # Centos 7
- yum -y install gcc
+ apt-get install ansible
- # Ubuntu
- sudo apt-get install gcc
Deploy a registry (required for multinode)
------------------------------------------
@@ -417,17 +443,6 @@ the system.
neutron_external_interface: "eth1"
-The docker\_pull\_policy specifies whether Docker should always pull
-images from the repository it is configured for, or only in the case
-where the image isn't present locally. If building local images without
-pushing them to the Docker registry or a local registry, please set this
-value to "missing" or when running deployment Docker will attempt to
-fetch the latest image upstream.
-
-::
-
- docker_pull_policy: "missing"
-
If using a local docker registry, set the docker\_registry information where
the local registry is operating on IP address 192.168.1.100 and the port 4000.
diff --git a/doc/swift-guide.rst b/doc/swift-guide.rst
index bf50c770b..c159b0536 100644
--- a/doc/swift-guide.rst
+++ b/doc/swift-guide.rst
@@ -7,19 +7,51 @@ Kolla can deploy a full working Swift setup in either a AIO or multi node setup.
Prerequisites
-------------
-Before running Swift we need to generate "rings", which are binary compressed files that at a high
-level let the various Swift services know where data is in the cluster. We hope to automate this
-process in a future release.
+Before running Swift we need to generate "rings", which are binary compressed
+files that at a high level let the various Swift services know where data is in
+the cluster. We hope to automate this process in a future release.
-Swift also expects block devices to be available and partitioned on the host, which Swift uses in
-combination with the rings to store data. Swift demos commonly just use directories created under
-/srv/node to simulate these devices. In order to ease "out of the box" testing of Kolla, we offer a
-similar setup with a data container. *Note*, data containers are very inefficient for this purpose.
-In production setups operators will want to provision disks according to the Swift operator guide,
-which can then be added the rings and used in Kolla.
+disks with partition table (recommended)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-For an AIO setup, the following commands can be used, locally, to generate rings containing the data
-container directories:
+Swift also expects block devices to be available for storage. To prepare a disk
+for use as Swift storage device, a special partition name and filesystem label
+need to be added. So that Kolla can detect those disks and mount for services.
+
+Follow the example below to add 3 disks for an AIO demo setup.
+
+::
+
+ # <WARNING ALL DATA ON DISK will be LOST!>
+ index=0
+ for d in sdc sdd sde; do
+ parted /dev/${d} -s -- mklabel gpt mkpart KOLLA_SWIFT_DATA 1 -1
+ sudo mkfs.xfs -f -L d${index} /dev/${d}1
+ (( index++ ))
+ done
+
+disks without partition table
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Kolla also supports unpartitioned disk (filesystem on /dev/sdc instead of
+/dev/sdc1) detection purely based on filesystem label. This is generally not a
+recommended practice but can be helpful for Kolla to take over Swift deployment
+already using disk like this.
+
+Given hard disks with labels swd1, swd2, swd3, use the following settings in
+ansible/roles/swift/defaults/main.yml
+
+::
+
+ swift_devices_match_mode: "prefix"
+ swift_devices_name: "swd"
+
+rings
+~~~~~
+
+Run following commands locally to generate Rings for AIO demo setup. The
+commands work with "disks with partition table" example listed above. Please
+modify accordingly if your setup is different.
::
@@ -33,11 +65,11 @@ container directories:
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base \
swift-ring-builder /etc/kolla/config/swift/object.builder create 10 3 1
- for partition in sdb1 sdb2 sdb3; do
+ for i in {0..2}; do
docker run \
-v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base swift-ring-builder \
- /etc/kolla/config/swift/object.builder add z1-${KOLLA_INTERNAL_ADDRESS}:6000/${partition} 1;
+ /etc/kolla/config/swift/object.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6000/d${i} 1;
done
# Account ring
@@ -46,11 +78,11 @@ container directories:
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base \
swift-ring-builder /etc/kolla/config/swift/account.builder create 10 3 1
- for partition in sdb1 sdb2 sdb3; do
+ for i in {0..2}; do
docker run \
-v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base swift-ring-builder \
- /etc/kolla/config/swift/account.builder add z1-${KOLLA_INTERNAL_ADDRESS}:6001/${partition} 1;
+ /etc/kolla/config/swift/account.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6001/d${i} 1;
done
# Container ring
@@ -59,11 +91,11 @@ container directories:
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base \
swift-ring-builder /etc/kolla/config/swift/container.builder create 10 3 1
- for partition in sdb1 sdb2 sdb3; do
+ for i in {0..2}; do
docker run \
-v /etc/kolla/config/swift/:/etc/kolla/config/swift/ \
kollaglue/${KOLLA_BASE_DISTRO}-${KOLLA_INSTALL_TYPE}-swift-base swift-ring-builder \
- /etc/kolla/config/swift/container.builder add z1-${KOLLA_INTERNAL_ADDRESS}:6002/${partition} 1;
+ /etc/kolla/config/swift/container.builder add r1z1-${KOLLA_INTERNAL_ADDRESS}:6002/d${i} 1;
done
for ring in object account container; do
@@ -81,6 +113,12 @@ http://docs.openstack.org/kilo/install-guide/install/apt/content/swift-initial-r
Deploying
---------
+Enable Swift in /etc/kolla/globals.yml:
+
+::
+
+ enable_swift : "yes"
+
Once the rings are in place, deploying Swift is the same as any other Kolla Ansible service. Below
is the minimal command to bring up Swift AIO, and it's dependencies:
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2
index 19d245528..4fe02e7e1 100644
--- a/docker/base/Dockerfile.j2
+++ b/docker/base/Dockerfile.j2
@@ -3,28 +3,6 @@ MAINTAINER {{ maintainer }}
LABEL kolla_version="{{ kolla_version }}"
-{# Early failure for bases and types #}
-{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
- {% if install_type not in ['source', 'binary', 'rdo', 'rhel'] %}
-
-RUN echo 'ERROR: {{ install_type }} is unavailable for {{ base_distro }}' \
- && /bin/false
-
- {% endif %}
-{% elif base_distro in ['ubuntu', 'debian'] %}
- {% if install_type not in ['source','binary'] %}
-
-RUN echo 'ERROR: {{ install_type }} is unavailable for {{ base_distro }}' \
- && /bin/false
-
- {% endif %}
-{% else %}
-
-RUN echo 'ERROR: The specified distro has no Kolla images to build: "{{ base_distro }}"' \
- && /bin/false
-
-{% endif %}
-
{{ include_header }}
@@ -171,14 +149,15 @@ ENV DEBIAN_FRONTEND noninteractive
COPY sources.list /etc/apt/
COPY apt_preferences /etc/apt/preferences
-RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 199369E5404BD5FC7D2FE43BCBCB082A1BB943DB \
- && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 391A9AA2147192839E9DB0315EDB1B62EC4926EA \
- && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \
- && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com 08B73419AC32B4E966C1A330E84AC2C0460F3994 \
+RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 199369E5404BD5FC7D2FE43BCBCB082A1BB943DB \
+ && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 391A9AA2147192839E9DB0315EDB1B62EC4926EA \
+ && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A \
+ && apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 08B73419AC32B4E966C1A330E84AC2C0460F3994 \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
+ ca-certificates \
python \
python-jinja2 \
python-kazoo \
diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py
index d426b3569..d2f1a5643 100644
--- a/docker/base/set_configs.py
+++ b/docker/base/set_configs.py
@@ -158,7 +158,7 @@ def copy_files(data):
LOG.info("Copying %s to %s",
os.path.join(source_path, src), dest_path)
- if os.path.isdir(src):
+ if os.path.isdir(os.path.join(source_path, src)):
shutil.copytree(os.path.join(source_path, src), dest_path)
else:
shutil.copy(os.path.join(source_path, src), dest_path)
diff --git a/docker/base/sources.list b/docker/base/sources.list
index a57d337a0..d63541f02 100644
--- a/docker/base/sources.list
+++ b/docker/base/sources.list
@@ -3,7 +3,7 @@ deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
-# Backports have a lower priority and must be explictly installed to be used
+# Backports have a lower priority and must be explicitly installed to be used
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
# We need to add the Liberty repo for the updated packages they provide. The main
diff --git a/docker/base/start.sh b/docker/base/start.sh
index d75a885f3..d9801d750 100644
--- a/docker/base/start.sh
+++ b/docker/base/start.sh
@@ -1,6 +1,16 @@
#!/bin/bash
set -o errexit
+# TODO(SamYaple): After we merge Heka it should be possible to remove
+# this symlink, investigate that after Heka is finalized
+# NOTE(SamYaple): Setting up logging socket to /dev/log
+if [[ ! "${!SKIP_LOG_SETUP[@]}" && -e /var/lib/kolla/rsyslog ]]; then
+ while [[ ! -S /var/lib/kolla/rsyslog/log ]]; do
+ sleep 1
+ done
+ sudo ln -sf /var/lib/kolla/rsyslog/log /dev/log
+fi
+
# Processing /var/lib/kolla/config_files/config.json as root. This is necessary
# to permit certain files to be controlled by the root user which should
# not be writable by the dropped-privileged user, especially /run_command
diff --git a/docker/base/sudoers b/docker/base/sudoers
index 974f36a29..0ca91304a 100644
--- a/docker/base/sudoers
+++ b/docker/base/sudoers
@@ -13,6 +13,6 @@ root ALL=(ALL) ALL
# anyone in the kolla group may run /usr/local/bin/kolla_set_configs as the
# root user via sudo without password confirmation
-%kolla ALL=(root) NOPASSWD: /usr/local/bin/kolla_set_configs, /usr/bin/install
+%kolla ALL=(root) NOPASSWD: /usr/local/bin/kolla_set_configs, /usr/bin/install, /bin/ln -sf /var/lib/kolla/rsyslog/log /dev/log
#includedir /etc/sudoers.d
diff --git a/docker/ceilometer/ceilometer-base/Dockerfile.j2 b/docker/ceilometer/ceilometer-base/Dockerfile.j2
index 3d34b370e..1d1965d9e 100644
--- a/docker/ceilometer/ceilometer-base/Dockerfile.j2
+++ b/docker/ceilometer/ceilometer-base/Dockerfile.j2
@@ -17,8 +17,9 @@ RUN ln -s ceilometer-base-source/* ceilometer \
&& useradd --user-group ceilometer \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /ceilometer \
&& mkdir -p /etc/ceilometer /var/log/ceilometer /home/ceilometer \
- && cp -r /ceilometer/etc/* /etc/ceilometer/ \
- && chown -R ceilometer: /etc/ceilometer /var/log/ceilometer /home/ceilometer
+ && cp -r /ceilometer/etc/ceilometer/* /etc/ceilometer/ \
+ && chown -R ceilometer: /etc/ceilometer /var/log/ceilometer /home/ceilometer \
+ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/ceilometer/rootwrap.conf
{% endif %}
diff --git a/docker/ceph/ceph-mon/extend_start.sh b/docker/ceph/ceph-mon/extend_start.sh
index 3b8246e37..fe8222897 100644
--- a/docker/ceph/ceph-mon/extend_start.sh
+++ b/docker/ceph/ceph-mon/extend_start.sh
@@ -5,7 +5,7 @@ KEYRING_ADMIN="/etc/ceph/ceph.client.admin.keyring"
KEYRING_MON="/etc/ceph/ceph.client.mon.keyring"
KEYRING_RGW="/etc/ceph/ceph.client.radosgw.keyring"
MONMAP="/etc/ceph/ceph.monmap"
-MON_DIR="/var/lib/ceph/mon/ceph-$(hostname)"
+MON_DIR="/var/lib/ceph/mon/ceph-$(hostname -s)"
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@@ -19,10 +19,9 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
ceph-authtool --create-keyring "${KEYRING_RGW}" --gen-key -n client.radosgw.gateway --set-uid=0 --cap osd 'allow rwx' --cap mon 'allow rwx'
ceph-authtool "${KEYRING_MON}" --import-keyring "${KEYRING_ADMIN}"
ceph-authtool "${KEYRING_MON}" --import-keyring "${KEYRING_RGW}"
- monmaptool --create --add "$(hostname)" "${MON_IP}" --fsid "${FSID}" "${MONMAP}"
+ monmaptool --create --add "$(hostname -s)" "${MON_IP}" --fsid "${FSID}" "${MONMAP}"
- echo "Sleeping until keys are fetched"
- /bin/sleep infinity
+ exit 0
fi
# This section runs on every mon that does not have a keyring already.
@@ -33,6 +32,6 @@ if [[ ! -e "${MON_DIR}/keyring" ]]; then
ceph-authtool --create-keyring "${KEYRING_TMP}" --import-keyring "${KEYRING_ADMIN}"
ceph-authtool "${KEYRING_TMP}" --import-keyring "${KEYRING_MON}"
mkdir -p "${MON_DIR}"
- ceph-mon --mkfs -i "$(hostname)" --monmap "${MONMAP}" --keyring "${KEYRING_TMP}"
+ ceph-mon --mkfs -i "$(hostname -s)" --monmap "${MONMAP}" --keyring "${KEYRING_TMP}"
rm "${KEYRING_TMP}"
fi
diff --git a/docker/cinder/cinder-api/Dockerfile.j2 b/docker/cinder/cinder-api/Dockerfile.j2
index e0769302c..d9b819e5d 100644
--- a/docker/cinder/cinder-api/Dockerfile.j2
+++ b/docker/cinder/cinder-api/Dockerfile.j2
@@ -7,6 +7,12 @@ MAINTAINER {{ maintainer }}
RUN yum install -y python-keystone \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ cinder-api \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/cinder/cinder-backup/Dockerfile.j2 b/docker/cinder/cinder-backup/Dockerfile.j2
index 054982359..74a5ebea1 100644
--- a/docker/cinder/cinder-backup/Dockerfile.j2
+++ b/docker/cinder/cinder-backup/Dockerfile.j2
@@ -1,6 +1,16 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }}
+{% if install_type == 'binary' %}
+ {% if base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ cinder-backup \
+ && apt-get clean
+
+ {% endif %}
+{% endif %}
+
{{ include_footer }}
USER cinder
diff --git a/docker/cinder/cinder-base/Dockerfile.j2 b/docker/cinder/cinder-base/Dockerfile.j2
index a679a0b82..b8ba16df2 100644
--- a/docker/cinder/cinder-base/Dockerfile.j2
+++ b/docker/cinder/cinder-base/Dockerfile.j2
@@ -4,26 +4,36 @@ MAINTAINER {{ maintainer }}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-# TODO(Martin) remove python-oslo-policy once RDO package is fixed
RUN yum -y install openstack-cinder \
python-automaton \
lvm2 \
ceph-common \
- python-oslo-policy \
&& yum clean all \
&& mkdir -p /etc/ceph
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ cinder-common \
+ ceph-common \
+ lvm2 \
+ && apt-get clean \
+ && mkdir -p /etc/ceph
+
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN yum -y install lvm2 \
+RUN yum -y install \
+ lvm2 \
+ qemu-img \
&& yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
lvm2 \
+ qemu-utils \
ceph-common \
&& apt-get clean \
&& mkdir -p /etc/ceph
@@ -36,7 +46,12 @@ RUN ln -s cinder-base-source/* cinder \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /cinder \
&& mkdir -p /etc/cinder /var/log/cinder /var/lib/cinder /home/cinder \
&& cp -r /cinder/etc/cinder/* /etc/cinder/ \
- && chown -R cinder: /etc/cinder /var/log/cinder /var/lib/cinder /home/cinder
+ && chown -R cinder: /etc/cinder /var/log/cinder /var/lib/cinder /home/cinder \
+ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/cinder/rootwrap.conf
+
+COPY cinder_sudoers /etc/sudoers.d/cinder_sudoers
+RUN chmod 750 /etc/sudoers.d \
+ && chmod 440 /etc/sudoers.d/cinder_sudoers
{% endif %}
diff --git a/docker/cinder/cinder-base/cinder_sudoers b/docker/cinder/cinder-base/cinder_sudoers
new file mode 100644
index 000000000..3750f31a0
--- /dev/null
+++ b/docker/cinder/cinder-base/cinder_sudoers
@@ -0,0 +1 @@
+cinder ALL = (root) NOPASSWD: /var/lib/kolla/venv/bin/cinder-rootwrap /etc/cinder/rootwrap.conf *
diff --git a/docker/cinder/cinder-scheduler/Dockerfile.j2 b/docker/cinder/cinder-scheduler/Dockerfile.j2
index 054982359..2e2a12675 100644
--- a/docker/cinder/cinder-scheduler/Dockerfile.j2
+++ b/docker/cinder/cinder-scheduler/Dockerfile.j2
@@ -1,6 +1,16 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }}
+{% if install_type == 'binary' %}
+ {% if base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ cinder-scheduler \
+ && apt-get clean
+
+ {% endif %}
+{% endif %}
+
{{ include_footer }}
USER cinder
diff --git a/docker/cinder/cinder-volume/Dockerfile.j2 b/docker/cinder/cinder-volume/Dockerfile.j2
index e3aef3fc2..7a98145ef 100644
--- a/docker/cinder/cinder-volume/Dockerfile.j2
+++ b/docker/cinder/cinder-volume/Dockerfile.j2
@@ -9,6 +9,12 @@ RUN yum install -y \
scsi-target-utils \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ cinder-volume \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/data/Dockerfile.j2 b/docker/data/Dockerfile.j2
deleted file mode 100644
index 17cd85b1b..000000000
--- a/docker/data/Dockerfile.j2
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM {{ base_distro }}:{{ base_distro_tag }}
-MAINTAINER {{ maintainer }}
-
-CMD ["/bin/sleep", "infinity"]
-
-{{ include_footer }}
diff --git a/docker/designate/designate-api/Dockerfile.j2 b/docker/designate/designate-api/Dockerfile.j2
index e5713ddd1..0f20163ca 100644
--- a/docker/designate/designate-api/Dockerfile.j2
+++ b/docker/designate/designate-api/Dockerfile.j2
@@ -5,9 +5,15 @@ MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum install -y \
- openstack-designate-api \
+ openstack-designate-api \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ designate-api \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/designate/designate-backend-bind9/Dockerfile.j2 b/docker/designate/designate-backend-bind9/Dockerfile.j2
index 898011a48..6ed56cb7a 100644
--- a/docker/designate/designate-backend-bind9/Dockerfile.j2
+++ b/docker/designate/designate-backend-bind9/Dockerfile.j2
@@ -9,6 +9,12 @@ RUN yum install -y bind \
&& mkdir -p /var/lib/kolla/ \
&& cp -pr /var/named /var/lib/kolla/var-named
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ bind9 \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/designate/designate-base/Dockerfile.j2 b/docker/designate/designate-base/Dockerfile.j2
index 989cb9e37..4aec9796c 100644
--- a/docker/designate/designate-base/Dockerfile.j2
+++ b/docker/designate/designate-base/Dockerfile.j2
@@ -17,6 +17,13 @@ RUN yum install -y \
&& rpm -e openstack-designate-api \
&& mv /tmp/policy.json /etc/designate/
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ designate-common \
+ python-tooz \
+ && apt-get clean
+
{% endif %}
{% elif install_type == 'source' %}
@@ -26,7 +33,9 @@ RUN ln -s designate-base-source/* designate \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /designate \
&& mkdir -p /etc/designate /var/log/designate /home/designate \
&& cp -r /designate/etc/designate/* /etc/designate/ \
- && chown -R designate: /etc/designate /var/log/designate /home/designate
+ && mv /etc/designate/rootwrap.conf.sample /etc/designate/rootwrap.conf \
+ && chown -R designate: /etc/designate /var/log/designate /home/designate \
+ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/designate/rootwrap.conf
{% endif %}
diff --git a/docker/designate/designate-central/Dockerfile.j2 b/docker/designate/designate-central/Dockerfile.j2
index c4571c834..dfd67978e 100644
--- a/docker/designate/designate-central/Dockerfile.j2
+++ b/docker/designate/designate-central/Dockerfile.j2
@@ -7,6 +7,12 @@ MAINTAINER {{ maintainer }}
RUN yum install -y openstack-designate-central \
&& yum clean all
+ {% elif base_distro in ['ubuntu']%}
+
+RUN apt-get install -y --no-install-recommends \
+ designate-central \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/designate/designate-mdns/Dockerfile.j2 b/docker/designate/designate-mdns/Dockerfile.j2
index 9757709aa..2ed4386af 100644
--- a/docker/designate/designate-mdns/Dockerfile.j2
+++ b/docker/designate/designate-mdns/Dockerfile.j2
@@ -7,6 +7,12 @@ MAINTAINER {{ maintainer }}
RUN yum install -y openstack-designate-mdns \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ designate-mdns \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/designate/designate-poolmanager/Dockerfile.j2 b/docker/designate/designate-poolmanager/Dockerfile.j2
index e8c218e03..9cad51c89 100644
--- a/docker/designate/designate-poolmanager/Dockerfile.j2
+++ b/docker/designate/designate-poolmanager/Dockerfile.j2
@@ -10,6 +10,13 @@ RUN yum install -y \
bind \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ designate-pool-manager \
+ bind9 \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/designate/designate-sink/Dockerfile.j2 b/docker/designate/designate-sink/Dockerfile.j2
index 732c1fa45..0e7addd07 100644
--- a/docker/designate/designate-sink/Dockerfile.j2
+++ b/docker/designate/designate-sink/Dockerfile.j2
@@ -9,6 +9,13 @@ RUN yum install -y \
python-designateclient \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y -no-install-recommends \
+ designate-sink \
+ designateclient \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/dind/start.sh b/docker/dind/start.sh
index 61a4b09e9..8d861f744 100644
--- a/docker/dind/start.sh
+++ b/docker/dind/start.sh
@@ -3,7 +3,7 @@
set -o errexit
set -o nounset
-# External processes will be occuring and we must wait for them
+# External processes will be occurring and we must wait for them
while [[ ! -e "/kolla_dind_ready" ]]; do
sleep 1
done
@@ -11,7 +11,7 @@ done
docker daemon -s btrfs 2>&1 > docker.log &
docker_pid=$!
-mkdir /var/run/sshd
+mkdir -p /var/run/sshd
/usr/sbin/sshd -D 2>&1 > sshd.log &
sshd_pid=$!
diff --git a/docker/gnocchi/gnocchi-base/Dockerfile.j2 b/docker/gnocchi/gnocchi-base/Dockerfile.j2
index 1d8ba2ff4..e5c98d4aa 100644
--- a/docker/gnocchi/gnocchi-base/Dockerfile.j2
+++ b/docker/gnocchi/gnocchi-base/Dockerfile.j2
@@ -17,7 +17,7 @@ RUN apt-get install -y --no-install-recommends libpq-dev \
ADD gnocchi-base-archive /gnocchi-base-source
RUN ln -s gnocchi-base-source/* gnocchi \
&& useradd --user-group gnocchi \
- && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /gnocchi \
+ && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt tooz /gnocchi \
&& mkdir -p /etc/gnocchi /var/log/gnocchi /home/gnocchi \
&& cp -r /gnocchi/etc/* /etc/gnocchi/ \
&& chown -R gnocchi: /etc/gnocchi /var/log/gnocchi /home/gnocchi
diff --git a/docker/heat/heat-api/extend_start.sh b/docker/heat/heat-api/extend_start.sh
index 6c4fc431f..ca4f83da5 100644
--- a/docker/heat/heat-api/extend_start.sh
+++ b/docker/heat/heat-api/extend_start.sh
@@ -4,8 +4,10 @@
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
heat-manage db_sync
- openstack domain create heat_user_domain
- openstack user create --domain heat_user_domain heat_domain_admin --password ${HEAT_DOMAIN_ADMIN_PASSWORD}
- openstack role add --domain heat_user_domain --user heat_domain_admin admin
+ openstack domain create heat
+ openstack user create --domain heat heat_domain_admin --password ${HEAT_DOMAIN_ADMIN_PASSWORD}
+ openstack role add --domain heat --user heat_domain_admin admin
+ openstack role create heat_stack_owner
+ openstack role create heat_stack_user
exit 0
fi
diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2
index f55b26907..03a8dcb1b 100644
--- a/docker/horizon/Dockerfile.j2
+++ b/docker/horizon/Dockerfile.j2
@@ -18,8 +18,7 @@ RUN yum -y install \
RUN sed -i "s|WEBROOT = '/dashboard/'|WEBROOT = '/'|" /etc/openstack-dashboard/local_settings \
&& cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
- && /usr/bin/python /usr/bin/manage.py collectstatic --noinput --clear \
- && /usr/bin/python /usr/bin/manage.py compress --force
+ && /usr/bin/python /usr/bin/manage.py collectstatic --noinput --clear
{% elif base_distro in ['ubuntu'] %}
@@ -34,7 +33,6 @@ RUN cp /usr/share/openstack-dashboard/openstack_dashboard/conf/*.json /etc/opens
&& sed -i "s|^POLICY_FILES_PATH|POLICY_FILES_PATH = '/etc/openstack-dashboard'|" /etc/openstack-dashboard/local_settings.py \
&& cp /usr/share/openstack-dashboard/manage.py /usr/bin/manage.py \
&& /usr/bin/python /usr/bin/manage.py collectstatic --noinput \
- && /usr/bin/manage.py compress --force \
&& rm /etc/apache2/conf-enabled/openstack-dashboard.conf \
&& echo "" > /etc/apache2/ports.conf \
&& rm /etc/openstack-dashboard/local_settings.py \
@@ -73,7 +71,6 @@ RUN ln -s horizon-source/* horizon \
&& cp /horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings \
&& cp /horizon/manage.py /var/lib/kolla/venv/bin/manage.py \
&& /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py collectstatic --noinput --clear \
- && /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compress --force \
&& chown -R horizon: /etc/openstack-dashboard /home/horizon /var/lib/kolla/venv/lib/python2.7/site-packages/static
{% endif %}
diff --git a/docker/horizon/extend_start.sh b/docker/horizon/extend_start.sh
index a82821f14..fe58e023f 100644
--- a/docker/horizon/extend_start.sh
+++ b/docker/horizon/extend_start.sh
@@ -12,3 +12,16 @@ fi
if [[ "${KOLLA_BASE_DISTRO}" =~ fedora|centos|oraclelinux|rhel ]]; then
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
fi
+
+# NOTE(jeffrey4l): The local_settings file affect django-compress
+# behavior, so re-generate the compressed javascript and css if it
+# is changed
+MD5SUM_TXT_PATH="/tmp/.local_settings.md5sum.txt"
+if [[ ! -f ${MD5SUM_TXT_PATH} || $(md5sum -c --status ${MD5SUM_TXT_PATH};echo $?) != 0 ]]; then
+ md5sum /etc/openstack-dashboard/local_settings > ${MD5SUM_TXT_PATH}
+ if [[ "${KOLLA_INSTALL_TYPE}" == "binary" ]]; then
+ /usr/bin/manage.py compress --force
+ elif [[ "${KOLLA_INSTALL_TYPE}" == "source" ]]; then
+ /var/lib/kolla/venv/bin/python /var/lib/kolla/venv/bin/manage.py compress --force
+ fi
+fi
diff --git a/docker/ironic/ironic-api/Dockerfile.j2 b/docker/ironic/ironic-api/Dockerfile.j2
index 211b42f57..c83449285 100644
--- a/docker/ironic/ironic-api/Dockerfile.j2
+++ b/docker/ironic/ironic-api/Dockerfile.j2
@@ -7,6 +7,12 @@ MAINTAINER {{ maintainer }}
RUN yum -y install openstack-ironic-api \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ ironic-api \
+ && apt-get clean
+
{% endif %}
{% endif %}
diff --git a/docker/ironic/ironic-base/Dockerfile.j2 b/docker/ironic/ironic-base/Dockerfile.j2
index b4f5037c8..4dc6e7fc3 100644
--- a/docker/ironic/ironic-base/Dockerfile.j2
+++ b/docker/ironic/ironic-base/Dockerfile.j2
@@ -8,6 +8,12 @@ RUN yum -y install \
openstack-ironic-common \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ ironic-common \
+ && apt-get clean
+
{% endif %}
{% elif install_type == 'source' %}
@@ -17,7 +23,8 @@ RUN ln -s ironic-base-source/* ironic \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /ironic \
&& mkdir -p /etc/ironic /var/log/ironic /home/ironic \
&& cp -r /ironic/etc/ironic/* /etc/ironic/ \
- && chown -R ironic: /etc/ironic /var/log/ironic /home/ironic
+ && chown -R ironic: /etc/ironic /var/log/ironic /home/ironic \
+ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/ironic/rootwrap.conf
{% endif %}
diff --git a/docker/ironic/ironic-conductor/Dockerfile.j2 b/docker/ironic/ironic-conductor/Dockerfile.j2
index 4372ff6ef..fac65c930 100644
--- a/docker/ironic/ironic-conductor/Dockerfile.j2
+++ b/docker/ironic/ironic-conductor/Dockerfile.j2
@@ -7,6 +7,14 @@ MAINTAINER {{ maintainer }}
RUN yum -y install openstack-ironic-conductor \
&& yum clean all
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ ironic-conductor \
+ qemu-utils \
+ ipmitool \
+ && apt-get clean
+
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
@@ -14,8 +22,7 @@ RUN yum -y install openstack-ironic-conductor \
RUN yum -y install ipmitool \
&& yum clean all
- {% endif %}
- {% if base_distro in ['ubuntu', 'debian'] %}
+ {% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
qemu-utils \
diff --git a/docker/ironic/ironic-pxe/Dockerfile.j2 b/docker/ironic/ironic-pxe/Dockerfile.j2
index 72961d4b5..bda9a9bdd 100644
--- a/docker/ironic/ironic-pxe/Dockerfile.j2
+++ b/docker/ironic/ironic-pxe/Dockerfile.j2
@@ -6,9 +6,7 @@ MAINTAINER {{ maintainer }}
RUN yum -y install \
tftp-server \
syslinux-tftpboot \
- && yum clean all \
- && mkdir -p /tftpboot \
- && cp /var/lib/tftpboot/chain.c32 /tftpboot
+ && yum clean all
{% elif base_distro in ['ubuntu', 'debian'] %}
@@ -16,13 +14,12 @@ RUN apt-get install -y --no-install-recommends \
tftpd-hpa \
syslinux-common \
syslinux \
- && apt-get clean \
- && mkdir -p /tftpboot \
- && chown -R ironic: /tftpboot \
- && cp /usr/lib/syslinux/pxelinux.0 /usr/lib/syslinux/chain.c32 /tftpboot
+ && apt-get clean
{% endif %}
-COPY tftp-map-file /tftpboot/map-file
+COPY tftp-map-file /map-file
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
{{ include_footer }}
diff --git a/docker/ironic/ironic-pxe/extend_start.sh b/docker/ironic/ironic-pxe/extend_start.sh
new file mode 100644
index 000000000..0f5fcd679
--- /dev/null
+++ b/docker/ironic/ironic-pxe/extend_start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ chown -R ironic: /tftpboot
+ for pxe_file in /var/lib/tftpboot/chain.c32 /usr/lib/syslinux/pxelinux.0 /usr/lib/syslinux/chain.c32; do
+ if [[ -e "$pxe_file" ]]; then
+ cp "$pxe_file" /tftpboot
+ fi
+ done
+ exit 0
+fi
+
diff --git a/docker/keystone/Dockerfile.j2 b/docker/keystone/Dockerfile.j2
index 9d1fe298c..b00b72a5f 100644
--- a/docker/keystone/Dockerfile.j2
+++ b/docker/keystone/Dockerfile.j2
@@ -11,6 +11,7 @@ RUN yum -y install openstack-keystone \
&& yum clean all
RUN mkdir -p /var/www/cgi-bin/keystone \
+ && cp -a /usr/share/keystone/keystone-dist-paste.ini /etc/keystone/keystone-paste.ini \
&& cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/main \
&& cp -a /usr/share/keystone/keystone.wsgi /var/www/cgi-bin/keystone/admin \
&& sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
@@ -60,6 +61,11 @@ RUN ln -s keystone-source/* keystone \
{% endif %}
+# NOTE(SamYaple): This is to reintroduce a deprecated option as a quick-fix
+# until the correct new procedure is implemented.
+# TODO(SamYaple): Replace this with `keystone-manage bootstrap`
+RUN sed -i 's|token_auth json_body|token_auth admin_token_auth json_body|g' /etc/keystone/keystone-paste.ini
+
RUN chown -R keystone: /var/www/cgi-bin/keystone \
&& chmod 755 /var/www/cgi-bin/keystone/*
diff --git a/docker/kibana/Dockerfile.j2 b/docker/kibana/Dockerfile.j2
new file mode 100644
index 000000000..3868e3a8d
--- /dev/null
+++ b/docker/kibana/Dockerfile.j2
@@ -0,0 +1,19 @@
+FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+ENV KIBANA_VERSION 4.3.1
+ENV KIBANA_DIR /opt/kibana/
+ENV KIBANA_ARCHIVE kibana-${KIBANA_VERSION}-linux-x64.tar.gz
+
+RUN useradd -r -m --user-group kibana \
+ && usermod -a -G kolla kibana
+
+RUN curl "https://download.elastic.co/kibana/kibana/$KIBANA_ARCHIVE" -o $KIBANA_ARCHIVE \
+ && mkdir -p $KIBANA_DIR \
+ && tar -xz --strip-components=1 -f $KIBANA_ARCHIVE -C $KIBANA_DIR \
+ && chown -R kibana:kibana $KIBANA_DIR \
+ && rm -f $KIBANA_ARCHIVE
+
+{{ include_footer }}
+
+USER kibana
diff --git a/docker/kolla-ansible/find_disks.py b/docker/kolla-ansible/find_disks.py
deleted file mode 100644
index d5761ceb0..000000000
--- a/docker/kolla-ansible/find_disks.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/python
-
-# Copyright 2015 Sam Yaple
-#
-# 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.
-
-# This module has been relicensed from the source below:
-# https://github.com/SamYaple/yaodu/blob/master/ansible/library/ceph_osd_list
-
-DOCUMENTATION = '''
----
-module: find_disks
-short_description: Return list of devices containing a specfied label
-description:
- - This will return a list of all devices with a GPT partition label with
- the name specified.
-options:
- partition_name:
- description:
- - Partition name
- required: True
- type: bool
-author: Sam Yaple
-'''
-
-EXAMPLES = '''
-- hosts: ceph-osd
- tasks:
- - name: Return all valid formated devices with the name KOLLA_CEPH_OSD
- ceph_osd_list:
- partition_name: 'KOLLA_CEPH_OSD'
- register: osds
-'''
-
-import json
-import pyudev
-
-
-def main():
- argument_spec = dict(
- partition_name=dict(required=True, type='str')
- )
- module = AnsibleModule(argument_spec)
- partition_name = module.params.get('partition_name')
-
- try:
- ret = list()
- ct = pyudev.Context()
- for dev in ct.list_devices(subsystem='block', DEVTYPE='partition'):
- if dev.get('ID_PART_ENTRY_NAME') == partition_name:
- fs_uuid = dev.get('ID_FS_UUID')
- if not fs_uuid:
- fs_uuid = ''
- dev_parent = dev.find_parent('block').device_node
- ret.append({'device': dev_parent, 'fs_uuid': fs_uuid})
- module.exit_json(disks=json.dumps(ret))
- except Exception as e:
- module.exit_json(failed=True, msg=repr(e))
-
-# import module snippets
-from ansible.module_utils.basic import * # noqa
-if __name__ == '__main__':
- main()
diff --git a/docker/kolla-ansible/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2
index 5f67010fa..8d27d0ef0 100644
--- a/docker/kolla-ansible/Dockerfile.j2
+++ b/docker/kolla-toolbox/Dockerfile.j2
@@ -16,7 +16,8 @@ RUN yum -y install \
openssl-devel \
python-devel \
openssh-clients \
- && yum clean all
+ && yum clean all \
+ && yum -y remove pytz
{% elif base_distro in ['ubuntu', 'debian'] %}
@@ -33,15 +34,9 @@ RUN apt-get -y --no-install-recommends install \
{% endif %}
-# TODO(jeffrey4l): Pin the pip to the 7.1.2. version. latest pip
-# (now 8.0) can not install the package when conflict with the
-# system. The best solution should use the virtualenv for
-# isolation or following bug is fixed:
-# https://github.com/pypa/pip/pull/3389
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py \
&& rm get-pip.py \
- && pip install pip==7.1.2 \
&& pip --no-cache-dir install --upgrade wheel \
&& pip --no-cache-dir install \
MySQL-python \
diff --git a/docker/kolla-ansible/ansible.cfg b/docker/kolla-toolbox/ansible.cfg
index c45b65ae1..c45b65ae1 100644
--- a/docker/kolla-ansible/ansible.cfg
+++ b/docker/kolla-toolbox/ansible.cfg
diff --git a/docker/kolla-toolbox/find_disks.py b/docker/kolla-toolbox/find_disks.py
new file mode 100644
index 000000000..6ebf2b6a2
--- /dev/null
+++ b/docker/kolla-toolbox/find_disks.py
@@ -0,0 +1,115 @@
+#!/usr/bin/python
+
+# Copyright 2015 Sam Yaple
+#
+# 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.
+
+# This module has been relicensed from the source below:
+# https://github.com/SamYaple/yaodu/blob/master/ansible/library/ceph_osd_list
+
+DOCUMENTATION = '''
+---
+module: find_disks
+short_description: Return list of devices containing a specfied name or label
+description:
+ - This will return a list of all devices with either GPT partition name
+ or filesystem label of the name specified.
+options:
+ match_mode:
+ description:
+ - Label match mode, either strict or prefix
+ default: 'strict'
+ required: False
+ choices: [ "strict", "prefix" ]
+ type: str
+ name:
+ description:
+ - Partition name or filesystem label
+ required: True
+ type: str
+ aliases: [ 'partition_name' ]
+author: Sam Yaple
+'''
+
+EXAMPLES = '''
+- hosts: ceph-osd
+ tasks:
+ - name: Return all valid formated devices with the name KOLLA_CEPH_OSD
+ find_disks:
+ name: 'KOLLA_CEPH_OSD'
+ register: osds
+
+- hosts: swift-object-server
+ tasks:
+ - name: Return all valid devices with the name KOLLA_SWIFT
+ find_disks:
+ name: 'KOLLA_SWIFT'
+ register: swift_disks
+
+- hosts: swift-object-server
+ tasks:
+ - name: Return all valid devices with wildcard name 'swift_d*'
+ find_disks:
+ name: 'swift_d' match_mode: 'prefix'
+ register: swift_disks
+'''
+
+import json
+import pyudev
+
+
+def main():
+ argument_spec = dict(
+ match_mode=dict(required=False, choices=['strict', 'prefix'],
+ default='strict'),
+ name=dict(aliases=['partition_name'], required=True, type='str')
+ )
+ module = AnsibleModule(argument_spec)
+ match_mode = module.params.get('match_mode')
+ name = module.params.get('name')
+
+ def is_dev_matched_by_name(dev, name):
+ if dev.get('DEVTYPE', '') == 'partition':
+ dev_name = dev.get('ID_PART_ENTRY_NAME', '')
+ else:
+ dev_name = dev.get('ID_FS_LABEL', '')
+
+ if match_mode == 'strict':
+ return dev_name == name
+ elif match_mode == 'prefix':
+ return dev_name.startswith(name)
+ else:
+ return False
+
+ try:
+ ret = list()
+ ct = pyudev.Context()
+ for dev in ct.list_devices(subsystem='block'):
+ if is_dev_matched_by_name(dev, name):
+ fs_uuid = dev.get('ID_FS_UUID', '')
+ fs_label = dev.get('ID_FS_LABEL', '')
+ if dev.get('DEVTYPE', '') == 'partition':
+ device_node = dev.find_parent('block').device_node
+ else:
+ device_node = dev.device_node
+ ret.append({'device': device_node,
+ 'fs_uuid': fs_uuid,
+ 'fs_label': fs_label})
+ module.exit_json(disks=json.dumps(ret))
+ except Exception as e:
+ module.exit_json(failed=True, msg=repr(e))
+
+# import module snippets
+from ansible.module_utils.basic import * # noqa
+if __name__ == '__main__':
+ main()
diff --git a/docker/kolla-ansible/kolla_keystone_service.py b/docker/kolla-toolbox/kolla_keystone_service.py
index 7c03d00e1..7c03d00e1 100644
--- a/docker/kolla-ansible/kolla_keystone_service.py
+++ b/docker/kolla-toolbox/kolla_keystone_service.py
diff --git a/docker/kolla-ansible/kolla_keystone_user.py b/docker/kolla-toolbox/kolla_keystone_user.py
index 2d1a739c5..2d1a739c5 100644
--- a/docker/kolla-ansible/kolla_keystone_user.py
+++ b/docker/kolla-toolbox/kolla_keystone_user.py
diff --git a/docker/kolla-ansible/kolla_sanity.py b/docker/kolla-toolbox/kolla_sanity.py
index 7f4eea9fc..7f4eea9fc 100644
--- a/docker/kolla-ansible/kolla_sanity.py
+++ b/docker/kolla-toolbox/kolla_sanity.py
diff --git a/docker/kolla-ansible/kolla_zookeeper.py b/docker/kolla-toolbox/kolla_zookeeper.py
index d6326f46a..d6326f46a 100644
--- a/docker/kolla-ansible/kolla_zookeeper.py
+++ b/docker/kolla-toolbox/kolla_zookeeper.py
diff --git a/docker/logging/rsyslog/Dockerfile.j2 b/docker/logging/rsyslog/Dockerfile.j2
index 2a955fbf5..84bbd607c 100644
--- a/docker/logging/rsyslog/Dockerfile.j2
+++ b/docker/logging/rsyslog/Dockerfile.j2
@@ -13,6 +13,4 @@ RUN apt-get install -y --no-install-recommends rsyslog \
{% endif %}
-COPY extend_start.sh /usr/local/bin/kolla_extend_start
-
{{ include_footer }}
diff --git a/docker/logging/rsyslog/extend_start.sh b/docker/logging/rsyslog/extend_start.sh
deleted file mode 100644
index 0742fa0a2..000000000
--- a/docker/logging/rsyslog/extend_start.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-if [[ -e "/dev/log" ]]; then
- rm -rf /dev/log
-fi
diff --git a/docker/magnum/magnum-base/Dockerfile.j2 b/docker/magnum/magnum-base/Dockerfile.j2
index d03205167..e29f1e06d 100644
--- a/docker/magnum/magnum-base/Dockerfile.j2
+++ b/docker/magnum/magnum-base/Dockerfile.j2
@@ -2,25 +2,12 @@ FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if install_type == 'binary' %}
- {% if base_distro in ['centos'] %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %}
-RUN curl https://copr.fedoraproject.org/coprs/sdake/openstack-magnum/repo/epel-7/sdake-openstack-magnum-epel-7.repo -o /etc/yum.repos.d/sdake-openstack-magnum-epel-7.repo \
- && rpm --import https://copr-be.cloud.fedoraproject.org/results/sdake/openstack-magnum/pubkey.gpg \
+RUN curl -L https://trunk.rdoproject.org/centos7/current/delorean.repo -o /etc/yum.repos.d/delorean.repo \
&& yum install -y openstack-magnum-common \
&& yum clean all
- {% elif base_distro in ['fedora'] %}
-
-RUN curl https://copr.fedoraproject.org/coprs/sdake/openstack-magnum/repo/fedora-22/sdake-openstack-magnum-fedora-22.repo -o /etc/yum.repos.d/sdake-openstack-magnum-f22.repo \
- && rpm --import https://copr-be.cloud.fedoraproject.org/results/sdake/openstack-magnum/pubkey.gpg \
- && yum install -y openstack-magnum-common \
- && yum clean all
-
- {% elif base_distro in ['oraclelinux'] %}
-
-RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
- && /bin/false
-
{% endif %}
{% elif install_type == 'source' %}
diff --git a/docker/manila/manila-base/Dockerfile.j2 b/docker/manila/manila-base/Dockerfile.j2
index adbcc9711..305bff96b 100644
--- a/docker/manila/manila-base/Dockerfile.j2
+++ b/docker/manila/manila-base/Dockerfile.j2
@@ -2,19 +2,22 @@ FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
- && /bin/false
+RUN yum -y install openstack-manila \
+ && yum clean all
+ {% endif %}
{% elif install_type == 'source' %}
ADD manila-base-archive /manila-base-source
RUN ln -s manila-base-source/* manila \
&& useradd --user-group manila \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /manila \
- && mkdir -p /etc/manila /var/log/manila /home/manila \
+ && mkdir -p /etc/manila /var/lib/manila /var/cache/manila /var/log/manila /home/manila \
&& cp -r /manila/etc/manila/* /etc/manila/ \
- && chown -R manila: /etc/manila /var/log/manila /home/manila
+ && chown -R manila: /etc/manila /var/lib/manila /var/cache/manila /var/log/manila /home/manila \
+ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/manila/rootwrap.conf
{% endif %}
diff --git a/docker/manila/manila-share/Dockerfile.j2 b/docker/manila/manila-share/Dockerfile.j2
index a3ca1820b..8a57896ac 100644
--- a/docker/manila/manila-share/Dockerfile.j2
+++ b/docker/manila/manila-share/Dockerfile.j2
@@ -1,6 +1,15 @@
FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }}
MAINTAINER {{ maintainer }}
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
+
+RUN yum -y install openstack-manila-share \
+ && yum clean all
+
+ {% endif %}
+{% endif %}
+
{{ include_footer }}
USER manila
diff --git a/docker/mariadb/extend_start.sh b/docker/mariadb/extend_start.sh
index dcbdac2ed..55e9ae4c9 100644
--- a/docker/mariadb/extend_start.sh
+++ b/docker/mariadb/extend_start.sh
@@ -4,7 +4,7 @@ function bootstrap_db {
mysqld_safe --wsrep-new-cluster &
# Wait for the mariadb server to be "Ready" before starting the security reset with a max timeout
TIMEOUT=${DB_MAX_TIMEOUT:-60}
- while [ ! -f ${DB_PID_FILE} ]; do
+ while [[ ! -f /var/lib/mysql/mariadb.pid ]]; do
if [[ ${TIMEOUT} -gt 0 ]]; then
let TIMEOUT-=1
sleep 1
@@ -18,7 +18,10 @@ function bootstrap_db {
mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" shutdown
}
-sudo chown mysql: /var/lib/mysql
+# Only update permissions if permissions need to be updated
+if [[ $(stat -c %U:%G /var/lib/mysql) != "mysql:mysql" ]]; then
+ sudo chown mysql: /var/lib/mysql
+fi
# This catches all cases of the BOOTSTRAP variable being set, including empty
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
diff --git a/docker/mongodb/Dockerfile.j2 b/docker/mongodb/Dockerfile.j2
index 03cbb2a7f..78f8b32b5 100644
--- a/docker/mongodb/Dockerfile.j2
+++ b/docker/mongodb/Dockerfile.j2
@@ -15,9 +15,17 @@ RUN apt-get install -y --no-install-recommends mongodb-server \
{% endif %}
-RUN mkdir -p /data/db
+RUN mkdir -p /var/lib/mongodb /home/mongodb \
+ && chown -R mongodb: /var/lib/mongodb /home/mongodb
-# TODO(SamYaple): updated mongodb to match the rest of Kolla
-#ENTRYPOINT exec /bin/mongod --dbpath /data/db --logpath /var/log/mongodb/mongo.log --noprealloc --smallfiles
+COPY mongodb_sudoers /etc/sudoers.d/mongodb_sudoers
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+
+RUN usermod -a -G kolla mongodb \
+ && chmod 755 /usr/local/bin/kolla_extend_start \
+ && chmod 750 /etc/sudoers.d \
+ && chmod 440 /etc/sudoers.d/mongodb_sudoers
{{ include_footer }}
+
+USER mongodb
diff --git a/docker/mongodb/extend_start.sh b/docker/mongodb/extend_start.sh
new file mode 100644
index 000000000..f00369ff0
--- /dev/null
+++ b/docker/mongodb/extend_start.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+echo "run extended start"
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ sudo chown mongodb: /var/lib/mongodb/
+ exit 0
+fi
diff --git a/docker/mongodb/mongodb_sudoers b/docker/mongodb/mongodb_sudoers
new file mode 100644
index 000000000..8a8f4e3cc
--- /dev/null
+++ b/docker/mongodb/mongodb_sudoers
@@ -0,0 +1 @@
+%kolla ALL=(root) NOPASSWD: /usr/bin/chown mongodb\: /var/lib/mongodb/, /bin/chown mongodb\: /var/lib/mongodb/
diff --git a/docker/neutron/neutron-agents/Dockerfile.j2 b/docker/neutron/neutron-agents/Dockerfile.j2
deleted file mode 100644
index 8b90871bd..000000000
--- a/docker/neutron/neutron-agents/Dockerfile.j2
+++ /dev/null
@@ -1,52 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-RUN yum install -y \
- openvswitch \
- supervisor \
- && yum clean all
-
-COPY supervisord.conf /etc/
-
-{% elif base_distro in ['ubuntu', 'debian'] %}
-
-RUN apt-get install -y --no-install-recommends supervisor \
- && apt-get clean
-
-COPY supervisord.conf /etc/supervisor/
-
- {% if install_type == 'binary' %}
-
-RUN apt-get install -y --no-install-recommends \
- neutron-metadata-agent \
- neutron-dhcp-agent \
- neutron-l3-agent \
- && apt-get clean
-
- {% endif %}
-{% endif %}
-
-# TODO: SamYaple FWaaS is part of the l3-agent, not a separate agent that is
-# why this file is needed. To support FWaaS we cannot have a separate container
-# I need to figure out the best way to make this work together
-#
-# This file _does_ _not_ need to exist, you must remove referencing it from the
-# exec line in the start script. Also all these config options can exist in the
-# main neutron.conf if we wish
-COPY fwaas_driver.ini /etc/neutron/
-
-COPY neutron-dhcp-agent/ /var/lib/kolla/neutron-dhcp-agent
-COPY neutron-l3-agent/ /var/lib/kolla/neutron-l3-agent
-COPY neutron-metadata-agent/ /var/lib/kolla/neutron-metadata-agent
-COPY config-sudoers.sh /var/lib/kolla/
-
-COPY start.sh /
-
-# We will remove this line in Docker 1.10 when namespace propogation works
-VOLUME /run/netns
-
-CMD ["/start.sh"]
-
-{{ include_footer }}
diff --git a/docker/neutron/neutron-agents/config-sudoers.sh b/docker/neutron/neutron-agents/config-sudoers.sh
deleted file mode 100644
index 82cf0d624..000000000
--- a/docker/neutron/neutron-agents/config-sudoers.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-# Neutron uses rootwrap which requires a tty for sudo.
-# Since the container is running in daemon mode, a tty
-# is not present and requiretty must be commented out.
-if [ ! -f /sudo-modified ]; then
- chmod 0640 /etc/sudoers
- sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers
- chmod 0440 /etc/sudoers
-fi
-
-touch /sudo-modified
diff --git a/docker/neutron/neutron-agents/fwaas_driver.ini b/docker/neutron/neutron-agents/fwaas_driver.ini
deleted file mode 120000
index a9b1ec519..000000000
--- a/docker/neutron/neutron-agents/fwaas_driver.ini
+++ /dev/null
@@ -1 +0,0 @@
-neutron-l3-agent/fwaas_driver.ini \ No newline at end of file
diff --git a/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh b/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh
deleted file mode 100755
index 47c2ee160..000000000
--- a/docker/neutron/neutron-agents/neutron-dhcp-agent/start.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /var/lib/kolla/config-sudoers.sh
-
-# Will be removed when neutron-agents is a thin container
-CMD="neutron-dhcp-agent"
-ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini"
-
-exec $CMD $ARGS
diff --git a/docker/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini b/docker/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini
deleted file mode 100644
index 41f761abf..000000000
--- a/docker/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[fwaas]
-#driver = neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver
-#enabled = True
diff --git a/docker/neutron/neutron-agents/neutron-l3-agent/start.sh b/docker/neutron/neutron-agents/neutron-l3-agent/start.sh
deleted file mode 100755
index da1b1cc57..000000000
--- a/docker/neutron/neutron-agents/neutron-l3-agent/start.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /var/lib/kolla/config-sudoers.sh
-
-# Will be removed when this container is broken out into thin containers
-CMD="neutron-l3-agent"
-ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini"
-
-exec $CMD $ARGS
diff --git a/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh b/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh
deleted file mode 100755
index 9464a5196..000000000
--- a/docker/neutron/neutron-agents/neutron-metadata-agent/start.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# Loading common functions.
-source /var/lib/kolla/config-sudoers.sh
-
-# Will be removed when this container is broken out in thin containers
-CMD="neutron-metadata-agent"
-ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini"
-
-exec $CMD $ARGS
diff --git a/docker/neutron/neutron-agents/start.sh b/docker/neutron/neutron-agents/start.sh
deleted file mode 100755
index fb1732277..000000000
--- a/docker/neutron/neutron-agents/start.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-set -o errexit
-
-# We must remove all of the stale namespaces if they exist
-rm -f /run/netns/*
-
-# Processing /var/lib/kolla/config_files/config.json
-python /usr/local/bin/kolla_set_configs
-
-exec /usr/bin/supervisord
diff --git a/docker/neutron/neutron-agents/supervisord.conf b/docker/neutron/neutron-agents/supervisord.conf
deleted file mode 100644
index b7a808b3a..000000000
--- a/docker/neutron/neutron-agents/supervisord.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-[unix_http_server]
-file = /var/run/supervisor.sock
-
-[inet_http_server]
-port = 127.0.0.1:9001
-
-[supervisord]
-nodaemon=true
-logfile = /var/log/supervisor/supervisord.log
-logfile_maxbytes = 200KB
-logfile_backups = 1
-pidfile = /var/run/supervisord.pid
-childlogdir = /var/log/supervisor
-
-[rpcinterface:supervisor]
-supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
-
-[supervisorctl]
-serverurl = unix:///var/run/supervisor.sock
-
-[program:neutron-dhcp-agent]
-command=/var/lib/kolla/neutron-dhcp-agent/start.sh
-priority=40
-startsec=10
-stderr_events_enabled=true
-stdout_events_enabled=true
-
-[program:neutron-metadata-agent]
-command=/var/lib/kolla/neutron-metadata-agent/start.sh
-priority=40
-startsec=10
-stderr_events_enabled=true
-stdout_events_enabled=true
-
-[program:neutron-l3-agent]
-command=/var/lib/kolla/neutron-l3-agent/start.sh
-priority=40
-startsec=10
-stderr_events_enabled=true
-stdout_events_enabled=true
diff --git a/docker/neutron/neutron-base/Dockerfile.j2 b/docker/neutron/neutron-base/Dockerfile.j2
index a305d198f..cece61ed7 100644
--- a/docker/neutron/neutron-base/Dockerfile.j2
+++ b/docker/neutron/neutron-base/Dockerfile.j2
@@ -4,12 +4,10 @@ MAINTAINER {{ maintainer }}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-# TODO(mandre) remove python-oslo-reports once RDO package is fixed
RUN yum -y install \
openstack-neutron \
openstack-neutron-ml2 \
openvswitch \
- python-oslo-reports \
&& yum clean all
{% elif base_distro in ['ubuntu'] %}
@@ -36,11 +34,12 @@ RUN yum -y install \
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get install -y --no-install-recommends \
- iptables \
+ arping \
dnsmasq \
- uuid-runtime \
ipset \
+ iptables \
openvswitch-switch \
+ uuid-runtime \
&& apt-get clean
{% endif %}
@@ -49,14 +48,17 @@ ADD neutron-base-archive /neutron-base-source
RUN ln -s neutron-base-source/* neutron \
&& useradd --user-group neutron \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /neutron \
- && mkdir -p /etc/neutron /usr/share/neutron /var/log/neutron /home/neutron \
+ && mkdir -p /etc/neutron /usr/share/neutron /var/lib/neutron /var/log/neutron /home/neutron \
&& cp -r /neutron/etc/* /etc/neutron/ \
&& cp -r /neutron/etc/neutron/* /etc/neutron/ \
&& cp /neutron/etc/api-paste.ini /usr/share/neutron \
&& mv /etc/neutron/neutron/ /etc/neutron/plugins/ \
- && chown -R neutron: /etc/neutron /usr/share/neutron /var/log/neutron /home/neutron
+ && chown -R neutron: /etc/neutron /usr/share/neutron /var/lib/neutron /var/log/neutron /home/neutron \
+ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/neutron/rootwrap.conf
{% endif %}
-COPY extend_start.sh /usr/local/bin/kolla_extend_start
-RUN chmod 755 /usr/local/bin/kolla_extend_start
+COPY neutron_sudoers /etc/sudoers.d/neutron_sudoers
+RUN usermod -a -G kolla neutron \
+ && chmod 750 /etc/sudoers.d \
+ && chmod 440 /etc/sudoers.d/neutron_sudoers
diff --git a/docker/neutron/neutron-base/extend_start.sh b/docker/neutron/neutron-base/extend_start.sh
deleted file mode 100644
index 07212efce..000000000
--- a/docker/neutron/neutron-base/extend_start.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-# Neutron uses rootwrap which requires a tty for sudo.
-# Since the container is running in daemon mode, a tty
-# is not present and requiretty must be commented out.
-if [ ! -f /sudo-modified ]; then
- chmod 0640 /etc/sudoers
- sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers
- chmod 0440 /etc/sudoers
- touch /sudo-modified
-fi
diff --git a/docker/neutron/neutron-base/ip_wrapper.py b/docker/neutron/neutron-base/ip_wrapper.py
index 33177d03e..b7c77c3d1 100644
--- a/docker/neutron/neutron-base/ip_wrapper.py
+++ b/docker/neutron/neutron-base/ip_wrapper.py
@@ -40,7 +40,7 @@ def host_mnt_exec(cmd):
except Exception as e:
print(
- "An error has occured with a component that Kolla manages."
+ "An error has occurred with a component that Kolla manages."
" Please file a bug")
print("Error: ", e)
diff --git a/docker/neutron/neutron-base/neutron_sudoers b/docker/neutron/neutron-base/neutron_sudoers
new file mode 100644
index 000000000..ad4489200
--- /dev/null
+++ b/docker/neutron/neutron-base/neutron_sudoers
@@ -0,0 +1 @@
+neutron ALL = (root) NOPASSWD: /var/lib/kolla/venv/bin/neutron-rootwrap /etc/neutron/rootwrap.conf *
diff --git a/docker/neutron/neutron-dhcp-agent/Dockerfile.j2 b/docker/neutron/neutron-dhcp-agent/Dockerfile.j2
new file mode 100644
index 000000000..ea5ede23c
--- /dev/null
+++ b/docker/neutron/neutron-dhcp-agent/Dockerfile.j2
@@ -0,0 +1,16 @@
+FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+{% if base_distro in ['ubuntu', 'debian'] %}
+ {% if install_type == 'binary' %}
+
+RUN apt-get install -y --no-install-recommends \
+ neutron-dhcp-agent \
+ && apt-get clean
+
+ {% endif %}
+{% endif %}
+
+{{ include_footer }}
+
+USER neutron
diff --git a/docker/neutron/neutron-l3-agent/Dockerfile.j2 b/docker/neutron/neutron-l3-agent/Dockerfile.j2
new file mode 100644
index 000000000..be3087d53
--- /dev/null
+++ b/docker/neutron/neutron-l3-agent/Dockerfile.j2
@@ -0,0 +1,16 @@
+FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+{% if base_distro in ['ubuntu', 'debian'] %}
+ {% if install_type == 'binary' %}
+
+RUN apt-get install -y --no-install-recommends \
+ neutron-l3-agent \
+ && apt-get clean
+
+ {% endif %}
+{% endif %}
+
+{{ include_footer }}
+
+USER neutron
diff --git a/docker/neutron/neutron-metadata-agent/Dockerfile.j2 b/docker/neutron/neutron-metadata-agent/Dockerfile.j2
new file mode 100644
index 000000000..f8798e93c
--- /dev/null
+++ b/docker/neutron/neutron-metadata-agent/Dockerfile.j2
@@ -0,0 +1,23 @@
+FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+{% if base_distro in ['ubuntu', 'debian'] %}
+ {% if install_type == 'binary' %}
+
+RUN apt-get install -y --no-install-recommends \
+ neutron-metadata-agent \
+ && apt-get clean
+
+ {% endif %}
+{% endif %}
+
+COPY neutron_sudoers /etc/sudoers.d/neutron_sudoers
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start \
+ && chmod 750 /etc/sudoers.d \
+ && chmod 440 /etc/sudoers.d/neutron_sudoers \
+ && usermod -a -G kolla neutron
+
+{{ include_footer }}
+
+USER neutron
diff --git a/docker/neutron/neutron-metadata-agent/extend_start.sh b/docker/neutron/neutron-metadata-agent/extend_start.sh
new file mode 100644
index 000000000..c46f60f55
--- /dev/null
+++ b/docker/neutron/neutron-metadata-agent/extend_start.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# Only update permissions if permissions need to be updated
+if [[ $(stat -c %U:%G /var/lib/neutron/kolla) != "neutron:neutron" ]]; then
+ sudo chown neutron: /var/lib/neutron/kolla
+fi
diff --git a/docker/neutron/neutron-metadata-agent/neutron_sudoers b/docker/neutron/neutron-metadata-agent/neutron_sudoers
new file mode 100644
index 000000000..17b8b3dee
--- /dev/null
+++ b/docker/neutron/neutron-metadata-agent/neutron_sudoers
@@ -0,0 +1 @@
+%kolla ALL=(root) NOPASSWD: /bin/chown neutron\: /var/lib/neutron/kolla, /usr/bin/chown neutron\: /var/lib/neutron/kolla
diff --git a/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2 b/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2
index de075da25..762b1012b 100644
--- a/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2
+++ b/docker/neutron/neutron-openvswitch-agent/Dockerfile.j2
@@ -19,14 +19,6 @@ RUN apt-get install -y --no-install-recommends \
&& apt-get clean
{% endif %}
-{% elif install_type == 'source' %}
- {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-# Install required packages
-RUN yum install -y openvswitch \
- && yum clean all
-
- {% endif %}
{% endif %}
{{ include_footer }}
diff --git a/docker/neutron/neutron-server/Dockerfile.j2 b/docker/neutron/neutron-server/Dockerfile.j2
index 9732e28f1..6540345db 100644
--- a/docker/neutron/neutron-server/Dockerfile.j2
+++ b/docker/neutron/neutron-server/Dockerfile.j2
@@ -9,3 +9,5 @@ RUN chmod 755 /usr/local/bin/kolla_extend_start \
fi
{{ include_footer }}
+
+USER neutron
diff --git a/docker/neutron/neutron-server/extend_start.sh b/docker/neutron/neutron-server/extend_start.sh
index d60829f10..dba1e632f 100644
--- a/docker/neutron/neutron-server/extend_start.sh
+++ b/docker/neutron/neutron-server/extend_start.sh
@@ -3,16 +3,6 @@
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
- sudo -H -u neutron neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
+ neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
exit 0
fi
-
-# Neutron uses rootwrap which requires a tty for sudo.
-# Since the container is running in daemon mode, a tty
-# is not present and requiretty must be commented out.
-if [ ! -f /sudo-modified ]; then
- chmod 0640 /etc/sudoers
- sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers
- chmod 0440 /etc/sudoers
- touch /sudo-modified
-fi
diff --git a/docker/nova/nova-api/extend_start.sh b/docker/nova/nova-api/extend_start.sh
index 93b63d53f..c7bc9c862 100644
--- a/docker/nova/nova-api/extend_start.sh
+++ b/docker/nova/nova-api/extend_start.sh
@@ -4,5 +4,6 @@
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
nova-manage db sync
+ nova-manage api_db sync
exit 0
fi
diff --git a/docker/nova/nova-base/Dockerfile.j2 b/docker/nova/nova-base/Dockerfile.j2
index 0f9aedd94..cb21e1aaf 100644
--- a/docker/nova/nova-base/Dockerfile.j2
+++ b/docker/nova/nova-base/Dockerfile.j2
@@ -4,14 +4,10 @@ MAINTAINER {{ maintainer }}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-# TODO(mandre) remove python-oslo-policy once RDO package is fixed
-# https://github.com/openstack-packages/nova/blob/rpm-master/openstack-nova.spec
-# https://review.gerrithub.io/#/c/255435/
RUN yum -y install \
openstack-nova-common \
python-keystoneclient \
python-cinderclient \
- python-oslo-policy \
bridge-utils \
&& yum clean all
@@ -50,7 +46,8 @@ RUN ln -s nova-base-source/* nova \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /nova \
&& mkdir -p /etc/nova /var/log/nova /home/nova /var/lib/nova \
&& cp -r /nova/etc/nova/* /etc/nova/ \
- && chown -R nova: /etc/nova /var/log/nova /home/nova /var/lib/nova
+ && chown -R nova: /etc/nova /var/log/nova /home/nova /var/lib/nova \
+ && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/nova/rootwrap.conf
COPY nova_sudoers /etc/sudoers.d/nova_sudoers
RUN chmod 750 /etc/sudoers.d \
diff --git a/docker/nova/nova-compute-ironic/Dockerfile.j2 b/docker/nova/nova-compute-ironic/Dockerfile.j2
index 654fdeda6..f8c9c518d 100644
--- a/docker/nova/nova-compute-ironic/Dockerfile.j2
+++ b/docker/nova/nova-compute-ironic/Dockerfile.j2
@@ -14,6 +14,8 @@ RUN apt-get install -y --no-install-recommends \
nova-compute \
&& apt-get clean
+RUN rm /etc/nova/nova-compute.conf
+
{% endif %}
{% endif %}
diff --git a/docker/nova/nova-compute/Dockerfile.j2 b/docker/nova/nova-compute/Dockerfile.j2
index aad9c8ba8..200e2c100 100644
--- a/docker/nova/nova-compute/Dockerfile.j2
+++ b/docker/nova/nova-compute/Dockerfile.j2
@@ -54,7 +54,8 @@ COPY nova_compute_sudoers /etc/sudoers.d/nova_compute_sudoers
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start \
&& chmod 750 /etc/sudoers.d \
- && chmod 440 /etc/sudoers.d/nova_compute_sudoers
+ && chmod 440 /etc/sudoers.d/nova_compute_sudoers \
+ && rm -f /etc/machine-id
{{ include_footer }}
diff --git a/docker/nova/nova-compute/extend_start.sh b/docker/nova/nova-compute/extend_start.sh
index 084e76a19..efe531ff9 100644
--- a/docker/nova/nova-compute/extend_start.sh
+++ b/docker/nova/nova-compute/extend_start.sh
@@ -4,6 +4,10 @@
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
sudo chown nova: /var/lib/nova/
- mkdir /var/lib/nova/instances
+ mkdir -p /var/lib/nova/instances
+ # Only update permissions if permissions need to be updated
+ if [[ $(stat -c %U:%G /var/lib/nova/instances) != "nova:nova" ]]; then
+ sudo chown nova: /var/lib/nova/instances
+ fi
exit 0
fi
diff --git a/docker/openstack-base/Dockerfile.j2 b/docker/openstack-base/Dockerfile.j2
index de111a94a..d1a91d736 100644
--- a/docker/openstack-base/Dockerfile.j2
+++ b/docker/openstack-base/Dockerfile.j2
@@ -13,12 +13,15 @@ RUN yum -y install \
{% if install_type == 'binary' %}
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
+# TODO(Allen) Remove python-dogpile-cache after the requirement of
+# python-ironicclient is fixed.
RUN yum -y install \
python-barbicanclient \
python-ceilometerclient \
python-congressclient \
python-designateclient \
python-heatclient \
+ python-dogpile-cache \
python-ironicclient \
python-magnumclient \
python-manilaclient \
@@ -39,7 +42,6 @@ RUN yum -y install \
# This will prevent questions from being asked during the install
ENV DEBIAN_FRONTEND noninteractive
-COPY oslo-log-bug1499620.patch /var/lib/kolla/oslo-log-bug1499620.patch
# There is no python-tuskarclient in ubuntu 14.04
RUN apt-get install -y --no-install-recommends \
python-barbicanclient \
@@ -65,9 +67,6 @@ RUN apt-get install -y --no-install-recommends \
patch \
&& apt-get clean
-# python-oslo-log patch to bug 1499620 (it fixed in python-oslo-log 1.11.1)
-RUN patch -d /usr/lib/python2.7/site-packages -p1 < /var/lib/kolla/oslo-log-bug1499620.patch
-
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
@@ -105,23 +104,17 @@ RUN apt-get install -y --no-install-recommends \
{% endif %}
ADD openstack-base-archive /openstack-base-source
-# TODO(jeffrey4l): Pin the pip to the 7.1.2. version. latest pip
-# (now 8.0) can not install the package when conflict with the
-# system. The best solution should use the virtualenv for
-# isolation or following bug is fixed:
-# https://github.com/pypa/pip/pull/3389
RUN ln -s openstack-base-source/* /requirements \
- && mkdir /var/lib/kolla \
+ && mkdir -p /var/lib/kolla \
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py \
&& rm get-pip.py \
- && pip install pip==7.1.2 \
&& pip --no-cache-dir install -U virtualenv \
&& virtualenv --system-site-packages /var/lib/kolla/venv \
- && /var/lib/kolla/venv/bin/pip --no-cache-dir install pip==7.1.2 \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt \
jinja2 \
kazoo \
+ keystonemiddleware \
python-barbicanclient \
python-ceilometerclient \
python-congressclient \
diff --git a/docker/openstack-base/oslo-log-bug1499620.patch b/docker/openstack-base/oslo-log-bug1499620.patch
deleted file mode 100644
index 7a6867dfb..000000000
--- a/docker/openstack-base/oslo-log-bug1499620.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/oslo_log/log.py b/oslo_log/log.py
-index 8d8c240..1b19072 100644
---- a/oslo_log/log.py
-+++ b/oslo_log/log.py
-@@ -285,10 +285,10 @@ def _setup_logging_from_conf(conf, project, version):
- facility = _find_facility(conf.syslog_log_facility)
- # TODO(bogdando) use the format provided by RFCSysLogHandler after
- # existing syslog format deprecation in J
-- syslog = handlers.OSSysLogHandler(
-+ syslog_handler = handlers.OSSysLogHandler(
- facility=facility,
- use_syslog_rfc_format=conf.use_syslog_rfc_format)
-- log_root.addHandler(syslog)
-+ log_root.addHandler(syslog_handler)
-
- datefmt = conf.log_date_format
- for handler in log_root.handlers:
-
diff --git a/docker/swift/swift-account-reaper/Dockerfile.j2 b/docker/swift/swift-account-reaper/Dockerfile.j2
deleted file mode 100644
index 4ab70ac6f..000000000
--- a/docker/swift/swift-account-reaper/Dockerfile.j2
+++ /dev/null
@@ -1,13 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{% if install_type == 'binary' %}
- {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-RUN yum -y install openstack-swift-account \
- && yum clean all
-
- {% endif %}
-{% endif %}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-account-replicator/Dockerfile.j2 b/docker/swift/swift-account-replicator/Dockerfile.j2
deleted file mode 100644
index 4ab70ac6f..000000000
--- a/docker/swift/swift-account-replicator/Dockerfile.j2
+++ /dev/null
@@ -1,13 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{% if install_type == 'binary' %}
- {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-RUN yum -y install openstack-swift-account \
- && yum clean all
-
- {% endif %}
-{% endif %}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-account-server/Dockerfile.j2 b/docker/swift/swift-account-server/Dockerfile.j2
deleted file mode 100644
index 4ab70ac6f..000000000
--- a/docker/swift/swift-account-server/Dockerfile.j2
+++ /dev/null
@@ -1,13 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{% if install_type == 'binary' %}
- {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-RUN yum -y install openstack-swift-account \
- && yum clean all
-
- {% endif %}
-{% endif %}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-account-auditor/Dockerfile.j2 b/docker/swift/swift-account/Dockerfile.j2
index 4ab70ac6f..4ab70ac6f 100644
--- a/docker/swift/swift-account-auditor/Dockerfile.j2
+++ b/docker/swift/swift-account/Dockerfile.j2
diff --git a/docker/swift/swift-base/Dockerfile.j2 b/docker/swift/swift-base/Dockerfile.j2
index 786e71535..4bcf51014 100644
--- a/docker/swift/swift-base/Dockerfile.j2
+++ b/docker/swift/swift-base/Dockerfile.j2
@@ -9,6 +9,19 @@ RUN yum -y install openstack-swift \
{% endif %}
{% elif install_type == 'source' %}
+ {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
+
+RUN yum -y install \
+ liberasurecode-devel \
+ && yum clean all
+
+ {% elif base_distro in ['ubuntu'] %}
+
+RUN apt-get install -y --no-install-recommends \
+ liberasurecode-dev \
+ && apt-get clean
+
+ {% endif %}
ADD swift-base-archive /swift-base-source
RUN ln -s swift-base-source/* swift \
@@ -20,6 +33,5 @@ RUN ln -s swift-base-source/* swift \
{% endif %}
-COPY config-swift.sh /usr/local/bin/kolla_config_swift
COPY build-swift-ring.py /usr/local/bin/kolla_build_swift_ring
-RUN mkdir /opt/swift
+RUN mkdir -p /opt/swift
diff --git a/docker/swift/swift-base/build-swift-ring.py b/docker/swift/swift-base/build-swift-ring.py
index af20af7e6..7889ad475 100644
--- a/docker/swift/swift-base/build-swift-ring.py
+++ b/docker/swift/swift-base/build-swift-ring.py
@@ -74,7 +74,7 @@ def run(args):
args.num_replicas,
args.min_part_hours])
- for i in xrange(len(hosts)):
+ for i in range(len(hosts)):
run_cmd(['swift-ring-builder',
args.ring_file,
'add',
diff --git a/docker/swift/swift-container-replicator/Dockerfile.j2 b/docker/swift/swift-container-replicator/Dockerfile.j2
deleted file mode 100644
index ce7e10f73..000000000
--- a/docker/swift/swift-container-replicator/Dockerfile.j2
+++ /dev/null
@@ -1,13 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{% if install_type == 'binary' %}
- {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-RUN yum -y install openstack-swift-container \
- && yum clean all
-
- {% endif %}
-{% endif %}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-container-server/Dockerfile.j2 b/docker/swift/swift-container-server/Dockerfile.j2
deleted file mode 100644
index ce7e10f73..000000000
--- a/docker/swift/swift-container-server/Dockerfile.j2
+++ /dev/null
@@ -1,13 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{% if install_type == 'binary' %}
- {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-RUN yum -y install openstack-swift-container \
- && yum clean all
-
- {% endif %}
-{% endif %}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-container-updater/Dockerfile.j2 b/docker/swift/swift-container-updater/Dockerfile.j2
deleted file mode 100644
index ce7e10f73..000000000
--- a/docker/swift/swift-container-updater/Dockerfile.j2
+++ /dev/null
@@ -1,13 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{% if install_type == 'binary' %}
- {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-RUN yum -y install openstack-swift-container \
- && yum clean all
-
- {% endif %}
-{% endif %}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-container-auditor/Dockerfile.j2 b/docker/swift/swift-container/Dockerfile.j2
index ce7e10f73..ce7e10f73 100644
--- a/docker/swift/swift-container-auditor/Dockerfile.j2
+++ b/docker/swift/swift-container/Dockerfile.j2
diff --git a/docker/swift/swift-object-auditor/Dockerfile.j2 b/docker/swift/swift-object-auditor/Dockerfile.j2
deleted file mode 100644
index a9d2c2438..000000000
--- a/docker/swift/swift-object-auditor/Dockerfile.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-object-expirer/Dockerfile.j2 b/docker/swift/swift-object-expirer/Dockerfile.j2
deleted file mode 100644
index e44767b34..000000000
--- a/docker/swift/swift-object-expirer/Dockerfile.j2
+++ /dev/null
@@ -1,15 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{% if install_type == 'binary' %}
- {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
-
-RUN yum -y install \
- openstack-swift-proxy \
- openstack-swift-container \
- && yum clean all
-
- {% endif %}
-{% endif %}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-object-replicator/Dockerfile.j2 b/docker/swift/swift-object-replicator/Dockerfile.j2
deleted file mode 100644
index a9d2c2438..000000000
--- a/docker/swift/swift-object-replicator/Dockerfile.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-object-server/Dockerfile.j2 b/docker/swift/swift-object-server/Dockerfile.j2
deleted file mode 100644
index a9d2c2438..000000000
--- a/docker/swift/swift-object-server/Dockerfile.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-object-updater/Dockerfile.j2 b/docker/swift/swift-object-updater/Dockerfile.j2
deleted file mode 100644
index a9d2c2438..000000000
--- a/docker/swift/swift-object-updater/Dockerfile.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-FROM {{ namespace }}/{{ image_prefix }}swift-object-base:{{ tag }}
-MAINTAINER {{ maintainer }}
-
-{{ include_footer }}
diff --git a/docker/swift/swift-object-base/Dockerfile.j2 b/docker/swift/swift-object/Dockerfile.j2
index 977274dd7..5dc27404f 100644
--- a/docker/swift/swift-object-base/Dockerfile.j2
+++ b/docker/swift/swift-object/Dockerfile.j2
@@ -9,3 +9,5 @@ RUN yum -y install openstack-swift-object \
{% endif %}
{% endif %}
+
+{{ include_footer }}
diff --git a/docker/swift/swift-proxy-server/Dockerfile.j2 b/docker/swift/swift-proxy-server/Dockerfile.j2
index 898103d5e..8d8f73977 100644
--- a/docker/swift/swift-proxy-server/Dockerfile.j2
+++ b/docker/swift/swift-proxy-server/Dockerfile.j2
@@ -10,7 +10,4 @@ RUN yum -y install openstack-swift-proxy \
{% endif %}
{% endif %}
-COPY extend_start.sh /usr/local/bin/kolla_extend_start
-RUN chmod 755 /usr/local/bin/kolla_extend_start
-
{{ include_footer }}
diff --git a/docker/swift/swift-proxy-server/extend_start.sh b/docker/swift/swift-proxy-server/extend_start.sh
deleted file mode 100644
index 8fce9c154..000000000
--- a/docker/swift/swift-proxy-server/extend_start.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source /usr/local/bin/kolla_config_swift
diff --git a/docker/swift/swift-rsyncd/Dockerfile.j2 b/docker/swift/swift-rsyncd/Dockerfile.j2
index 5cb6734fc..7afd4f8c2 100644
--- a/docker/swift/swift-rsyncd/Dockerfile.j2
+++ b/docker/swift/swift-rsyncd/Dockerfile.j2
@@ -13,4 +13,7 @@ RUN apt-get install -y --no-install-recommends rsync \
{% endif %}
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
+
{{ include_footer }}
diff --git a/docker/swift/swift-base/config-swift.sh b/docker/swift/swift-rsyncd/extend_start.sh
index b101b4e69..b101b4e69 100644
--- a/docker/swift/swift-base/config-swift.sh
+++ b/docker/swift/swift-rsyncd/extend_start.sh
diff --git a/docker/zookeeper/extend_start.sh b/docker/zookeeper/extend_start.sh
index 4ea18ccbb..5bca443b1 100644
--- a/docker/zookeeper/extend_start.sh
+++ b/docker/zookeeper/extend_start.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+# Only update permissions if permissions need to be updated
+if [[ $(stat -c %U:%G /var/lib/zookeeper) != "zookeeper:zookeeper" ]]; then
sudo chown zookeeper: /var/lib/zookeeper
- exit 0
fi
diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml
index a1548eaa0..3de40c4e8 100644
--- a/etc/kolla/globals.yml
+++ b/etc/kolla/globals.yml
@@ -20,7 +20,7 @@
# 'network_interface' as set in the Networking section below.
kolla_internal_address: "10.10.10.254"
-# The Public address used to communicate with Openstack as set in the public_url
+# The Public address used to communicate with OpenStack as set in the public_url
# for the endpoints that will be created. It defaults to kolla_internal_address
# but can be overridden in your globals.yml to a public address. It is up to the
# deployer to ensure that that public address maps to the environment correctly.
@@ -66,11 +66,7 @@ neutron_external_interface: "eth1"
####################
# OpenStack options
####################
-# This option is used to specify the tag to use when pulling the Docker images
-#openstack_release: "1.0.0"
-
# Use these options to set the various log levels across all OpenStack projects
-#openstack_logging_verbose: "True"
#openstack_logging_debug: "False"
# Valid options are [ novnc, spice ]
@@ -89,7 +85,7 @@ neutron_external_interface: "eth1"
# must provide separate disks than those for the OSDs
# ceph_use_cache: "no"
# Valid options are [ forward, none, writeback ]
-# ceph_cache_mode: writeback
+# ceph_cache_mode: "writeback"
# A requirement for using the erasure-coded pools is you must setup a cache tier
# Valid options are [ erasure, replicated ]
diff --git a/etc/kolla/passwords.yml b/etc/kolla/passwords.yml
index 369053b0b..c92a3e58c 100644
--- a/etc/kolla/passwords.yml
+++ b/etc/kolla/passwords.yml
@@ -23,7 +23,7 @@ docker_registry_password:
####################
-# Openstack options
+# OpenStack options
####################
keystone_admin_token: "password"
keystone_admin_password: "password"
@@ -33,6 +33,7 @@ glance_database_password: "password"
glance_keystone_password: "password"
nova_database_password: "password"
+nova_api_database_password: "password"
nova_keystone_password: "password"
neutron_database_password: "password"
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index 5a7913534..a127f02c8 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -64,6 +64,10 @@ class KollaUnknownBuildTypeException(Exception):
pass
+class KollaMismatchBaseTypeException(Exception):
+ pass
+
+
class KollaRpmSetupUnknownConfig(Exception):
pass
@@ -203,6 +207,23 @@ class WorkerThread(threading.Thread):
return dest_archive
+ def update_buildargs(self):
+ buildargs = dict()
+ if self.conf.build_args:
+ buildargs = dict(self.conf.build_args)
+
+ proxy_vars = ('HTTP_PROXY', 'http_proxy', 'HTTPS_PROXY',
+ 'https_proxy', 'FTP_PROXY', 'ftp_proxy',
+ 'NO_PROXY', 'no_proxy')
+
+ for proxy_var in proxy_vars:
+ if proxy_var in os.environ and proxy_var not in buildargs:
+ buildargs[proxy_var] = os.environ.get(proxy_var)
+
+ if not buildargs:
+ return None
+ return buildargs
+
def builder(self, image):
LOG.debug('%s:Processing', image['name'])
if image['status'] == 'unmatched':
@@ -255,13 +276,14 @@ class WorkerThread(threading.Thread):
pull = True if image['parent'] is None else False
image['logs'] = str()
+ buildargs = self.update_buildargs()
for response in self.dc.build(path=image['path'],
tag=image['fullname'],
nocache=self.nocache,
rm=True,
pull=pull,
forcerm=self.forcerm,
- buildargs=self.conf.build_args):
+ buildargs=buildargs):
stream = json.loads(response.decode('utf-8'))
if 'stream' in stream:
@@ -304,6 +326,17 @@ class KollaWorker(object):
rpm_setup_config = filter(None, conf.rpm_setup_config)
self.rpm_setup = self.build_rpm_setup(rpm_setup_config)
+ rh_base = ['fedora', 'centos', 'oraclelinux', 'rhel']
+ rh_type = ['source', 'binary', 'rdo', 'rhos']
+ deb_base = ['ubuntu', 'debian']
+ deb_type = ['source', 'binary']
+
+ if not ((self.base in rh_base and self.install_type in rh_type) or
+ (self.base in deb_base and self.install_type in deb_type)):
+ raise KollaMismatchBaseTypeException(
+ '{} is unavailable for {}'.format(self.install_type, self.base)
+ )
+
if self.install_type == 'binary':
self.install_metatype = 'rdo'
elif self.install_type == 'source':
@@ -377,6 +410,19 @@ class KollaWorker(object):
return rpm_setup
+ def copy_apt_files(self):
+ if self.conf.apt_sources_list:
+ shutil.copyfile(
+ self.conf.apt_sources_list,
+ os.path.join(self.working_dir, "base", "sources.list")
+ )
+
+ if self.conf.apt_preferences:
+ shutil.copyfile(
+ self.conf.apt_preferences,
+ os.path.join(self.working_dir, "base", "apt_preferences")
+ )
+
def setup_working_dir(self):
"""Creates a working directory for use while building"""
ts = time.time()
@@ -384,6 +430,7 @@ class KollaWorker(object):
self.temp_dir = tempfile.mkdtemp(prefix='kolla-' + ts)
self.working_dir = os.path.join(self.temp_dir, 'docker')
shutil.copytree(self.images_dir, self.working_dir)
+ self.copy_apt_files()
LOG.debug('Created working dir: %s', self.working_dir)
def set_time(self):
diff --git a/kolla/common/config.py b/kolla/common/config.py
index 9e9e2332b..b43163ccd 100644
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -19,14 +19,14 @@ from kolla import version
RDO_MIRROR = "http://trunk.rdoproject.org/centos7"
-DELOREAN = "{}/current/delorean.repo".format(RDO_MIRROR)
+DELOREAN = "{}/current-passed-ci/delorean.repo".format(RDO_MIRROR)
DELOREAN_DEPS = "{}/delorean-deps.repo".format(RDO_MIRROR)
INSTALL_TYPE_CHOICES = ['binary', 'source', 'rdo', 'rhos']
_PROFILE_OPTS = [
cfg.ListOpt('infra',
- default=['ceph', 'data', 'mariadb', 'haproxy',
- 'keepalived', 'kolla-ansible', 'memcached',
+ default=['ceph', 'mariadb', 'haproxy',
+ 'keepalived', 'kolla-toolbox', 'memcached',
'mongodb', 'openvswitch', 'rabbitmq', 'rsyslog'],
help='Infra images'),
cfg.ListOpt('main',
@@ -39,17 +39,15 @@ _PROFILE_OPTS = [
'magnum', 'mistral', 'trove,' 'zaqar', 'zookeeper'],
help='Aux Images'),
cfg.ListOpt('default',
- default=['data', 'kolla-ansible', 'glance', 'haproxy',
+ default=['kolla-toolbox', 'glance', 'haproxy',
'heat', 'horizon', 'keepalived', 'keystone',
'memcached', 'mariadb', 'neutron', 'nova',
'openvswitch', 'rabbitmq', 'rsyslog'],
help='Default images'),
cfg.ListOpt('gate',
- default=['ceph', 'cinder', 'data', 'dind', 'glance',
- 'haproxy', 'heat', 'horizon', 'keepalived',
- 'keystone', 'kolla-ansible', 'mariadb',
- 'memcached', 'neutron', 'nova', 'openvswitch',
- 'rabbitmq', 'rsyslog'],
+ default=['glance', 'haproxy', 'keepalived', 'keystone',
+ 'kolla-toolbox', 'mariadb', 'memcached', 'neutron',
+ 'nova', 'openvswitch', 'rabbitmq', 'rsyslog'],
help='Gate images'),
cfg.ListOpt('mesos',
default=['chronos', 'marathon', 'mesos-master', 'mesos-slave',
@@ -119,7 +117,7 @@ _CLI_OPTS = [
cfg.StrOpt('type', short='t', default='binary',
choices=INSTALL_TYPE_CHOICES,
dest='install_type', deprecated_group='kolla-build',
- help=('The method of the Openstack install. The valid'
+ help=('The method of the OpenStack install. The valid'
' types are: {}'.format(
', '.join(INSTALL_TYPE_CHOICES)))),
cfg.IntOpt('threads', short='T', default=8, min=1,
@@ -141,8 +139,10 @@ _BASE_OPTS = [
help='The MAINTAINER field'),
cfg.ListOpt('rpm_setup_config', default=[DELOREAN, DELOREAN_DEPS],
deprecated_group='kolla-build',
- help=('Comma separated list of .rpm or .repo file(s)'
- 'or URL(s) to install before building containers'))
+ help=('Comma separated list of .rpm or .repo file(s) '
+ 'or URL(s) to install before building containers')),
+ cfg.StrOpt('apt_sources_list', help=('Path to custom sources.list')),
+ cfg.StrOpt('apt_preferences', help=('Path to custom apt/preferences'))
]
@@ -245,7 +245,7 @@ def get_source_opts(type_=None, location=None, reference=None):
cfg.StrOpt('location', default=location,
help='The location for source install'),
cfg.StrOpt('reference', default=reference,
- help=('Git reference to pull, commit sha, tag'
+ help=('Git reference to pull, commit sha, tag '
'or branch name'))]
diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py
index afc2e7546..634fa3abb 100644
--- a/kolla/tests/test_build.py
+++ b/kolla/tests/test_build.py
@@ -11,7 +11,9 @@
# limitations under the License.
import fixtures
+import itertools
import mock
+import os
from kolla.cmd import build
from kolla.tests import base
@@ -34,6 +36,7 @@ class WorkerThreadTest(base.TestCase):
# NOTE(jeffrey4l): use a real, temporary dir
FAKE_IMAGE['path'] = self.useFixture(fixtures.TempDir()).path
+ @mock.patch.dict(os.environ, clear=True)
@mock.patch('docker.Client')
def test_build_image(self, mock_client):
queue = mock.Mock()
@@ -48,6 +51,7 @@ class WorkerThreadTest(base.TestCase):
nocache=False, rm=True, pull=True, forcerm=True,
buildargs=None)
+ @mock.patch.dict(os.environ, clear=True)
@mock.patch('docker.Client')
def test_build_image_with_build_arg(self, mock_client):
build_args = {
@@ -64,3 +68,63 @@ class WorkerThreadTest(base.TestCase):
path=FAKE_IMAGE['path'], tag=FAKE_IMAGE['fullname'],
nocache=False, rm=True, pull=True, forcerm=True,
buildargs=build_args)
+
+ @mock.patch.dict(os.environ, {'http_proxy': 'http://FROM_ENV:8080'},
+ clear=True)
+ @mock.patch('docker.Client')
+ def test_build_arg_from_env(self, mock_client):
+ build_args = {
+ 'http_proxy': 'http://FROM_ENV:8080',
+ }
+ worker = build.WorkerThread(mock.Mock(),
+ mock.Mock(),
+ self.conf)
+ worker.builder(FAKE_IMAGE)
+
+ mock_client().build.assert_called_once_with(
+ path=FAKE_IMAGE['path'], tag=FAKE_IMAGE['fullname'],
+ nocache=False, rm=True, pull=True, forcerm=True,
+ buildargs=build_args)
+
+ @mock.patch.dict(os.environ, {'http_proxy': 'http://FROM_ENV:8080'},
+ clear=True)
+ @mock.patch('docker.Client')
+ def test_build_arg_precedence(self, mock_client):
+ build_args = {
+ 'http_proxy': 'http://localhost:8080',
+ }
+ self.conf.set_override('build_args', build_args)
+ worker = build.WorkerThread(mock.Mock(),
+ mock.Mock(),
+ self.conf)
+ worker.builder(FAKE_IMAGE)
+
+ mock_client().build.assert_called_once_with(
+ path=FAKE_IMAGE['path'], tag=FAKE_IMAGE['fullname'],
+ nocache=False, rm=True, pull=True, forcerm=True,
+ buildargs=build_args)
+
+
+class KollaWorkerTest(base.TestCase):
+
+ def test_supported_base_type(self):
+ rh_base = ['fedora', 'centos', 'oraclelinux', 'rhel']
+ rh_type = ['source', 'binary', 'rdo', 'rhos']
+ deb_base = ['ubuntu', 'debian']
+ deb_type = ['source', 'binary']
+
+ for base_distro, install_type in itertools.chain(
+ itertools.product(rh_base, rh_type),
+ itertools.product(deb_base, deb_type)):
+ self.conf.set_override('base', base_distro)
+ self.conf.set_override('install_type', install_type)
+ # should no exception raised
+ build.KollaWorker(self.conf)
+
+ def test_unsupported_base_type(self):
+ for base_distro, install_type in itertools.product(
+ ['ubuntu', 'debian'], ['rdo', 'rhos']):
+ self.conf.set_override('base', base_distro)
+ self.conf.set_override('install_type', install_type)
+ self.assertRaises(build.KollaMismatchBaseTypeException,
+ build.KollaWorker, self.conf)
diff --git a/requirements.txt b/requirements.txt
index 815958239..80c81f517 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,5 +7,5 @@ Jinja2>=2.8 # BSD License (3 clause)
gitdb>=0.6.4 # BSD License (3 clause)
GitPython>=1.0.1 # BSD License (3 clause)
six>=1.9.0 # MIT
-oslo.config>=3.2.0 # Apache-2.0
+oslo.config>=3.4.0 # Apache-2.0
graphviz>=0.4.0 # MIT License
diff --git a/setup.cfg b/setup.cfg
index 74bb08c16..cf11709c0 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -22,11 +22,9 @@ packages =
kolla
data_files =
share/kolla/ansible = ansible/*
- share/kolla/devenv = devenv/*
share/kolla/docker = docker/*
share/kolla/doc = doc/*
share/kolla/etc_examples = etc/*
- share/kolla/vagrant = vagrant/*
share/kolla = tools/init-runonce
share/kolla = tools/openrc-example
share/kolla = setup.cfg
diff --git a/specs/ansible-multi.rst b/specs/ansible-multi.rst
index cacd44c3b..1aaf983d3 100644
--- a/specs/ansible-multi.rst
+++ b/specs/ansible-multi.rst
@@ -23,7 +23,7 @@ To implement HA in our containers, we need multi-node deployment operational
so we can validate the high availability implementation.
To meet our community approved mission, we must implement a deployment tool
-and Ansible provides the most effecient development path while ensuring ease
+and Ansible provides the most efficient development path while ensuring ease
of use.
Use cases
@@ -228,7 +228,7 @@ Further the [ipman] section will be added to the file placed by Ansible in
the target host's configuration directory.
The end result of the merge will be a single file on the host that is in the
-appropriate format for the Openstack service to consume containing the content
+appropriate format for the OpenStack service to consume containing the content
of both the Ansible default file and the augmentation file.
The final implication of these Ansible best practices is that an Operator can
diff --git a/specs/containerize-openstack.rst b/specs/containerize-openstack.rst
index f035ec2e0..11d775d46 100644
--- a/specs/containerize-openstack.rst
+++ b/specs/containerize-openstack.rst
@@ -189,7 +189,7 @@ with the --privileged=true flag to docker that:
* shares any namespace with the --ipc=host, --pid=host, or --net=host flags
We will not use the Docker EXPOSE operation since all containers will use
---net=host. One motive for using --net=host is it is inherently simplier.
+--net=host. One motive for using --net=host is it is inherently simpler.
A different motive for not using EXPOSE is the 20 microsecond penalty
applied to every packet forwarded and returned by docker-proxy.
If EXPOSE functionality is desired, it can be added back by
diff --git a/specs/template.rst b/specs/template.rst
index 8258ed16c..27b93152f 100644
--- a/specs/template.rst
+++ b/specs/template.rst
@@ -95,7 +95,7 @@ How are you proposing to test this feature.
Documentation Impact
====================
-What documentation will be done to discribe this feature to developers
+What documentation will be done to describe this feature to developers
and operators.
References
diff --git a/tests/deploy_aio.sh b/tests/deploy_aio.sh
deleted file mode 100755
index 9ca10164b..000000000
--- a/tests/deploy_aio.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-set -o xtrace
-set -o errexit
-
-export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-
-function print_failure {
- docker ps -a
- for failed in $(docker ps -a --format "{{.Names}}" --filter status=exited); do
- docker logs --tail=all $failed
- done
- echo "FAILED"
- exit 1
-}
-
-# Populate globals.yml
-cat << EOF > /etc/kolla/globals.yml
----
-kolla_base_distro: "$1"
-kolla_install_type: "$2"
-kolla_internal_address: "169.254.169.10"
-docker_restart_policy: "never"
-network_interface: "eth0"
-neutron_external_interface: "fake_interface"
-EOF
-
-# Create dummy interface for neutron
-ip l a fake_interface type dummy
-
-# Actually do the deployment
-tools/kolla-ansible deploy || print_failure
-
-# TODO(SamYaple): Actually validate that all containers are started
-docker ps -a
-
-# TODO(SamYaple): Actually do functional testing of OpenStack
diff --git a/tests/setup_Debian.sh b/tests/setup_Debian.sh
deleted file mode 100755
index 10ed32875..000000000
--- a/tests/setup_Debian.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-set -o xtrace
-set -o errexit
-
-DEV=$1
-
-# (SamYaple)TODO: Remove the path overriding
-export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-
-# Setup Docker repo and add signing key
-echo 'deb http://apt.dockerproject.org/repo ubuntu-trusty main' | sudo tee /etc/apt/sources.list.d/docker.list
-sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
-sudo apt-get update
-sudo apt-get install -y --no-install-recommends docker-engine btrfs-tools
-
-# Only do FS optimization if we have a secondary disk
-if [[ -b /dev/${DEV} ]]; then
- # The reason for using BTRFS is stability. There are numerous issues with the
- # devicemapper backed on Ubuntu and AUFS is slow. BTRFS is very solid as a
- # backend in my experince. I use ie almost exclusively.
- # Format Disks and setup Docker to use BTRFS
- sudo umount /dev/${DEV} || true
- sudo parted /dev/${DEV} -s -- mklabel msdos
- sudo service docker stop
- echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker
- sudo rm -rf /var/lib/docker/*
-
- # We want to snapshot the entire docker directory so we have to first create a
- # subvolume and use that as the root for the docker directory.
- sudo mkfs.btrfs -f /dev/${DEV}
- sudo mount /dev/${DEV} /var/lib/docker
- sudo btrfs subvolume create /var/lib/docker/docker
- sudo umount /var/lib/docker
- sudo mount -o noatime,compress=lzo,space_cache,subvol=docker /dev/${DEV} /var/lib/docker
-
- sudo service docker start
-fi
-
-sudo docker info
-
-echo "Completed $0."
diff --git a/tests/setup_RedHat.sh b/tests/setup_RedHat.sh
deleted file mode 100755
index 4eba9504a..000000000
--- a/tests/setup_RedHat.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-set -o xtrace
-set -o errexit
-
-DEV=$1
-
-# (SamYaple)TODO: Remove the path overriding
-export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
-
-cat | sudo tee /etc/yum.repos.d/docker.repo << EOF
-[docker]
-name=Docker Main Repository
-baseurl=https://yum.dockerproject.org/repo/main/centos/7
-enabled=1
-gpgcheck=1
-gpgkey=https://yum.dockerproject.org/gpg
-EOF
-
-sudo yum install -y libffi-devel openssl-devel docker-engine xfsprogs
-
-# Only do FS optimization if we have a secondary disk
-if [[ -b /dev/${DEV} ]]; then
- # Setup backing disk for use with Docker. This is to ensure we use the ephemeral
- # disk provided to the build instance. It ensures the correct disk and storage
- # driver are used for Docker. It is recommend to use the thin provisioning
- # driver. https://github.com/docker/docker/blob/master/man/docker.1.md
- sudo parted /dev/${DEV} -s -- mklabel msdos mkpart pri 1 -1
- # Figure out the path to the partitioned device
- PARTDEV=$(ls "/dev/${DEV}"* | egrep "/dev/${DEV}p?1")
- sudo pvcreate ${PARTDEV}
- sudo vgcreate kolla01 ${PARTDEV}
- sudo lvcreate -n thin01 -L 60G kolla01
- sudo lvcreate -n thin01meta -L 2G kolla01
- yes | sudo lvconvert --type thin-pool --poolmetadata kolla01/thin01meta kolla01/thin01
-
- # Setup Docker
- sudo sed -i -r 's,(ExecStart)=(.+),\1=/usr/bin/docker daemon --storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=kolla01-thin01 --storage-opt dm.use_deferred_removal=true,' /usr/lib/systemd/system/docker.service
- sudo systemctl daemon-reload
-fi
-
-sudo systemctl start docker
-sudo docker info
-
-# disable ipv6 until we're sure routes to fedora mirrors work properly
-sudo sh -c 'echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf'
-sudo /usr/sbin/sysctl -p
-
-echo "Completed $0."
diff --git a/tests/setup_gate.sh b/tests/setup_gate.sh
index d94377aff..fbacb3f92 100755..120000
--- a/tests/setup_gate.sh
+++ b/tests/setup_gate.sh
@@ -1,123 +1 @@
-#!/bin/bash
-
-set -o xtrace
-set -o errexit
-
-# Just for mandre :)
-if [[ ! -f /etc/sudoers.d/jenkins ]]; then
- echo "jenkins ALL=(:docker) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/jenkins
-fi
-
-function dump_node_info {
- # NOTE(SamYaple): function for debugging gate
- set +o errexit
- local OLD_PATH="${PATH}"
- PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- sudo parted -l
-
- sudo mount
-
- df -h
-
- uname -a
-
- cat /etc/*release*
-
- PATH="${OLD_PATH}"
- set -o errexit
-}
-
-function detect_disk {
- # TODO(SamYaple): This check could be much better, but should work for now
- if [[ $(hostname | grep rax) ]]; then
- export DEV="xvde"
- else
- echo "Assuming this is a hpcloud box"
- export DEV="vdb"
- fi
-}
-
-function setup_config {
- # generate the config
- tox -e genconfig
- # Copy configs
- sudo cp -a etc/kolla /etc/
-}
-
-function detect_distro {
- DISTRO=$(ansible all -i "localhost," -msetup -clocal | awk -F\" '/ansible_os_family/ {print $4}')
-}
-
-function setup_ssh {
- # Generate a new keypair that Ansible will use
- ssh-keygen -f /home/jenkins/.ssh/kolla -N ''
- cat /home/jenkins/.ssh/kolla.pub >> /home/jenkins/.ssh/authorized_keys
-
- # Push the the public key around to all of the nodes
- for ip in $(cat /etc/nodepool/sub_nodes_private); do
- scp /home/jenkins/.ssh/kolla.pub ${ip}:/home/jenkins/.ssh/authorized_keys
- # TODO(SamYaple): Remove this root key pushing once Kolla doesn't
- # require root anymore.
- ssh ${ip} -i /home/jenkins/.ssh/kolla 'sudo mkdir -p /root/.ssh; sudo cp /home/jenkins/.ssh/* /root/.ssh/'
- done
-
- # From now on use the new IdentityFile for connecting to other hosts
- echo "IdentityFile /home/jenkins/.ssh/kolla" >> /home/jenkins/.ssh/config
-}
-
-function setup_inventory {
- local counter=0
-
- detect_distro
- if [[ "${DISTRO}" == "Debian" ]]; then
- ANSIBLE_CONNECTION_TYPE=ssh
- else
- ANSIBLE_CONNECTION_TYPE=local
- fi
-
- echo -e "127.0.0.1\tlocalhost" > /tmp/hosts
- for ip in $(cat /etc/nodepool/{node_private,sub_nodes_private}); do
- : $((counter++))
- echo -e "${ip}\tnode${counter} $(ssh ${ip} hostname)" >> /tmp/hosts
- echo "node${counter} ansible_connection=${ANSIBLE_CONNECTION_TYPE}" >> ${RAW_INVENTORY}
- done
-
- sudo chown root: /tmp/hosts
- sudo chmod 644 /tmp/hosts
- sudo mv /tmp/hosts /etc/hosts
-}
-
-function setup_ansible {
- RAW_INVENTORY=/tmp/kolla/raw_inventory
- mkdir /tmp/kolla
-
- sudo -H pip install "ansible<2" "docker-py>=1.4.0"
-
- setup_inventory
-
- # Record the running state of the environment as seen by the setup module
- ansible all -i ${RAW_INVENTORY} -m setup > /tmp/logs/ansible/initial-setup
-}
-
-function setup_node {
- detect_disk
- ansible-playbook -i ${RAW_INVENTORY} -edocker_dev=${DEV} tests/setup_nodes.yml
-}
-
-function setup_logging {
- # This directory is the directory that is copied with the devstack-logs
- # publisher. It must exist at /home/jenkins/workspace/<job-name>/logs
- mkdir logs
-
- # For ease of access we symlink that logs directory to a known path
- ln -s $(pwd)/logs /tmp/logs
- mkdir -p /tmp/logs/{ansible,build}
-}
-
-setup_logging
-(dump_node_info 2>&1) > /tmp/logs/node_info_first
-setup_ssh
-setup_ansible
-setup_node
-setup_config
-(dump_node_info 2>&1) > /tmp/logs/node_info_last
+../tools/setup_gate.sh \ No newline at end of file
diff --git a/tests/test_build.py b/tests/test_build.py
index 8fec97ebb..eda87a4e7 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -10,30 +10,33 @@
# License for the specific language governing permissions and limitations
# under the License.
+import abc
import os
+import sys
from mock import patch
-from os import path
from oslo_log import fixture as log_fixture
from oslo_log import log as logging
from oslotest import base
import six
import testtools
-import sys
-sys.path.append(path.abspath(path.join(path.dirname(__file__), '../tools')))
+sys.path.append(
+ os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')))
from kolla.cmd import build
LOG = logging.getLogger(__name__)
-class BuildTest(base.BaseTestCase):
+@six.add_metaclass(abc.ABCMeta)
+class BuildTest(object):
+ excluded_images = abc.abstractproperty()
def setUp(self):
super(BuildTest, self).setUp()
self.useFixture(log_fixture.SetLogLevel([__name__],
logging.logging.INFO))
- self.build_args = [__name__, "--debug"]
+ self.build_args = [__name__, "--debug", '--threads', '4']
@testtools.skipUnless(os.environ.get('DOCKER_BUILD_TEST'),
'Skip the docker build test')
@@ -42,17 +45,9 @@ class BuildTest(base.BaseTestCase):
LOG.info("Running with args %s", self.build_args)
bad_results, good_results, unmatched_results = build.main()
- # these are images that are known to not build properly
- excluded_images = ["gnocchi-base",
- "murano-base",
- "ironic-pxe",
- "ironic-discoverd",
- "mistral-base",
- "manila-base"]
-
failures = 0
for image, result in six.iteritems(bad_results):
- if image in excluded_images:
+ if image in self.excluded_images:
if result is 'error':
continue
failures = failures + 1
@@ -71,46 +66,55 @@ class BuildTest(base.BaseTestCase):
self.assertEqual(failures, 0, "%d failure(s) occurred" % failures)
-class BuildTestCentosBinary(BuildTest):
+class BuildTestCentosBinary(BuildTest, base.BaseTestCase):
+ excluded_images = ["gnocchi-base",
+ "murano-base",
+ "ironic-pxe",
+ "ironic-discoverd",
+ "mistral-base",
+ "murano-base"]
+
def setUp(self):
super(BuildTestCentosBinary, self).setUp()
self.build_args.extend(["--base", "centos",
"--type", "binary"])
-class BuildTestCentosSource(BuildTest):
+class BuildTestCentosSource(BuildTest, base.BaseTestCase):
+ excluded_images = ["gnocchi-base",
+ "murano-base",
+ "ironic-pxe",
+ "ironic-discoverd",
+ "mistral-base"]
+
def setUp(self):
super(BuildTestCentosSource, self).setUp()
self.build_args.extend(["--base", "centos",
"--type", "source"])
-class BuildTestUbuntuSource(BuildTest):
+class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
+ excluded_images = []
+
def setUp(self):
super(BuildTestUbuntuSource, self).setUp()
self.build_args.extend(["--base", "ubuntu",
"--type", "source"])
-class DeployTestCentosBinary(BuildTest):
+class DeployTestCentosBinary(BuildTestCentosBinary):
def setUp(self):
super(DeployTestCentosBinary, self).setUp()
- self.build_args.extend(["--base", "centos",
- "--type", "binary",
- "--profile", "gate"])
+ self.build_args.extend(["--profile", "gate"])
-class DeployTestCentosSource(BuildTest):
+class DeployTestCentosSource(BuildTestCentosSource):
def setUp(self):
super(DeployTestCentosSource, self).setUp()
- self.build_args.extend(["--base", "centos",
- "--type", "source",
- "--profile", "gate"])
+ self.build_args.extend(["--profile", "gate"])
-class DeployTestUbuntuSource(BuildTest):
+class DeployTestUbuntuSource(BuildTestUbuntuSource):
def setUp(self):
super(DeployTestUbuntuSource, self).setUp()
- self.build_args.extend(["--base", "ubuntu",
- "--type", "source",
- "--profile", "gate"])
+ self.build_args.extend(["--profile", "gate"])
diff --git a/tools/__init__.py b/tools/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/tools/__init__.py
+++ /dev/null
diff --git a/tools/cleanup-containers b/tools/cleanup-containers
index 594e3731b..d6ce4a2e1 100755
--- a/tools/cleanup-containers
+++ b/tools/cleanup-containers
@@ -18,16 +18,17 @@ else
ironic-{discoverd,conductor,api,pxe} \
keepalived \
keystone \
- kolla_ansible \
+ kolla_toolbox \
magnum_{api,conductor} \
+ manila_{api,share,scheduler} \
mariadb \
memcached \
mistral{api,engine,executor} \
murano_{api,engine} \
- neutron_{server,agents,linuxbridge_agent,openvswitch_agent} \
+ neutron_{server,dhcp_agent,l3_agent,linuxbridge_agent,metadata_agent,openvswitch_agent} \
nova_{scheduler,novncproxy,consoleauth,conductor,api,compute,libvirt,spicehtml5proxy,compute_ironic} \
openvswitch_{vswitchd,db} \
- rabbitmq{,_data} \
+ rabbitmq \
rsyslog \
swift_{account_{auditor,reaper,replicator,server},container_{auditor,replicator,server,updater},object_{auditor,expirer,replicator,server,updater},proxy_server,rsyncd}
)
diff --git a/tools/deploy_aio.sh b/tools/deploy_aio.sh
new file mode 100755
index 000000000..74d5b617a
--- /dev/null
+++ b/tools/deploy_aio.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+set -o xtrace
+set -o errexit
+
+export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
+export KOLLA_BASE=$1
+export KOLLA_TYPE=$2
+
+function check_failure {
+ docker ps -a
+ failed_containers=$(docker ps -a --format "{{.Names}}" --filter status=exited)
+
+ for failed in ${failed_containers}; do
+ docker logs --tail all ${failed}
+ done
+
+ journalctl --no-pager -u docker.service || :
+ cat /var/log/upstart/docker.log || :
+
+ if [[ -n ${failed_containers} ]]; then
+ echo 'FAILED'
+ exit 1
+ fi
+}
+
+function write_configs {
+ mkdir -p /etc/kolla/config
+
+ cat << EOF > /etc/kolla/globals.yml
+---
+kolla_base_distro: "${KOLLA_BASE}"
+kolla_install_type: "${KOLLA_TYPE}"
+kolla_internal_address: "169.254.169.10"
+docker_restart_policy: "never"
+network_interface: "eth0"
+neutron_external_interface: "fake_interface"
+enable_horizon: "no"
+enable_heat: "no"
+EOF
+
+ cat << EOF > /etc/kolla/config/nova.conf
+[DEFAULT]
+osapi_compute_workers = 1
+
+[conductor]
+workers = 1
+EOF
+
+ cat << EOF > /etc/kolla/config/glance.conf
+[DEFAULT]
+workers = 1
+EOF
+
+ cat << EOF > /etc/kolla/config/neutron.conf
+[DEFAULT]
+api_workers = 1
+metadata_workers = 1
+EOF
+}
+
+trap check_failure EXIT
+
+write_configs
+
+# Create dummy interface for neutron
+ip l a fake_interface type dummy
+
+# Actually do the deployment
+tools/kolla-ansible -vvv deploy
+
+# TODO(SamYaple): Actually do functional testing of OpenStack
diff --git a/tools/dump_info.sh b/tools/dump_info.sh
new file mode 100755
index 000000000..b0b3ce3f1
--- /dev/null
+++ b/tools/dump_info.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+set -o xtrace
+
+function dump_node_info {
+ # NOTE(SamYaple): function for debugging gate
+ set +o errexit
+ local OLD_PATH="${PATH}"
+ PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ sudo parted -l
+
+ sudo mount
+
+ df -h
+
+ uname -a
+
+ cat /etc/*release*
+
+ cat /proc/meminfo
+
+ PATH="${OLD_PATH}"
+ set -o errexit
+}
+
+(dump_node_info 2>&1) > /tmp/logs/node_info_$(date +%s)
diff --git a/tools/kolla-ansible b/tools/kolla-ansible
index b2130ffb0..0acb9d2d5 100755
--- a/tools/kolla-ansible
+++ b/tools/kolla-ansible
@@ -10,7 +10,7 @@ function find_base_dir {
elif [[ ${dir_name} == "/usr/local/bin" ]]; then
BASEDIR=/usr/local/share/kolla
else
- BASEDIR="${dir_name}/.."
+ BASEDIR="$(dirname ${dir_name})"
fi
}
@@ -30,7 +30,11 @@ Usage: $0 COMMAND [options]
Options:
--inventory, -i <inventory_path> Specify path to ansible inventory file
--playbook, -p <playbook_path> Specify path to ansible playbook file
+ --configdir <config_path> Specify path to directory with globals.yml
+ --keyfile, -k <key_file> Specify path to ansible vault keyfile
--help, -h Show this usage information
+ --tags, -t <tags> Only run plays and tasks tagged with these values
+ --verbose, -v Increase verbosity of ansible-playbook
Commands:
prechecks Do pre-deployment checks for hosts
@@ -40,13 +44,20 @@ Commands:
EOF
}
-ARGS=$(getopt -o hi:p: -l help,inventory:,playbook: --name "$0" -- "$@") || { usage >&2; exit 2; }
+
+SHORT_OPTS="hi:p:t:k:v"
+LONG_OPTS="help,inventory:,playbook:,tags:,keyfile:,verbose,configdir:"
+ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; }
+
eval set -- "$ARGS"
find_base_dir
INVENTORY="${BASEDIR}/ansible/inventory/all-in-one"
PLAYBOOK="${BASEDIR}/ansible/site.yml"
+VERBOSITY=
+EXTRA_OPTS=
+CONFIG_DIR="/etc/kolla"
while [ "$#" -gt 0 ]; do
case "$1" in
@@ -61,6 +72,27 @@ while [ "$#" -gt 0 ]; do
shift 2
;;
+ (--tags|-t)
+ EXTRA_OPTS="$EXTRA_OPTS --tags $2"
+ shift 2
+ ;;
+
+ (--verbose|-v)
+ VERBOSITY="$VERBOSITY --verbose"
+ shift 1
+ ;;
+
+ (--configdir)
+ CONFIG_DIR="$2"
+ shift 2
+ ;;
+
+ (--keyfile|-k)
+ VAULT_PASS_FILE="$2"
+ EXTRA_OPTS="$EXTRA_OPTS --vault-password-file=$VAULT_PASS_FILE"
+ shift 2
+ ;;
+
(--help|-h)
usage
shift
@@ -84,24 +116,22 @@ case "$1" in
(prechecks)
ACTION="Pre-deployment checking"
PLAYBOOK="${BASEDIR}/ansible/prechecks.yml"
- CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK"
;;
(deploy)
ACTION="Deploying Playbooks"
- CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK -e action=deploy"
+ EXTRA_OPTS="$EXTRA_OPTS -e action=deploy"
;;
(post-deploy)
ACTION="Post-Deploying Playbooks"
PLAYBOOK="${BASEDIR}/ansible/post-deploy.yml"
- CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK"
;;
(pull)
ACTION="Pulling Docker images"
- CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK -e action=pull"
+ EXTRA_OPTS="$EXTRA_OPTS -e action=pull"
;;
(upgrade)
ACTION="Upgrading OpenStack Environment"
- CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK -e action=upgrade"
+ EXTRA_OPTS="$EXTRA_OPTS -e action=upgrade"
;;
(*) usage
@@ -109,4 +139,6 @@ case "$1" in
;;
esac
+CONFIG_OPTS="-e @${CONFIG_DIR}/globals.yml -e @${CONFIG_DIR}/passwords.yml"
+CMD="ansible-playbook -i $INVENTORY $CONFIG_OPTS $EXTRA_OPTS $PLAYBOOK $VERBOSITY"
process_cmd
diff --git a/tools/setup_Debian.sh b/tools/setup_Debian.sh
new file mode 100755
index 000000000..7c9d9578f
--- /dev/null
+++ b/tools/setup_Debian.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+set -o xtrace
+set -o errexit
+
+function add_key {
+ local counter=0
+
+ while :; do
+ if [[ "${counter}" -gt 5 ]]; then
+ echo "Failed to add Docker keyring"
+ exit 1
+ fi
+ # hkp://pool.sks-keyservers.net intermittenly doesnt have the correct
+ # keyring. p80 is what the docker script pulls from and what we should
+ # use for reliability too
+ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && break || :
+ sleep 5
+ done
+}
+
+function setup_disk {
+ sudo swapoff -a
+ sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
+ sudo chmod 0600 /swapfile
+ sudo mkswap /swapfile
+ sudo /sbin/swapon /swapfile
+
+ sudo dd if=/dev/zero of=/docker bs=1M count=10240
+ losetup -f /docker
+ DEV=$(losetup -a | awk -F: '/\/docker/ {print $1}')
+
+ # Format Disks and setup Docker to use BTRFS
+ sudo parted ${DEV} -s -- mklabel msdos
+ sudo rm -rf /var/lib/docker
+ sudo mkdir /var/lib/docker
+
+ # We want to snapshot the entire docker directory so we have to first create a
+ # subvolume and use that as the root for the docker directory.
+ sudo mkfs.btrfs -f ${DEV}
+ sudo mount ${DEV} /var/lib/docker
+ sudo btrfs subvolume create /var/lib/docker/docker
+ sudo umount /var/lib/docker
+ sudo mount -o noatime,subvol=docker ${DEV} /var/lib/docker
+}
+
+# (SamYaple)TODO: Remove the path overriding
+export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
+# Setup Docker repo and add signing key
+echo 'deb http://apt.dockerproject.org/repo ubuntu-trusty main' | sudo tee /etc/apt/sources.list.d/docker.list
+add_key
+sudo apt-get update
+sudo apt-get install -y --no-install-recommends docker-engine btrfs-tools
+
+sudo service docker stop
+setup_disk
+echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker
+sudo mount --make-shared /run
+sudo service docker start
+
+sudo docker info
+
+echo "Completed $0."
diff --git a/tools/setup_RedHat.sh b/tools/setup_RedHat.sh
new file mode 100755
index 000000000..f6d7fbeae
--- /dev/null
+++ b/tools/setup_RedHat.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+set -o xtrace
+set -o errexit
+
+function setup_disk {
+ sudo swapoff -a
+ sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
+ sudo chmod 0600 /swapfile
+ sudo mkswap /swapfile
+ sudo /sbin/swapon /swapfile
+
+ sudo dd if=/dev/zero of=/docker bs=1M count=10240
+ losetup -f /docker
+ DEV=$(losetup -a | awk -F: '/\/docker/ {print $1}')
+
+ # Format Disks and setup Docker to use BTRFS
+ sudo parted ${DEV} -s -- mklabel msdos
+ sudo rm -rf /var/lib/docker
+ sudo mkdir /var/lib/docker
+
+ # We want to snapshot the entire docker directory so we have to first create a
+ # subvolume and use that as the root for the docker directory.
+ sudo mkfs.btrfs -f ${DEV}
+ sudo mount ${DEV} /var/lib/docker
+ sudo btrfs subvolume create /var/lib/docker/docker
+ sudo umount /var/lib/docker
+ sudo mount -o noatime,subvol=docker ${DEV} /var/lib/docker
+}
+
+# (SamYaple)TODO: Remove the path overriding
+export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
+cat | sudo tee /etc/yum.repos.d/docker.repo << EOF
+[docker]
+name=Docker Main Repository
+baseurl=https://yum.dockerproject.org/repo/main/centos/7
+enabled=1
+gpgcheck=1
+gpgkey=https://yum.dockerproject.org/gpg
+EOF
+
+sudo yum install -y libffi-devel openssl-devel docker-engine btrfs-progs
+
+setup_disk
+
+# Setup Docker
+sudo sed -i -r 's,(ExecStart)=(.+),\1=/usr/bin/docker daemon --storage-driver btrfs,' /usr/lib/systemd/system/docker.service
+sudo sed -i 's|^MountFlags=.*|MountFlags=shared|' /usr/lib/systemd/system/docker.service
+sudo systemctl daemon-reload
+
+sudo systemctl start docker
+sudo docker info
+
+# disable ipv6 until we're sure routes to fedora mirrors work properly
+sudo sh -c 'echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf'
+sudo /usr/sbin/sysctl -p
+
+echo "Completed $0."
diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh
new file mode 100755
index 000000000..c701e10ed
--- /dev/null
+++ b/tools/setup_gate.sh
@@ -0,0 +1,112 @@
+#!/bin/bash
+
+set -o xtrace
+set -o errexit
+
+# Just for mandre :)
+if [[ ! -f /etc/sudoers.d/jenkins ]]; then
+ echo "jenkins ALL=(:docker) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/jenkins
+fi
+
+function setup_config {
+ # generate the config
+ tox -e genconfig
+ # Copy configs
+ sudo cp -a etc/kolla /etc/
+
+ # Use Infra provided pypi
+ echo "RUN echo $(base64 -w0 /etc/pip.conf) | base64 -d > /etc/pip.conf" | sudo tee /etc/kolla/header
+ sed -i 's|^#include_header.*|include_header = /etc/kolla/header|' /etc/kolla/kolla-build.conf
+
+ if [[ "${DISTRO}" == "Debian" ]]; then
+ # Infra does not sign thier mirrors so we ignore gpg signing in the gate
+ echo "RUN echo 'APT::Get::AllowUnauthenticated \"true\";' > /etc/apt/apt.conf" | sudo tee -a /etc/kolla/header
+
+ # Optimize the repos to take advantage of the Infra provided mirrors for Ubuntu
+ sed -i 's|^#apt_sources_list.*|apt_sources_list = /etc/kolla/sources.list|' /etc/kolla/kolla-build.conf
+ sudo cp /etc/apt/sources.list /etc/kolla/sources.list
+ # Append non-infra provided repos to list
+ cat << EOF | sudo tee -a /etc/kolla/sources.list
+deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/liberty main
+deb http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty main
+deb http://repo.percona.com/apt trusty main
+deb http://download.ceph.com/debian-hammer/ trusty main
+EOF
+ fi
+}
+
+function detect_distro {
+ DISTRO=$(ansible all -i "localhost," -msetup -clocal | awk -F\" '/ansible_os_family/ {print $4}')
+}
+
+function setup_ssh {
+ # Generate a new keypair that Ansible will use
+ ssh-keygen -f /home/jenkins/.ssh/kolla -N ''
+ cat /home/jenkins/.ssh/kolla.pub >> /home/jenkins/.ssh/authorized_keys
+
+ # Push the the public key around to all of the nodes
+ for ip in $(cat /etc/nodepool/sub_nodes_private); do
+ scp /home/jenkins/.ssh/kolla.pub ${ip}:/home/jenkins/.ssh/authorized_keys
+ # TODO(SamYaple): Remove this root key pushing once Kolla doesn't
+ # require root anymore.
+ ssh ${ip} -i /home/jenkins/.ssh/kolla 'sudo mkdir -p /root/.ssh; sudo cp /home/jenkins/.ssh/* /root/.ssh/'
+ done
+
+ # From now on use the new IdentityFile for connecting to other hosts
+ echo "IdentityFile /home/jenkins/.ssh/kolla" >> /home/jenkins/.ssh/config
+}
+
+function setup_inventory {
+ local counter=0
+
+ if [[ "${DISTRO}" == "Debian" ]]; then
+ ANSIBLE_CONNECTION_TYPE=ssh
+ else
+ ANSIBLE_CONNECTION_TYPE=local
+ fi
+
+ echo -e "127.0.0.1\tlocalhost" > /tmp/hosts
+ for ip in $(cat /etc/nodepool/{node_private,sub_nodes_private}); do
+ : $((counter++))
+ echo -e "${ip}\tnode${counter} $(ssh ${ip} hostname)" >> /tmp/hosts
+ echo "node${counter} ansible_connection=${ANSIBLE_CONNECTION_TYPE}" >> ${RAW_INVENTORY}
+ done
+
+ sudo chown root: /tmp/hosts
+ sudo chmod 644 /tmp/hosts
+ sudo mv /tmp/hosts /etc/hosts
+}
+
+function setup_ansible {
+ RAW_INVENTORY=/tmp/kolla/raw_inventory
+ mkdir /tmp/kolla
+
+ sudo -H pip install "ansible<2" "docker-py>=1.6.0"
+ detect_distro
+
+ setup_inventory
+
+ # Record the running state of the environment as seen by the setup module
+ ansible all -i ${RAW_INVENTORY} -m setup > /tmp/logs/ansible/initial-setup
+}
+
+function setup_node {
+ ansible-playbook -i ${RAW_INVENTORY} tools/setup_nodes.yml
+}
+
+function setup_logging {
+ # This directory is the directory that is copied with the devstack-logs
+ # publisher. It must exist at /home/jenkins/workspace/<job-name>/logs
+ mkdir logs
+
+ # For ease of access we symlink that logs directory to a known path
+ ln -s $(pwd)/logs /tmp/logs
+ mkdir -p /tmp/logs/{ansible,build}
+}
+
+setup_logging
+tools/dump_info.sh
+setup_ssh
+setup_ansible
+setup_node
+setup_config
diff --git a/tests/setup_nodes.yml b/tools/setup_nodes.yml
index e23da173d..82ca8ae6c 100644
--- a/tests/setup_nodes.yml
+++ b/tools/setup_nodes.yml
@@ -25,4 +25,4 @@
path: /tmp/{{ inventory_hostname }}
- name: Run node setup
- shell: sudo /tmp/setup.sh {{ docker_dev }}
+ shell: sudo /tmp/setup.sh
diff --git a/tox.ini b/tox.ini
index 478b267a7..537da1d38 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,7 +16,7 @@ commands =
find . -type f -name "*.pyc" -delete
python setup.py test --slowest --testr-args='{posargs}'
-[testenv:linters]
+[testenv:pep8]
commands =
{toxinidir}/tools/run-bashate.sh
flake8 {posargs}
@@ -24,9 +24,15 @@ commands =
{toxinidir}/tools/validate-all-yaml.sh
{toxinidir}/tools/validate-all-maintainer.sh
-[testenv:pep8]
+[testenv:linters]
+# temporary environment until infra jobs are changed.
+# TODO(jaegerandi): remove this
commands =
- flake8
+ {toxinidir}/tools/run-bashate.sh
+ flake8 {posargs}
+ {toxinidir}/tools/validate-all-json.sh
+ {toxinidir}/tools/validate-all-yaml.sh
+ {toxinidir}/tools/validate-all-maintainer.sh
[testenv:venv]
commands = {posargs}
@@ -34,19 +40,10 @@ commands = {posargs}
[testenv:docs]
commands = python setup.py build_sphinx
-[testenv:validate-contents]
-commands =
- {toxinidir}/tools/validate-all-json.sh
- {toxinidir}/tools/validate-all-yaml.sh
- {toxinidir}/tools/validate-all-maintainer.sh
-
-[testenv:bashate]
-commands =
- {toxinidir}/tools/run-bashate.sh
-
[testenv:setupenv]
-whitelist_externals = bash
-commands = bash -c tests/setup_gate.sh
+commands =
+ {toxinidir}/tools/setup_gate.sh
+ {toxinidir}/tools/dump_info.sh
[testenv:build-centos-binary]
whitelist_externals = find
@@ -58,6 +55,7 @@ commands =
find . -type f -name "*.pyc" -delete
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
sudo -E -g docker testr run test_build.BuildTestCentosBinary
+ {toxinidir}/tools/dump_info.sh
[testenv:build-centos-source]
whitelist_externals = find
@@ -69,6 +67,7 @@ commands =
find . -type f -name "*.pyc" -delete
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
sudo -E -g docker testr run test_build.BuildTestCentosSource
+ {toxinidir}/tools/dump_info.sh
[testenv:build-ubuntu-source]
whitelist_externals = find
@@ -80,6 +79,7 @@ commands =
find . -type f -name "*.pyc" -delete
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
sudo -E -g docker testr run test_build.BuildTestUbuntuSource
+ {toxinidir}/tools/dump_info.sh
[testenv:deploy-centos-binary]
whitelist_externals = find
@@ -91,7 +91,8 @@ commands =
find . -type f -name "*.pyc" -delete
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
sudo -E -g docker testr run test_build.DeployTestCentosBinary
- sudo tests/deploy_aio.sh centos binary
+ sudo {toxinidir}/tools/deploy_aio.sh centos binary
+ {toxinidir}/tools/dump_info.sh
[testenv:deploy-centos-source]
whitelist_externals = find
@@ -103,7 +104,8 @@ commands =
find . -type f -name "*.pyc" -delete
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
sudo -E -g docker testr run test_build.DeployTestCentosSource
- sudo tests/deploy_aio.sh centos source
+ sudo {toxinidir}/tools/deploy_aio.sh centos source
+ {toxinidir}/tools/dump_info.sh
[testenv:deploy-ubuntu-source]
whitelist_externals = find
@@ -115,7 +117,8 @@ commands =
find . -type f -name "*.pyc" -delete
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
sudo -E -g docker testr run test_build.DeployTestUbuntuSource
- sudo tests/deploy_aio.sh ubuntu source
+ sudo {toxinidir}/tools/deploy_aio.sh ubuntu source
+ {toxinidir}/tools/dump_info.sh
[testenv:deploy-multinode-ubuntu-source]
whitelist_externals = find
@@ -127,6 +130,7 @@ commands =
find . -type f -name "*.pyc" -delete
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
sudo -E -g docker testr run test_build.BuildTestUbuntuSource
+ {toxinidir}/tools/dump_info.sh
[testenv:genconfig]
whitelist_externals = which