Containerization feature of SO
[so.git] / asdc-controller / src / test / resources / resource-examples / multipleModules / user_data_zrdm5bpxmc02vmt001.txt
1 #cloud-config
2 # \hbrief   cloud-init main template for MSP config
3 # \hversion 0.0.11
4 # \hdate    2016-05-09
5 # \brief   cloud-init template for MSP config
6 # \version 0.2.57
7 # \date    2016-09-19
8 # Configuration created for MSP SLES_12 VMT
9
10 chpasswd:
11  list: |
12   root:Ericsson
13   miepadm:miep1234
14
15  expire: False
16
17 users:
18
19 bootcmd:
20
21  - [ sh, -xc, "echo \"#################################################################\" > /etc/issue.ci" ]
22  - [ sh, -xc, "echo \"#                                                               #\" >> /etc/issue.ci" ]
23  - [ sh, -xc, "echo \"#     * * *  Cloud-init configuration is in progress  * * *     #\" >> /etc/issue.ci" ]
24  - [ sh, -xc, "echo \"#                                                               #\" >> /etc/issue.ci" ]
25  - [ sh, -xc, "echo \"#     The system will reboot shortly and then be accessible     #\" >> /etc/issue.ci" ]
26  - [ sh, -xc, "echo \"#                                                               #\" >> /etc/issue.ci" ]
27  - [ sh, -xc, "echo \"#################################################################\" >> /etc/issue.ci" ]
28  - [ sh, -xc, "if [ -f /etc/issue.orig ]; then cp /etc/issue.orig /etc/issue; fi" ]
29  - [ sh, -xc, "if [ ! -f /etc/issue.orig ]; then cp /etc/issue /etc/issue.orig; cp /etc/issue.ci /etc/issue; fi" ]
30  - [ sh, -xc, "/bin/sed -i 's/^DHCLIENT_SET_DEFAULT_ROUTE=\"yes\".*/DHCLIENT_SET_DEFAULT_ROUTE=\"no\"/' /etc/sysconfig/network/dhcp" ]
31  - [ sh, -xc, "/bin/sed -i 's/^NETCONFIG_DNS_POLICY=.*/NETCONFIG_DNS_POLICY=\"STATIC\"/' /etc/sysconfig/network/config" ]
32
33 runcmd:
34  - [ sh, -xc, "chage -M 99999 root;rm -f /etc/shadow-" ]
35  - [ sh, -xc, "chage -M 99999 miepadm;rm -f /etc/shadow-" ]
36  - [ sh, -xc, "sed -i 's/^ListenAddress.*/ListenAddress 107.112.138.71/' /etc/ssh/sshd_config" ]
37  - [ sh, -xc, "sed -i 's/^ClientAliveCountMax.*/ClientAliveCountMax 300/g' /etc/ssh/sshd_config" ]
38  - [ sh, -xc, "sed -i 's/^ClientAliveInterval.*/ClientAliveInterval 10/g' /etc/ssh/sshd_config" ]
39  - [ sh, -xc, "sed -i '/PermitRootLogin/d' /etc/ssh/sshd_config" ]
40  - [ sh, -xc, "echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config" ]
41  - [ sh, -xc, "sed -i '/KexAlgorithms/s/^/# /' /etc/ssh/sshd_config" ]
42  - [ sh, -xc, "mkdir /opt/miep/tools/miit/www/sles" ]
43  - [ sh, -xc, "rm -f /etc/sysconfig/network/ifcfg-eth1" ]
44  - [ sh, -xc, "mkdir /shared_nfs_datastore" ]
45  - [ sh, -xc, "mount -t ext4 /dev/vdb /shared_nfs_datastore" ]
46  - [ sh, -xc, "mkdir -p /shared_nfs_datastore/miit" ]
47  - [ sh, -xc, "cp -pr /opt/miep/tools/miit/* /shared_nfs_datastore/miit" ]
48  - [ sh, -xc, "rm -rf /opt/miep/tools/miit" ]
49  - [ sh, -xc, "rm -f /etc/udev/rules.d/70-persistent-net.rules" ]
50  - [ sh, -xc, "ln -s /shared_nfs_datastore/miit /opt/miep/tools/miit" ]
51  - [ sh, -xc, "chown -R miepadm:miepgrp /shared_nfs_datastore/miit" ]
52  - [ sh, -xc, "chown -R miepadm:miepgrp /opt/miep/tools/miit" ]
53  - [ sh, -xc, "mkdir -p /opt/miep/tools/miit/www/sles" ]
54  - [ sh, -xc, "mount -o loop /shared_nfs_datastore/SLE-12-SP1-Server-DVD-x86_64-GM-DVD1.iso /opt/miep/tools/miit/www/sles" ]
55  - [ sh, -xc, "/usr/bin/zypper ar /opt/miep/tools/miit/www/sles nfsrpms" ]
56  - [ sh, -xc, "/usr/bin/zypper lr" ]
57  - [ sh, -xc, "/usr/bin/zypper --non-interactive install -y nfs-kernel-server" ]
58  - [ sh, -xc, "/usr/bin/zypper --non-interactive install -y expect" ]
59  - [ sh, -xc, "/usr/bin/zypper --non-interactive install -y dos2unix" ]
60  - [ sh, -xc, "echo '//shared_nfs_datastore 107.112.136.0/21(rw,no_root_squash,sync,subtree_check)' >> /etc/exports" ]
61  - [ sh, -xc, "echo '/dev/vdb /shared_nfs_datastore ext4 acl 1 1' >> /etc/fstab" ]
62  - [ sh, -xc, "echo '@reboot /var/tmp/hostnamefix.sh > /var/tmp/hostnamefix.log' | /usr/bin/crontab -u root -" ]
63  - [ sh, -xc, "systemctl enable nfsserver.service" ]
64  - [ sh, -xc, "systemctl enable rpcbind.service" ]
65  - [ sh, -xc, "systemctl enable apache2.service" ]
66  - [ sh, -xc, "chkconfig mount_sles on" ]
67  - [ sh, -xc, "resize2fs /dev/vdb 200G" ]
68  - [ sh, -xc, "sed -i 's/PASS_MAX_DAYS   60/PASS_MAX_DAYS   99999/' /etc/login.defs" ]
69  - [ sh, -xc, "sleep 61s" ]
70  - [ sh, -xc, "su - miepadm -c \"ssh-keygen -t rsa -q -N '' -f ~/.ssh/id_rsa\"" ]
71
72 timezone: 'PST8PDT'
73
74 write_files:
75  - content: |
76     H4sIANk1vFkAA41Sy27bMBC88ysW8TViKaWNC92MAkV9KOIi+QFKWllE+RBIyo9+fZeW7DqxDHR10c4OZ3aXXEDnQgxwjrdOBWiVRmgw1F5VGECCHUyFHlx7YltpMIsuk03jMQS2gPdhZN8ruyUd5yF2CG/fNp/WGwhDFY4houEA6whkZEhNH28EhoANyAiVcxGiMvgI+w4tWAfJGwL6HXpqzCP4wVoy4zciLxaCkVrD6BkeqZXzbLW0UOHooyyVZZOGkzciD8mvebi2TU6vRxvloWQL+l9vstW4CIDvg9bZr0Fq1Spssh/TsgBeO+fjJadzLC+WXNCXT07a1VKn7V7ybcoYOYQeayU1Oe2eYVo6BlaW+exJ1e+esytwyl1fyfo3Yy0KUZbiimaRbNr2Cja1DLH32KpDKhTJ6lSgfVpHL2NCiwvq3RDpSib86YKfXhdLU2QzAS+rn2msz7A6jzXLo3WJJc/zgudPX/lSAPzxjflS9QdTi8IYK0TO97Lf7rlxFd1w3zmLnAabY85hmZPmHn5PeWS8b+2D+M7E/2xtZM5ht639w+8pjwzG/gJrL8X/3wMAAA==
77    path: /etc/hosts
78    owner: root:root
79    permissions: '0644'
80    encoding: 'gzip+base64'
81  - content: |
82     ################################################################################
83     ## /etc/ntp.conf
84     ##
85     ## Sample NTP configuration file.
86     ## See package 'ntp-doc' for documentation, Mini-HOWTO and FAQ.
87     ## Copyright (c) 1998 S.u.S.E. GmbH Fuerth, Germany.
88     ##
89     ## Author: Michael Andres,  <ma@suse.de>
90     ##         Michael Skibbe,  <mskibbe@suse.de>
91     ##
92     ################################################################################
93     
94     ##
95     ## Radio and modem clocks by convention have addresses in the 
96     ## form 127.127.t.u, where t is the clock type and u is a unit 
97     ## number in the range 0-3. 
98     ##
99     ## Most of these clocks require support in the form of a 
100     ## serial port or special bus peripheral. The particular  
101     ## device is normally specified by adding a soft link 
102     ## /dev/device-u to the particular hardware device involved, 
103     ## where u correspond to the unit number above. 
104     ## 
105     ## Generic DCF77 clock on serial port (Conrad DCF77)
106     ## Address:     127.127.8.u
107     ## Serial Port: /dev/refclock-u
108     ##  
109     ## (create soft link /dev/refclock-0 to the particular ttyS?)
110     ##
111     # server 127.127.8.0 mode 5 prefer
112     server 135.144.38.211 prefer
113     server 155.165.201.253 prefer
114     
115     ##
116     ## Undisciplined Local Clock. This is a fake driver intended for backup
117     ## and when no outside source of synchronized time is available.
118     ##
119     server 127.127.1.0              # local clock (LCL)
120     fudge  127.127.1.0 stratum 10   # LCL is unsynchronized
121     
122     ##
123     ## Add external Servers using
124     ## # rcntp addserver <yourserver>
125     ## 
126     
127     ##
128     ## Miscellaneous stuff
129     ##
130     
131     driftfile /var/lib/ntp/drift/ntp.drift # path for drift file
132     
133     logfile   /var/log/ntp          # alternate log file
134     # logconfig =syncstatus + sysevents
135     # logconfig =all
136     
137     # statsdir /tmp/                # directory for statistics files
138     # filegen peerstats  file peerstats  type day enable
139     # filegen loopstats  file loopstats  type day enable
140     # filegen clockstats file clockstats type day enable
141     
142     #
143     # Authentication stuff
144     #
145     keys /etc/ntp.keys              # path for keys file
146     trustedkey 1                    # define trusted keys
147     requestkey 1                    # key (7) for accessing server variables
148     controlkey 1
149     
150     #  by default act only as a basic NTP client
151     restrict default kod nomodify notrap nopeer noquery
152     restrict -6 default kod nomodify notrap nopeer noquery
153     #
154     #  allow NTP messages only from the loopback
155     restrict 127.0.0.1
156     restrict  ::1
157    path: /etc/ntp.conf
158    owner: root:root
159    permissions: '0640'
160  - content: |
161     default 107.112.136.1 - -
162    path: /etc/sysconfig/network/routes
163    owner: root:root
164    permissions: '0644'
165  - content: |
166     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
167     <trapDestCfg xmlns="http://www.ericsson.com/esa">
168         <managerDefinition snmpVersion="v2c" active="yes">
169             <ip>107.239.72.10</ip>
170             <port>162</port>
171             <securityName>v1v2ReadWriteSecName</securityName>
172             <securityLevel>noAuthNoPriv</securityLevel>
173         </managerDefinition>
174         <managerDefinition snmpVersion="v2c" active="yes">
175             <ip>135.207.171.152</ip>
176             <port>162</port>
177             <securityName>v1v2ReadWriteSecName</securityName>
178             <securityLevel>noAuthNoPriv</securityLevel>
179         </managerDefinition>
180     </trapDestCfg>
181    path: /opt/miep/tools/AttMspCust/CloudInit/trapDestCfg.xml
182    owner: root:root
183    permissions: '0755'
184  - content: |
185     BOOTPROTO='static'
186     IPADDR='107.112.138.71'
187     BROADCAST='107.112.143.255'
188     NETMASK='255.255.248.0'
189     NETWORK='107.112.136.0'
190     STARTMODE='onboot'
191     DEVICE='eth0'
192     USERCONTROL='no'
193     NAME='OAM'
194     DEFROUTE='yes'
195     CHECK_DUPLICATE_IP='yes'
196     SEND_GRATUITOUS_ARP='yes'
197    path: /etc/sysconfig/network/ifcfg-eth0
198    owner: root:root
199    permissions: '0644'
200  - content: |
201    path: /etc/udev/rules.d/10-local.rules
202    encoding: b64
203    owner: root:root
204    permissions: '0640'
205  - content: |
206     #!/bin/bash
207     ### BEGIN INIT INFO
208     # Provides:        mount_sles
209     # Required-Start:  network
210     # Required-Stop:   network
211     # Should-Start:
212     # Should-Stop:
213     # Default-Start:  3 5
214     # Default-Stop:   0 1 2 6
215     # Short-Description: Mount SLES iso file
216     ### END INIT INFO
217     echo Mount SLES ISO image
218     mount -o loop /shared_nfs_datastore/SLE-12-SP1-Server-DVD-x86_64-GM-DVD1.iso /opt/miep/tools/miit/www/sles
219    path: /etc/init.d/mount_sles
220    owner: root:root
221    permissions: '0755'
222  - content: |
223     grep -qs preserve_hostname /etc/cloud/cloud.cfg
224     if [ $? -eq 0 ] ; then
225       sed -i 's/preserve_hostname: .*/preserve_hostname: true/' /etc/cloud/cloud.cfg
226     fi
227
228     /bin/hostname | grep -qs novalocal
229     if [ $? -eq 0 ] ; then
230       newHostname=$(/bin/hostname | sed -e 's/.novalocal//')
231       hostnamectl set-hostname $newHostname
232     fi
233     /usr/bin/crontab -u root -l | grep -v hostnamefix.sh | /usr/bin/crontab -u root - 
234    path: /var/tmp/hostnamefix.sh
235    owner: root:root
236    permissions: '0755'
237  - content: |
238     ### /etc/resolv.conf file autogenerated by netconfig!
239     #
240     # Before you change this file manually, consider to define the
241     # static DNS configuration using the following variables in the
242     # /etc/sysconfig/network/config file:
243     #     NETCONFIG_DNS_STATIC_SEARCHLIST
244     #     NETCONFIG_DNS_STATIC_SERVERS
245     #     NETCONFIG_DNS_FORWARDER
246     # or disable DNS configuration updates via netconfig by setting:
247     #     NETCONFIG_DNS_POLICY=''
248     #
249     # See also the netconfig(8) manual page and other documentation.
250     #
251     # Note: Manual change of this file disables netconfig too, but
252     # may get lost when this file contains comments or empty lines
253     # only, the netconfig settings are same with settings in this
254     # file and in case of a "netconfig update -f" call.
255     #
256     ### Please remove (at least) this line when you modify the file!
257     nameserver 155.165.194.100
258     nameserver 155.165.201.100
259     search wapgw.mobilephone.net
260     options attempts:1
261     options timeout:6
262    path: /etc/resolv.conf
263    owner: root:root
264    permissions: '0644'
265  - content: |
266     *.* @135.207.171.57:1538
267     *.* @155.165.162.48:1532
268    path: /etc/rsyslog.d/remote.conf
269    owner: root:root
270    permissions: '0600'
271  - content: |
272     H4sIANjbQlkAA5WUUW/aMBSF3/0rjqKgtEyUlodNYmonSulaCQqCqnsYE0kTByyCHcWGjAH/fU5CWqJB1PEC5J6c+/n42qTb/37/2O1cG1I5aindGXXnE9tzFIX1qbKoeJV1rfJQ6VVGln0RiKlBCHVnwmMyDJz12TnZpP9R0/qxsswr0xpzC8ieGqmT3YR5ZeDmBuZm329HdoRkLdtJyzejvTGMavJJa4xP4YsIK+8VujxPK5ojZX25u722PR+12XYa0TARbZ14DmsTRowrmJ93VlaRMyei3oT7cqKhHKlERG1CmI+fML+hxiku8QtfoWaUEwAFnLw54AkquaVAfzOppEFoIGki14qJZH9oOU5jZ9mnzTNPONxLKOAEgXB1gB4SYwj/LQMwCTPvaID4jByJr+oe5vd0P4LPAirXUtFFdR9jKtGlAnYgRHh5IkfjWJDj+oIxNa7HcTyuS93DsHE62gJpEetUvGWv5NITIVTDSLhUSozSeSsu3JeSRivm6m3b/wDPntEI2YDul91yFVvRJpz0G2e6q96Z848vtDMc9ofNA3u9h56I+fE1FmTLMFtdyjwctG8fn+7egaPQfWV6ZEpxoyXnehI0b8nMH+PN3UtpD0QF1tag1X7oNN5ZndDRhcbHWf8PNrcvhT0Q5bBlZ+el9wy9D5IJns9OQQ8jUYx+5KLE19bHFnURKn0uaFjvjQZfLq4mz/1+d1TFFtmFFO9f2OKfK8IgO5DCDUnIX5FnXVGsBQAA
273    path: /opt/miep/tools/miit/vmtTools/statusCheck.sh
274    owner: miepadm:miepgrp
275    permissions: '0755'
276    encoding: 'gzip+base64'
277  - content: |
278     H4sIAKm9hFkAA9VWbW/aMBD+3PyKUxSUrVPiUama1CmdEOsLEqxodPvSVmAlBqwmcRQfUKj632c7EKCMDrVVtX6AxM69PM/d2XfNi7N27fI8sInIkCScZQSFiKV65UjGCV7qlW31eczaFIdKcExzgklGHMmRpTRhtpUzOYoxsFNxkuciV/JMUp5KpHFMkYs0sPs0lkrSAt6HK/BmYDtVG27gK+CQpRYAsHAowNZGOwxHGfySdMCOfFLu+HIIVwunN3BVQ2x12uFIYkbDWyV8Y4MxdMcRqhYw5VGvFyqBU11ddodCogxKGm6x4RobzYuz00bzJLDLz57UGLxeRJGB+6mSVKLK1KucV1qVjtvzYzEovJ90aqXy79alp9ZPKlnQ52thOXijsFAjV1/KBc4BFGgsS3uNuMxiOv3w0bo3a/AUh2t0narjXqcuQLFrG3a9I9AJPT4G575ZFNUDMa86FA/Ww6pJVR3brO5gcxlhbdaaibQIhDEJyW3Ec/Ay+GtFTyaTZeESHSSReLq45XL7+ZokkTRkOUpLBTJUEDbOCnE2wv4CdzrVMtO2fBzM5kXkfAMvZfB5pYpWQq8KbBNBJJhMXdQlok5AUZIQRi9ApvgjzeFu3J+9Gj/wSVud0EbK8flUuYRUIFAY05hHBqT2qjgvLjGmr7B5DKxtadz3dZ5fpVJ2YQJ2q1MD49IY2szYOnqYp3ALdp4iy0Na/W/xPw0/FwJD+i7B37KpQpSz/XeJ3lnvnc/nsCv0xw53KnuFfigmKXg/QWOjUXKkn4N8l56glRMRaeUvh4c7KRgqtlNAsSGABZott1JHaULRzEORZDFDFsGE4xDYfHoyPXpPPR5PUZiP9FX1b3NyFIZMyv4ojqdFWED3SmWwsWLQdEyrZPDInaFiPK4NJOr3otawuMOJMqQcl/1aDUvd+sWP08YZHByTiI1JqtAXfmFvOQrNCfB0oGctEKnWBMWbSgYTytH3i4En3Mz3sqGQeixGkcGBOc2+M4n1/sC/S+LXoLbkolkWrVB1QjVPd8OyW4NqaPN4d/UXFX49yz0x7kAZhR5SHoNX3Sra07I668XfW54I1TXX5rLHVWf9AdB7+rd1DAAA
279    path: /opt/miep/tools/miit/vmtTools/siteSetup.sh
280    owner: miepadm:miepgrp
281    permissions: '0755'
282    encoding: 'gzip+base64'
283
284 scripts_per_once:
285
286 power_state:
287  mode: reboot
288  message: Server will reboot now
289  timeout: 5