<commit_before>#
# GROUPS
#
- id: nsdb
  parameters:
    strategy:
      type: parallel
  requires:
  - deploy_start
  required_for:
  - controller
  - primary-controller
  - deploy_end
  role:
  - nsdb
  type: group
  tasks:
  - logging
  - hiera
  - globals
  - netconfig

- id: midonet-gw
  parameters:
    strategy:
      type: parallel
  requires:
  - deploy_start
  - nsdb
  required_for:
  - deploy_end
  role:
  - midonet-gw
  type: group
  tasks:
  - logging
  - hiera
  - globals
  - netconfig

- id: midonet-analytics
  parameters:
    strategy:
      type: parallel
  requires:
  - deploy_start
  - nsdb
  required_for:
  - deploy_end
  role:
  - midonet-analytics
  type: group
  tasks:
  - logging
  - hiera
  - globals
  - netconfig

# Override neutron params
- id: install_common_deps
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: shell
  requires: [pre_deployment_start]
  required_for: [pre_deployment_end]
  version: 2.0.0
  parameters:
    cmd: bash install_midonet_common_modules_and_gems.sh
    timeout: 1440

- id: override_neutron_module
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: shell
  requires: [pre_deployment_start]
  required_for: [pre_deployment_end]
  version: 2.0.0
  parameters:
    cmd: bash override_neutron_module.sh
    timeout: 1440

# Override neutron params
- id: neutron-override
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: puppet
  requires: [pre_deployment_start]
  required_for: [pre_deployment_end]
  version: 2.0.0
  parameters:
    puppet_manifest: puppet/manifests/midonet-override-hiera.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

# Install the MidoNet Package. Everywhere
- id: install_midonet_package
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: shell
  requires: [deploy_start,setup_repositories]
  required_for: [fuel_pkgs]
  version: 2.0.0
  parameters:
    cmd: bash install_midonet_package_from_source.sh
    timeout: 1440


# Install the MidoNet_Openstack Package where needed. For Java, Zookeeper and Cassandra
- id: install_midonet_openstack_package
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: shell
  requires: [deploy_start,setup_repositories]
  required_for: [fuel_pkgs]
  version: 2.0.0
  parameters:
    cmd: bash install_midonet_openstack_package.sh
    timeout: 1440


# First independent tasks
- id: setup_repositories_midonet
  groups:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  required_for:
  - deploy_end
  requires:
  - netconfig
  - install_common_deps
  - install_midonet_package
  - install_midonet_openstack_package
  - override_neutron_module
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-define-repositories.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: enable_ip_forward_midonet
  groups:
  - compute
  - controller
  - primary-controller
  - midonet-gw
  - midonet-analytics
  required_for:
  - deploy_end
  requires:
  - deploy_start
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-enable-ip-forward.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720


# PRE-NEUTRON CONFIGURATION
- id: deploy_cluster_midonet
  groups:
  - primary-controller
  - controller
  required_for:
  - deploy_end
  - openstack-network-start
  requires:
  - setup_repositories_midonet
  - enable_ip_forward_midonet
  - firewall
  - primary-cluster-haproxy
  - cluster-haproxy
  cross-depends:
    - name: zookeeper_and_cassandra_midonet
  version: 2.0.0
  type: puppet
  reexecute_on:
  - deploy_changes
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-cluster.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 3600

# In controllers, we have to install midolman 'before' the neutron
# configuration, because subnet creates a the DHCP port in neutron
# and we need to do the binding.
- id: agent-midonet-controller
  groups:
  - primary-controller
  - controller
  required_for:
  - deploy_end
  - openstack-network-start
  requires:
  - deploy_cluster_midonet
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-agent.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 4500


# NEUTRON CONFIGURATION
- id: openstack-network-midonet-replace-service-name
  groups:
  - primary-controller
  - controller
  requires:
  - openstack-network-common-config
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-replace-guess-func.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: openstack-network-midonet-config
  groups:
  - primary-controller
  - controller
  requires:
  - openstack-network-midonet-replace-service-name
  - setup_repositories_midonet
  required_for:
  - openstack-network-server-config
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-neutron-configure.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: openstack-network-midonet-networks
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-neutron-networks.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: openstack-network-midonet-cleanup-static
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-cleanup-static.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.cluster.status != 'new'

- id: openstack-network-midonet-cleanup-bgp
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-cleanup-bgp.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.bgp_local_as,
      $.midonet.bgp_neighbors) and $.cluster.status != 'new')

- id: openstack-network-midonet-edge
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  - openstack-network-midonet-cleanup-static
  - openstack-network-midonet-cleanup-bgp
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-setup.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: openstack-network-midonet-edge-bgp
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  - openstack-network-midonet-edge
  - openstack-network-midonet-cleanup-static
  - openstack-network-midonet-cleanup-bgp
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-setup-bgp.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.bgp_local_as,
      $.midonet.bgp_neighbors) and $.midonet.gateway_type = 'bgp')

- id: openstack-network-midonet-edge-static
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  - openstack-network-midonet-edge
  - openstack-network-midonet-cleanup-bgp
  - openstack-network-midonet-cleanup-static
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-setup-static.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.midonet.gateway_type = 'static')

- id: openstack-network-midonet-edge-static-per-host
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  - openstack-network-midonet-edge
  - openstack-network-midonet-cleanup-static
  - openstack-network-midonet-cleanup-bgp
  - openstack-network-midonet-edge-static
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-setup-static-per-host.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.midonet.gateway_type = 'static')

- id: openstack-network-midonet-compute-nova
  parameters:
    puppet_manifest: puppet/manifests/midonet-compute-nova.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  required_for:
  - openstack-network-end
  requires:
  - setup_repositories_midonet
  - openstack-network-common-config
  - openstack-network-agents-l3
  - openstack-network-agents-metadata
  version: 2.0.0
  type: puppet
  groups:
  - compute

# NSDB-only tasks
- id: zookeeper_and_cassandra_midonet
  groups:
  - nsdb
  required_for:
  - deploy_end
  requires:
  - deploy_start
  - install_midonet_openstack_package
  - install_midonet_package
  - netconfig
  version: 2.0.0
  type: puppet
  reexecute_on:
  - deploy_changes
  parameters:
    puppet_manifest: puppet/manifests/midonet-nsdb.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 3600

# Analytics Only tasks

- id: mem-analytics-java8
  role:
  - midonet-analytics
  required_for:
  - deploy_end
  requires:
  - deploy_start
  - install_midonet_openstack_package
  - install_midonet_package
  - netconfig
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-java8.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720
  condition:
    yaql_exp: "$.midonet.mem = true and $.midonet.mem_insights = true"

- id: mem-analytics-install
  role:
  - midonet-analytics
  required_for:
  - deploy_end
  requires:
  - deploy_start
  - install_midonet_openstack_package
  - install_midonet_package
  - netconfig
  - mem-analytics-java8
  - setup_repositories_midonet
  cross-depends:
  - name: zookeeper_and_cassandra_midonet
  - name: deploy_cluster_midonet
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-analytics.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 4500
  condition:
    yaql_exp: "$.midonet.mem = true and $.midonet.mem_insights = true"


# Skipped tasks
- id: openstack-network-server-config
  type: skipped
- id: openstack-network-networks
  type: skipped
- id: openstack-network-routers
  type: skipped
- id: openstack-network-plugins-l2
  type: skipped
- id: primary-openstack-network-plugins-l2
  type: skipped
- id: openstack-network-agents-l3
  type: skipped
- id: primary-openstack-network-agents-l3
  type: skipped
- id: openstack-network-compute-nova
  type: skipped
  # This task tries to enable the service nova_compute but we already to that
  # inside our custom midonet-compute-nova task.
- id: enable_nova_compute_service
  type: skipped


# POST-DEPLOYMENT TASKS

# The task configure_default_route reinstalls openvswitch-switch
# and removes midolman. This task only runs on compute hosts, so
# we have to make sure that midolman is installed 'after' the
# 'configure_default_route' task has run
- id: agent-midonet-compute
  role:
  - compute
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - configure_default_route
  - post_deployment_start
  version: 2.0.0
  type: puppet
  reexecute_on:
  - deploy_changes
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-agent.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 4500

- id: tunnel-zones-midonet
  role:
  - compute
  - controller
  - primary-controller
  - midonet-gw
  reexecute_on:
    - deploy_changes
  required_for:
  - post_deployment_end
  requires:
  - post_deployment_start
  - agent-midonet-compute
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-host-registry.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720

- id: generate-openrc-gw
  role:
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - post_deployment_start
  - tunnel-zones-midonet
  version: 2.0.0
  reexecute_on:
    - deploy_changes
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-generate-openrc-for-gw.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720

- id: midonet-edge-router-cleanup-bgp-gw
  role:
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - generate-openrc-gw
  - post_deployment_start
  - tunnel-zones-midonet
  type: puppet
  reexecute_on:
    - deploy_changes
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-cleanup-bgp-gw.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720
  version: 2.0.0
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.bgp_local_as,
      $.midonet.bgp_neighbors) and $.cluster.status != 'new' )

- id: openstack-network-midonet-cleanup-static-per-host
  role:
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - generate-openrc-gw
  - post_deployment_start
  - tunnel-zones-midonet
  reexecute_on:
    - deploy_changes
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-cleanup-static-per-host.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.cluster.status != 'new'

- id: openstack-network-midonet-cleanup-masq
  role:
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - generate-openrc-gw
  - post_deployment_start
  - tunnel-zones-midonet
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-cleanup-masquerade.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.cluster.status != 'new'

- id: midonet-bgp-interfaces
  role:
  - midonet-gw
  required_for:<commit_msg>[Midonet] Deploy fail with "Loop detected" Deployment failed with message: "Error: Deployment has failed. Method task_deploy. Cluster[]: Loop detected! Path: Task[enable_ip_forward_midonet/1], Task[deploy_end/virtual_sync_node], Task[post_deployment_start/virtual_sync_node], Task[generate-openrc-gw/4], Task[openstack-network-midonet-cleanup-masq/4], Task[openstack-network-end/4], Task[deploy_end/virtual_sync_node]. Inspect Astute logs for the details" https://bugs.launchpad.net/fuel-plugins/+bug/1645794<commit_after>#
# GROUPS
#
- id: nsdb
  parameters:
    strategy:
      type: parallel
  requires:
  - deploy_start
  required_for:
  - controller
  - primary-controller
  - deploy_end
  role:
  - nsdb
  type: group
  tasks:
  - logging
  - hiera
  - globals
  - netconfig

- id: midonet-gw
  parameters:
    strategy:
      type: parallel
  requires:
  - deploy_start
  - nsdb
  required_for:
  - deploy_end
  role:
  - midonet-gw
  type: group
  tasks:
  - logging
  - hiera
  - globals
  - netconfig

- id: midonet-analytics
  parameters:
    strategy:
      type: parallel
  requires:
  - deploy_start
  - nsdb
  required_for:
  - deploy_end
  role:
  - midonet-analytics
  type: group
  tasks:
  - logging
  - hiera
  - globals
  - netconfig

# Override neutron params
- id: install_common_deps
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: shell
  requires: [pre_deployment_start]
  required_for: [pre_deployment_end]
  version: 2.0.0
  parameters:
    cmd: bash install_midonet_common_modules_and_gems.sh
    timeout: 1440

- id: override_neutron_module
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: shell
  requires: [pre_deployment_start]
  required_for: [pre_deployment_end]
  version: 2.0.0
  parameters:
    cmd: bash override_neutron_module.sh
    timeout: 1440

# Override neutron params
- id: neutron-override
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: puppet
  requires: [pre_deployment_start]
  required_for: [pre_deployment_end]
  version: 2.0.0
  parameters:
    puppet_manifest: puppet/manifests/midonet-override-hiera.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

# Install the MidoNet Package. Everywhere
- id: install_midonet_package
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: shell
  requires: [deploy_start,setup_repositories]
  required_for: [fuel_pkgs]
  version: 2.0.0
  parameters:
    cmd: bash install_midonet_package_from_source.sh
    timeout: 1440


# Install the MidoNet_Openstack Package where needed. For Java, Zookeeper and Cassandra
- id: install_midonet_openstack_package
  role:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  type: shell
  requires: [deploy_start,setup_repositories]
  required_for: [fuel_pkgs]
  version: 2.0.0
  parameters:
    cmd: bash install_midonet_openstack_package.sh
    timeout: 1440


# First independent tasks
- id: setup_repositories_midonet
  groups:
  - primary-controller
  - controller
  - compute
  - nsdb
  - midonet-gw
  - midonet-analytics
  required_for:
  - deploy_end
  requires:
  - netconfig
  - install_common_deps
  - install_midonet_package
  - install_midonet_openstack_package
  - override_neutron_module
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-define-repositories.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: enable_ip_forward_midonet
  groups:
  - compute
  - controller
  - primary-controller
  - midonet-gw
  - midonet-analytics
  required_for:
  - deploy_end
  requires:
  - deploy_start
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-enable-ip-forward.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720


# PRE-NEUTRON CONFIGURATION
- id: deploy_cluster_midonet
  groups:
  - primary-controller
  - controller
  required_for:
  - deploy_end
  - openstack-network-start
  requires:
  - setup_repositories_midonet
  - enable_ip_forward_midonet
  - firewall
  - primary-cluster-haproxy
  - cluster-haproxy
  cross-depends:
    - name: zookeeper_and_cassandra_midonet
  version: 2.0.0
  type: puppet
  reexecute_on:
  - deploy_changes
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-cluster.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 3600

# In controllers, we have to install midolman 'before' the neutron
# configuration, because subnet creates a the DHCP port in neutron
# and we need to do the binding.
- id: agent-midonet-controller
  groups:
  - primary-controller
  - controller
  required_for:
  - deploy_end
  - openstack-network-start
  requires:
  - deploy_cluster_midonet
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-agent.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 4500


# NEUTRON CONFIGURATION
- id: openstack-network-midonet-replace-service-name
  groups:
  - primary-controller
  - controller
  requires:
  - openstack-network-common-config
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-replace-guess-func.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: openstack-network-midonet-config
  groups:
  - primary-controller
  - controller
  requires:
  - openstack-network-midonet-replace-service-name
  - setup_repositories_midonet
  required_for:
  - openstack-network-server-config
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-neutron-configure.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: openstack-network-midonet-networks
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-neutron-networks.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: openstack-network-midonet-cleanup-static
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-cleanup-static.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.cluster.status != 'new'

- id: openstack-network-midonet-cleanup-bgp
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-cleanup-bgp.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.bgp_local_as,
      $.midonet.bgp_neighbors) and $.cluster.status != 'new')

- id: openstack-network-midonet-edge
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  - openstack-network-midonet-cleanup-static
  - openstack-network-midonet-cleanup-bgp
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-setup.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440

- id: openstack-network-midonet-edge-bgp
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  - openstack-network-midonet-edge
  - openstack-network-midonet-cleanup-static
  - openstack-network-midonet-cleanup-bgp
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-setup-bgp.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.bgp_local_as,
      $.midonet.bgp_neighbors) and $.midonet.gateway_type = 'bgp')

- id: openstack-network-midonet-edge-static
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  - openstack-network-midonet-edge
  - openstack-network-midonet-cleanup-bgp
  - openstack-network-midonet-cleanup-static
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-setup-static.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.midonet.gateway_type = 'static')

- id: openstack-network-midonet-edge-static-per-host
  groups:
  - primary-controller
  requires:
  - openstack-network-server-config
  - openstack-network-midonet-config
  - setup_repositories_midonet
  - openstack-network-midonet-networks
  - openstack-network-midonet-edge
  - openstack-network-midonet-cleanup-static
  - openstack-network-midonet-cleanup-bgp
  - openstack-network-midonet-edge-static
  reexecute_on:
    - deploy_changes
  required_for:
  - openstack-network-end
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-setup-static-per-host.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.midonet.gateway_type = 'static')

- id: openstack-network-midonet-compute-nova
  parameters:
    puppet_manifest: puppet/manifests/midonet-compute-nova.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  required_for:
  - openstack-network-end
  requires:
  - setup_repositories_midonet
  - openstack-network-common-config
  - openstack-network-agents-l3
  - openstack-network-agents-metadata
  version: 2.0.0
  type: puppet
  groups:
  - compute

# NSDB-only tasks
- id: zookeeper_and_cassandra_midonet
  groups:
  - nsdb
  required_for:
  - deploy_end
  requires:
  - deploy_start
  - install_midonet_openstack_package
  - install_midonet_package
  - netconfig
  version: 2.0.0
  type: puppet
  reexecute_on:
  - deploy_changes
  parameters:
    puppet_manifest: puppet/manifests/midonet-nsdb.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 3600

# Analytics Only tasks

- id: mem-analytics-java8
  role:
  - midonet-analytics
  required_for:
  - deploy_end
  requires:
  - deploy_start
  - install_midonet_openstack_package
  - install_midonet_package
  - netconfig
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-java8.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720
  condition:
    yaql_exp: "$.midonet.mem = true and $.midonet.mem_insights = true"

- id: mem-analytics-install
  role:
  - midonet-analytics
  required_for:
  - deploy_end
  requires:
  - deploy_start
  - install_midonet_openstack_package
  - install_midonet_package
  - netconfig
  - mem-analytics-java8
  - setup_repositories_midonet
  cross-depends:
  - name: zookeeper_and_cassandra_midonet
  - name: deploy_cluster_midonet
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-analytics.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 4500
  condition:
    yaql_exp: "$.midonet.mem = true and $.midonet.mem_insights = true"


# Skipped tasks
- id: openstack-network-server-config
  type: skipped
- id: openstack-network-networks
  type: skipped
- id: openstack-network-routers
  type: skipped
- id: openstack-network-plugins-l2
  type: skipped
- id: primary-openstack-network-plugins-l2
  type: skipped
- id: openstack-network-agents-l3
  type: skipped
- id: primary-openstack-network-agents-l3
  type: skipped
- id: openstack-network-compute-nova
  type: skipped
  # This task tries to enable the service nova_compute but we already to that
  # inside our custom midonet-compute-nova task.
- id: enable_nova_compute_service
  type: skipped


# POST-DEPLOYMENT TASKS

# The task configure_default_route reinstalls openvswitch-switch
# and removes midolman. This task only runs on compute hosts, so
# we have to make sure that midolman is installed 'after' the
# 'configure_default_route' task has run
- id: agent-midonet-compute
  role:
  - compute
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - configure_default_route
  - post_deployment_start
  version: 2.0.0
  type: puppet
  reexecute_on:
  - deploy_changes
  parameters:
    puppet_manifest: puppet/manifests/midonet-install-agent.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 4500

- id: tunnel-zones-midonet
  role:
  - compute
  - controller
  - primary-controller
  - midonet-gw
  reexecute_on:
    - deploy_changes
  required_for:
  - post_deployment_end
  requires:
  - post_deployment_start
  - agent-midonet-compute
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-host-registry.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720

- id: generate-openrc-gw
  role:
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - post_deployment_start
  - tunnel-zones-midonet
  version: 2.0.0
  reexecute_on:
    - deploy_changes
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-generate-openrc-for-gw.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720

- id: midonet-edge-router-cleanup-bgp-gw
  role:
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - generate-openrc-gw
  - post_deployment_start
  - tunnel-zones-midonet
  type: puppet
  reexecute_on:
    - deploy_changes
  parameters:
    puppet_manifest: puppet/manifests/midonet-edge-router-cleanup-bgp-gw.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 720
  version: 2.0.0
  condition:
    yaql_exp: >
      (changedAny($.midonet.gateway_type,$.midonet.bgp_local_as,
      $.midonet.bgp_neighbors) and $.cluster.status != 'new' )

- id: openstack-network-midonet-cleanup-static-per-host
  role:
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - generate-openrc-gw
  - post_deployment_start
  - tunnel-zones-midonet
  reexecute_on:
    - deploy_changes
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-cleanup-static-per-host.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.cluster.status != 'new'

- id: openstack-network-midonet-cleanup-masq
  role:
  - midonet-gw
  required_for:
  - post_deployment_end
  requires:
  - generate-openrc-gw
  - post_deployment_start
  - tunnel-zones-midonet
  reexecute_on:
    - deploy_changes
  version: 2.0.0
  type: puppet
  parameters:
    puppet_manifest: puppet/manifests/midonet-cleanup-masquerade.pp
    puppet_modules: "puppet/modules/:/etc/puppet/modules/"
    timeout: 1440
  condition:
    yaql_exp: >
      changedAny($.midonet.gateway_type,$.midonet.static_linux_bridge_address,
      $.midonet.static_fake_edge_router_address,
      $.midonet.static_use_masquerade) and $.cluster.status != 'new'

- id: midonet-bgp-interfaces
  role:
  - midonet-gw
  required_for:
{'fraction_non_alphanumeric': 0.09978806602787976, 'fraction_numerical': 0.012208590788334677, 'mean_word_length': 3.406998158379374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3060023', 'n_tokens_mistral': 12716, 'n_tokens_neox': 11974, 'n_words': 1964}