updated templates and scripts for Airship 1.3
[yaml_builds.git] / site_type / sriov-a13 / templates / baremetal / bootactions / calico-ip-rules.j2
1 ---
2 ##############################################################################
3 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.        #
4 #                                                                            #
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may    #
6 # not use this file except in compliance with the License.                   #
7 #                                                                            #
8 # You may obtain a copy of the License at                                    #
9 #       http://www.apache.org/licenses/LICENSE-2.0                           #
10 #                                                                            #
11 # Unless required by applicable law or agreed to in writing, software        #
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
14 # See the License for the specific language governing permissions and        #
15 # limitations under the License.                                             #
16 ##############################################################################
17 # This file defines a boot action for MaaS to deploy the calico-ip-rules script
18 # to nodes, register with systemd, and runs the script on all PXE booted nodes.
19 # On the genesis node, this is a manual step detailed in deployment documentation.
20
21 # NOTE: This is a copy from `aic-clcp-manifests/type/cruiser/v4.0/`, because
22 # this is an upstream manifest based on airship-treasuremap, which does not
23 # have bgp VIP configuration scripts.
24 schema: 'drydock/BootAction/v1'
25 metadata:
26   schema: 'metadata/Document/v1'
27   name: calico-ip-rules
28   storagePolicy: 'cleartext'
29   layeringDefinition:
30     abstract: false
31     layer: site
32   labels:
33     application: 'drydock'
34   substitutions:
35     - src:
36         schema: pegleg/CommonAddresses/v1
37         name: common-addresses
38         path: .calico.ip_rule.gateway
39       dest:
40         path: .assets[0].data
41         pattern: DH_SUB_GATEWAY_IP
42     - src:
43         schema: pegleg/CommonAddresses/v1
44         name: common-addresses
45         path: .kubernetes.pod_cidr
46       dest:
47         path: .assets[0].data
48         pattern: DH_SUB_POD_CIDR
49     - src:
50         schema: pegleg/CommonAddresses/v1
51         name: common-addresses
52         path: .calico.bgp.ipv4.public_service_cidr
53       dest:
54         path: .assets[0].data
55         pattern: DH_SUB_INGRESS_CIDR
56     # Substitution of the configure-ip-rules script into this bootaction
57     - src:
58         schema: pegleg/Script/v1
59         name: configure-ip-rules
60         path: .
61       dest:
62         path: .assets[1].data
63 data:
64   signaling: false
65   assets:
66     - path: /etc/systemd/system/configure-ip-rules.service
67       type: unit
68       permissions: '444'
69       data: |-
70         [Unit]
71         Description=IP Rules Initialization Service
72         After=network-online.target local-fs.target
73         [Service]
74         Type=simple
75         ExecStart=/opt/configure-ip-rules.sh -g DH_SUB_GATEWAY_IP -c DH_SUB_POD_CIDR -s DH_SUB_INGRESS_CIDR
76         [Install]
77         WantedBy=multi-user.target
78       data_pipeline:
79         - utf8_decode
80     - path: /opt/configure-ip-rules.sh
81       type: file
82       permissions: '700'
83       data_pipeline:
84         - utf8_decode
85 ...