Browse Source

Merge "Add Ironic Networking Baremetal Templates" into stable/queens

tags/8.4.1
Zuul 2 weeks ago
parent
commit
d32ac76546

+ 122
- 0
docker/services/ironic-neutron-agent.yaml View File

@@ -0,0 +1,122 @@
1
+heat_template_version: queens
2
+
3
+description: >
4
+  OpenStack ironic-neutron-agent service
5
+
6
+parameters:
7
+  DockerIronicNeutronAgentImage:
8
+    description: The container image to use for the ironic-neutron-agent
9
+    type: string
10
+  DockerNeutronConfigImage:
11
+    description: The container image to use for the neutron config_volume
12
+    type: string
13
+  ServiceData:
14
+    default: {}
15
+    description: Dictionary packing service data
16
+    type: json
17
+  ServiceNetMap:
18
+    default: {}
19
+    description: Mapping of service_name -> network name. Typically set
20
+                 via parameter_defaults in the resource registry.  This
21
+                 mapping overrides those in ServiceNetMapDefaults.
22
+    type: json
23
+  DefaultPasswords:
24
+    default: {}
25
+    type: json
26
+  RoleName:
27
+    default: ''
28
+    description: Role name on which the service is applied
29
+    type: string
30
+  RoleParameters:
31
+    default: {}
32
+    description: Parameters specific to the role
33
+    type: json
34
+  EndpointMap:
35
+    default: {}
36
+    description: Mapping of service endpoint -> protocol. Typically set
37
+                 via parameter_defaults in the resource registry.
38
+    type: json
39
+
40
+resources:
41
+
42
+  ContainersCommon:
43
+    type: ./containers-common.yaml
44
+
45
+  IronicNeutronAgentBase:
46
+    type: ../../puppet/services/ironic-neutron-agent.yaml
47
+    properties:
48
+      EndpointMap: {get_param: EndpointMap}
49
+      ServiceData: {get_param: ServiceData}
50
+      ServiceNetMap: {get_param: ServiceNetMap}
51
+      DefaultPasswords: {get_param: DefaultPasswords}
52
+      RoleName: {get_param: RoleName}
53
+      RoleParameters: {get_param: RoleParameters}
54
+
55
+  NeutronLogging:
56
+    type: OS::TripleO::Services::Logging::NeutronCommon
57
+    properties:
58
+      NeutronServiceName: ironic-neutron-agent
59
+
60
+outputs:
61
+  role_data:
62
+    description: Role data for ironic-neutron-agent service
63
+    value:
64
+      service_name: {get_attr: [IronicNeutronAgentBase, role_data, service_name]}
65
+      config_settings:
66
+        map_merge:
67
+          - get_attr: [IronicNeutronAgentBase, role_data, config_settings]
68
+          - get_attr: [NeutronLogging, config_settings]
69
+      puppet_config:
70
+        config_volume: neutron
71
+        puppet_tags: neutron_config,ironic_neutron_agent_config
72
+        step_config:
73
+          get_attr: [IronicNeutronAgentBase, role_data, step_config]
74
+        config_image: {get_param: DockerNeutronConfigImage}
75
+      kolla_config:
76
+        /var/lib/kolla/config_files/ironic_neutron_agent.json:
77
+          command: /usr/bin/ironic-neutron-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ironic_neutron_agent.ini --config-dir /etc/neutron/conf.d/common
78
+          config_files:
79
+            - source: "/var/lib/kolla/config_files/src/*"
80
+              dest: "/"
81
+              merge: true
82
+              preserve_properties: true
83
+          permissions:
84
+            - path: /var/log/neutron
85
+              owner: neutron:neutron
86
+              recurse: true
87
+      docker_config:
88
+        step_4:
89
+          ironic_neutron_agent:
90
+            start_order: 80
91
+            image: {get_param: DockerIronicNeutronAgentImage}
92
+            net: host
93
+            pid: host
94
+            privileged: true
95
+            restart: always
96
+            volumes:
97
+              list_concat:
98
+                - {get_attr: [ContainersCommon, volumes]}
99
+                - {get_attr: [NeutronLogging, volumes]}
100
+                -
101
+                  - /var/lib/kolla/config_files/ironic_neutron_agent.json:/var/lib/kolla/config_files/config.json:ro
102
+                  - /var/lib/config-data/puppet-generated/neutron/:/var/lib/kolla/config_files/src:ro
103
+            environment:
104
+              - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
105
+      host_prep_tasks: {get_attr: [NeutronLogging, host_prep_tasks]}
106
+      upgrade_tasks:
107
+        - name: Check if ironic-neutron-agent is deployed
108
+          command: systemctl is-enabled --quiet ironic-neutron-agent
109
+          tags: common
110
+          ignore_errors: True
111
+          register: ironic_neutron_agent_enabled
112
+        - name: "PreUpgrade step0,validation: Check service ironic-neutron-agent is running"
113
+          command: systemctl is-active --quiet ironic-neutron-agent
114
+          when:
115
+            - step|int == 0
116
+            - ironic_neutron_agent_enabled.rc == 0
117
+          tags: validation
118
+        - name: Stop and disable ironic-neutron-agent service
119
+          when:
120
+            - step|int == 2
121
+            - ironic_neutron_agent_enabled.rc == 0
122
+          service: name=ironic-neutron-agent state=stopped enabled=no

+ 2
- 0
environments/services-baremetal/ironic.yaml View File

@@ -2,5 +2,7 @@ resource_registry:
2 2
   OS::TripleO::Services::IronicApi: ../../puppet/services/ironic-api.yaml
3 3
   OS::TripleO::Services::IronicConductor: ../../puppet/services/ironic-conductor.yaml
4 4
   OS::TripleO::Services::NovaIronic: ../../puppet/services/nova-ironic.yaml
5
+  # Uncomment this line to enable the ironic-neutron-agent - Required for routed provider networks
6
+  # OS::TripleO::Services::IronicNeutronAgent: ../../puppet/services/ironic-neutron-agent.yaml
5 7
 parameter_defaults:
6 8
   NovaSchedulerDiscoverHostsInCellsInterval: 15

+ 2
- 0
environments/services-docker/ironic.yaml View File

@@ -3,3 +3,5 @@ resource_registry:
3 3
   OS::TripleO::Services::IronicConductor: ../../docker/services/ironic-conductor.yaml
4 4
   OS::TripleO::Services::IronicPxe: ../../docker/services/ironic-pxe.yaml
5 5
   OS::TripleO::Services::NovaIronic: ../../docker/services/nova-ironic.yaml
6
+  # Uncomment this line to enable the ironic-neutron-agent - Required for routed provider networks
7
+  # OS::TripleO::Services::IronicNeutronAgent: ../../docker/services/ironic-neutron-agent.yaml

+ 2
- 0
environments/services/ironic.yaml View File

@@ -3,3 +3,5 @@ resource_registry:
3 3
   OS::TripleO::Services::IronicConductor: ../../docker/services/ironic-conductor.yaml
4 4
   OS::TripleO::Services::IronicPxe: ../../docker/services/ironic-pxe.yaml
5 5
   OS::TripleO::Services::NovaIronic: ../../docker/services/nova-ironic.yaml
6
+  # Uncomment this line to enable the ironic-neutron-agent - Required for routed provider networks
7
+  # OS::TripleO::Services::IronicNeutronAgent: ../../docker/services/ironic-neutron-agent.yaml

+ 1
- 0
overcloud-resource-registry-puppet.j2.yaml View File

@@ -303,6 +303,7 @@ resource_registry:
303 303
   OS::TripleO::Services::IronicConductor: OS::Heat::None
304 304
   OS::TripleO::Services::IronicInspector: OS::Heat::None
305 305
   OS::TripleO::Services::IronicPxe: OS::Heat::None
306
+  OS::TripleO::Services::IronicNeutronAgent: OS::Heat::None
306 307
   OS::TripleO::Services::NovaIronic: OS::Heat::None
307 308
   OS::TripleO::Services::TripleoPackages: puppet/services/tripleo-packages.yaml
308 309
   OS::TripleO::Services::TripleoFirewall: puppet/services/tripleo-firewall.yaml

+ 87
- 0
puppet/services/ironic-neutron-agent.yaml View File

@@ -0,0 +1,87 @@
1
+heat_template_version: queens
2
+
3
+description: >
4
+  OpenStack ironic-neutron-agent configured with Puppet
5
+
6
+parameters:
7
+  ServiceData:
8
+    default: {}
9
+    description: Dictionary packing service data
10
+    type: json
11
+  ServiceNetMap:
12
+    default: {}
13
+    description: Mapping of service_name -> network name. Typically set
14
+                 via parameter_defaults in the resource registry.  This
15
+                 mapping overrides those in ServiceNetMapDefaults.
16
+    type: json
17
+  DefaultPasswords:
18
+    default: {}
19
+    type: json
20
+  RoleName:
21
+    default: ''
22
+    description: Role name on which the service is applied
23
+    type: string
24
+  RoleParameters:
25
+    default: {}
26
+    description: Parameters specific to the role
27
+    type: json
28
+  EndpointMap:
29
+    default: {}
30
+    description: Mapping of service endpoint -> protocol. Typically set
31
+                 via parameter_defaults in the resource registry.
32
+    type: json
33
+  IronicPassword:
34
+    description: The password for the Ironic service and db account, used by the Ironic services
35
+    type: string
36
+    hidden: true
37
+  KeystoneRegion:
38
+    type: string
39
+    default: 'regionOne'
40
+    description: Keystone region for endpoint
41
+
42
+resources:
43
+
44
+  NeutronBase:
45
+    type: ./neutron-base.yaml
46
+    properties:
47
+      ServiceData: {get_param: ServiceData}
48
+      ServiceNetMap: {get_param: ServiceNetMap}
49
+      DefaultPasswords: {get_param: DefaultPasswords}
50
+      EndpointMap: {get_param: EndpointMap}
51
+      RoleName: {get_param: RoleName}
52
+      RoleParameters: {get_param: RoleParameters}
53
+
54
+outputs:
55
+  role_data:
56
+    description: Role data for the ironic-neutron-agent service.
57
+    value:
58
+      service_name: ironic_neutron_agent
59
+      config_settings:
60
+        map_merge:
61
+          - get_attr: [NeutronBase, role_data, config_settings]
62
+          - neutron::agents::ml2::networking_baremetal::user: 'ironic'
63
+          - neutron::agents::ml2::networking_baremetal::password: {get_param: IronicPassword}
64
+          - neutron::agents::ml2::networking_baremetal::auth_url: { get_param: [ EndpointMap, KeystoneInternal, uri_no_suffix ] }
65
+          - neutron::agents::ml2::networking_baremetal::project_name: 'service'
66
+          - neutron::agents::ml2::networking_baremetal::user_domain_name: 'Default'
67
+          - neutron::agents::ml2::networking_baremetal::project_domain_name: 'Default'
68
+          - neutron::agents::ml2::networking_baremetal::region_name: {get_param: KeystoneRegion}
69
+      step_config: |
70
+        include tripleo::profile::base::neutron::agents::networking_baremetal
71
+      upgrade_tasks:
72
+        - name: Check if ironic-neutron-agent is deployed
73
+          command: systemctl is-enabled ironic-neutron-agent
74
+          tags: common
75
+          ignore_errors: True
76
+          register: ironic_neutron_agent_enabled
77
+        - name: "PreUpgrade step0,validation: Check service ironic-neutron-agent is running"
78
+          shell: /usr/bin/systemctl show 'ironic-neutron-agent' --property ActiveState | grep '\bactive\b'
79
+          when:
80
+            - step|int == 0
81
+            - ironic_neutron_agent_enabled.rc == 0
82
+          tags: validation
83
+        - name: Stop ironic-neutron-agent service
84
+          when:
85
+            - step|int == 1
86
+            - ironic_neutron_agent_enabled.rc == 0
87
+          service: name=ironic-neutron-agent state=stopped

+ 4
- 0
releasenotes/notes/ironic-networking-baremetal-29d9ad465565bb87.yaml View File

@@ -0,0 +1,4 @@
1
+---
2
+features:
3
+  - Adds support for Ironic Networking Baremetal. Networking Baremetal
4
+    is used to integrate the Bare Metal service with the Networking service.

Loading…
Cancel
Save