aboutsummaryrefslogtreecommitdiffstats
path: root/puppet/services/opendaylight-ovs.yaml
blob: 8ffa8a34dd7333fcd6bd8182934098eee77b8fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
heat_template_version: pike

description: >
  OpenDaylight OVS Configuration.

parameters:
  OpenDaylightPort:
    default: 8081
    description: Set opendaylight service port
    type: number
  OpenDaylightUsername:
    default: 'admin'
    description: The username for the opendaylight server.
    type: string
  OpenDaylightPassword:
    default: 'admin'
    type: string
    description: The password for the opendaylight server.
    hidden: true
  OpenDaylightConnectionProtocol:
    description: L7 protocol used for REST access
    type: string
    default: 'http'
  OpenDaylightCheckURL:
    description: URL postfix to verify ODL has finished starting up
    type: string
    default: 'restconf/operational/network-topology:network-topology/topology/netvirt:1'
  OpenDaylightApiVirtualIP:
    type: string
    default: ''
  OpenDaylightProviderMappings:
    description: Mappings between logical networks and physical interfaces.
                 Required for VLAN deployments.  For example physnet1 -> eth1.
    type: comma_delimited_list
    default: "datacentre:br-ex"
  EndpointMap:
    default: {}
    description: Mapping of service endpoint -> protocol. Typically set
                 via parameter_defaults in the resource registry.
    type: json
  ServiceData:
    default: {}
    description: Dictionary packing service data
    type: json
  ServiceNetMap:
    default: {}
    description: Mapping of service_name -> network name. Typically set
                 via parameter_defaults in the resource registry.  This
                 mapping overrides those in ServiceNetMapDefaults.
    type: json
  DefaultPasswords:
    default: {}
    type: json
  RoleName:
    default: ''
    description: Role name on which the service is applied
    type: string
  RoleParameters:
    default: {}
    description: Parameters specific to the role
    type: json

resources:
  Ovs:
    type: ./openvswitch.yaml
    properties:
      ServiceData: {get_param: ServiceData}
      ServiceNetMap: {get_param: ServiceNetMap}
      DefaultPasswords: {get_param: DefaultPasswords}
      EndpointMap: {get_param: EndpointMap}
      RoleName: {get_param: RoleName}
      RoleParameters: {get_param: RoleParameters}

outputs:
  role_data:
    description: Role data for the OpenDaylight service.
    value:
      service_name: opendaylight_ovs
      config_settings:
        map_merge:
          - opendaylight::odl_rest_port: {get_param: OpenDaylightPort}
            opendaylight::username: {get_param: OpenDaylightUsername}
            opendaylight::password: {get_param: OpenDaylightPassword}
            opendaylight_check_url: {get_param: OpenDaylightCheckURL}
            opendaylight::nb_connection_protocol: {get_param: OpenDaylightConnectionProtocol}
            neutron::agents::ml2::ovs::local_ip: {get_param: [ServiceNetMap, NeutronTenantNetwork]}
            neutron::plugins::ovs::opendaylight::provider_mappings: {get_param: OpenDaylightProviderMappings}
            tripleo.opendaylight_ovs.firewall_rules:
              '118 neutron vxlan networks':
               proto: 'udp'
               dport: 4789
              '136 neutron gre networks':
               proto: 'gre'
          - get_attr: [Ovs, role_data, config_settings]
      step_config: |
        include tripleo::profile::base::neutron::plugins::ovs::opendaylight
      upgrade_tasks:
        yaql:
          expression: $.data.ovs_upgrade + $.data.opendaylight_upgrade
          data:
            ovs_upgrade:
              get_attr: [Ovs, role_data, upgrade_tasks]
            opendaylight_upgrade:
              - name: Check if openvswitch is deployed
                command: systemctl is-enabled openvswitch
                tags: common
                ignore_errors: True
                register: openvswitch_enabled
              - name: "PreUpgrade step0,validation: Check service openvswitch is running"
                shell: /usr/bin/systemctl show 'openvswitch' --property ActiveState | grep '\bactive\b'
                when: openvswitch_enabled.rc == 0
                tags: step0,validation
              - name: Stop openvswitch service
                tags: step1
                when: openvswitch_enabled.rc == 0
                service: name=openvswitch state=stopped