aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamYaple <sam@yaple.net>2015-12-26 01:11:31 +0000
committerSamYaple <sam@yaple.net>2015-12-31 16:38:56 +0000
commit4bd6285dc7fd5ac84f8b15f47815b21ee4270440 (patch)
tree62dc3c671b7cc510e399a6305555c0cc134b0858
parent2f03fc81ec613c396cdff45697edbbe7814d632c (diff)
downloadkolla-4bd6285dc7fd5ac84f8b15f47815b21ee4270440.tar.gz
kolla-4bd6285dc7fd5ac84f8b15f47815b21ee4270440.zip
Convert neutron to kolla_docker
Change-Id: Id58586ac20ee081eb731deb23e5f8dc26dfb8cc2 Partially-Implements: blueprint kolla-docker-module
-rw-r--r--ansible/roles/neutron/tasks/bootstrap.yml41
-rw-r--r--ansible/roles/neutron/tasks/start.yml215
2 files changed, 80 insertions, 176 deletions
diff --git a/ansible/roles/neutron/tasks/bootstrap.yml b/ansible/roles/neutron/tasks/bootstrap.yml
index b3707b0a5..db1654fa2 100644
--- a/ansible/roles/neutron/tasks/bootstrap.yml
+++ b/ansible/roles/neutron/tasks/bootstrap.yml
@@ -35,41 +35,18 @@
run_once: True
delegate_to: "{{ groups['neutron-server'][0] }}"
-- name: Starting Neutron bootstrap container
- docker:
- tty: True
+- name: Running Neutron bootstrap container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
detach: False
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "no"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- name: bootstrap_neutron
- image: "{{ neutron_server_image_full }}"
- volumes: "{{ node_config_directory }}/neutron-server/:{{ container_config_directory }}/:ro"
- env:
+ environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- run_once: True
- delegate_to: "{{ groups['neutron-server'][0] }}"
- when: database_created
-
-# https://github.com/ansible/ansible-modules-core/pull/1031
-- name: Waiting for bootstrap container to exit
- command: docker wait bootstrap_neutron
- register: bootstrap_result
- run_once: True
- failed_when: bootstrap_result.stdout != "0"
- delegate_to: "{{ groups['neutron-server'][0] }}"
- when: database_created
-
-- name: Cleaning up Neutron bootstrap container
- docker:
- name: bootstrap_neutron
image: "{{ neutron_server_image_full }}"
- state: absent
+ name: "bootstrap_neutron"
+ restart_policy: "never"
+ volumes: "{{ node_config_directory }}/neutron-server/:{{ container_config_directory }}/:ro"
+ run_once: True
delegate_to: "{{ groups['neutron-server'][0] }}"
when: database_created
diff --git a/ansible/roles/neutron/tasks/start.yml b/ansible/roles/neutron/tasks/start.yml
index 76a19d305..d7472dd7e 100644
--- a/ansible/roles/neutron/tasks/start.yml
+++ b/ansible/roles/neutron/tasks/start.yml
@@ -1,197 +1,124 @@
---
-- name: Starting Openvswitch data container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- name: openvswitch_data
+- name: Starting openvswitch-data container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ openvswitch_data_image_full }}"
+ name: "openvswitch_data"
volumes: "/var/lib/openvswitch/"
-- name: Starting Openvswitch-db container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- name: openvswitch_db
+- name: Starting openvswitch-db container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ openvswitch_db_image_full }}"
+ name: "openvswitch_db"
volumes:
- - "/run:/run"
- "{{ node_config_directory }}/openvswitch-db-server/:{{ container_config_directory }}/:ro"
- volumes_from:
- - openvswitch_data
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- when: (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
- and neutron_plugin_agent == "openvswitch"
+ - "/run:/run"
+ volumes_from: "openvswitch_data"
+ when:
+ - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - neutron_plugin_agent == "openvswitch"
- name: Ensuring OVS bridge is properly setup
command: docker exec openvswitch_db /usr/local/bin/kolla_ensure_openvswitch_configured {{ neutron_bridge_name }} {{ neutron_external_interface }}
register: status
changed_when: status.stdout.find('changed') != -1
- when: (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
- and neutron_plugin_agent == "openvswitch"
+ when:
+ - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - neutron_plugin_agent == "openvswitch"
-- name: Starting Openvswitch-vswitchd container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- privileged: True
- name: openvswitch_vswitchd
+- name: Starting openvswitch-vswitchd container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ openvswitch_vswitchd_image_full }}"
+ name: "openvswitch_vswitchd"
+ privileged: True
volumes:
- - "/run:/run"
- - "/lib/modules:/lib/modules:ro"
- "{{ node_config_directory }}/openvswitch-vswitchd/:{{ container_config_directory }}/:ro"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- when: (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
- and neutron_plugin_agent == "openvswitch"
+ - "/lib/modules:/lib/modules:ro"
+ - "/run:/run"
+ when:
+ - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - neutron_plugin_agent == "openvswitch"
-- name: Starting Neutron-server container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- name: neutron_server
+- name: Starting neutron-server container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ neutron_server_image_full }}"
+ name: "neutron_server"
volumes:
- "{{ node_config_directory }}/neutron-server/:{{ container_config_directory }}/:ro"
- "/var/lib/kolla/dev/log:/dev/log"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['neutron-server']
-- name: Starting Neutron-openvswitch-agent container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- privileged: True
- name: neutron_openvswitch_agent
+- name: Starting neutron-openvswitch-agent container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ neutron_openvswitch_agent_image_full }}"
+ name: "neutron_openvswitch_agent"
+ privileged: True
volumes:
- - "/run:/run"
- - "/lib/modules:/lib/modules:ro"
- "{{ node_config_directory }}/neutron-openvswitch-agent/:{{ container_config_directory }}/:ro"
+ - "/lib/modules:/lib/modules:ro"
+ - "/run:/run"
- "/var/lib/kolla/dev/log:/dev/log"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when:
- 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
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- privileged: True
- name: neutron_openvswitch_agent_fake_{{ item }}
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ neutron_openvswitch_agent_image_full }}"
+ name: "neutron_openvswitch_agent_fake_{{ item }}"
+ privileged: True
volumes:
- - "/run:/run"
- - "/lib/modules:/lib/modules:ro"
- "{{ 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"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
with_sequence: start=1 end={{ num_nova_fake_per_node }}
when:
- inventory_hostname in groups['compute']
- neutron_plugin_agent == "openvswitch"
- enable_nova_fake | bool
-- name: Starting Neutron-linuxbridge-agent container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- privileged: True
- name: neutron_linuxbridge_agent
+- name: Starting neutron-linuxbridge-agent container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ environment:
+ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
+ NEUTRON_BRIDGE: "br-ex"
+ NEUTRON_INTERFACE: "{{ neutron_external_interface }}"
image: "{{ neutron_linuxbridge_agent_image_full }}"
+ name: "neutron_linuxbridge_agent"
+ privileged: True
volumes:
- - "/run:/run"
- - "/lib/modules:/lib/modules:ro"
- "{{ node_config_directory }}/neutron-linuxbridge-agent/:{{ container_config_directory }}/:ro"
+ - "/lib/modules:/lib/modules:ro"
+ - "/run:/run"
- "/var/lib/kolla/dev/log:/dev/log"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- NEUTRON_BRIDGE: "br-ex"
- NEUTRON_INTERFACE: "{{ neutron_external_interface }}"
- when: (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
- and neutron_plugin_agent == "linuxbridge"
+ when:
+ - (inventory_hostname in groups['compute'] or inventory_hostname in groups['neutron-agents'])
+ - neutron_plugin_agent == "linuxbridge"
-- name: Starting Neutron-agents container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- privileged: True
- name: neutron_agents
+- name: Starting neutron-agents container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ neutron_agents_image_full }}"
+ name: "neutron_agents"
+ privileged: True
volumes:
- - "/run:/run"
- "{{ node_config_directory }}/neutron-agents/:{{ container_config_directory }}/:ro"
+ - "/run:/run"
- "/var/lib/kolla/dev/log:/dev/log"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['neutron-agents']