...
1# Copyright 2020 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15apiVersion: osconfig.cnrm.cloud.google.com/v1beta1
16kind: OSConfigGuestPolicy
17metadata:
18 name: osconfigguestpolicy-sample
19spec:
20 description: An example OSConfigGuestPolicy for installing a web application on assigned instances.
21 assignment:
22 groupLabels:
23 - labels:
24 env: prod
25 app: web
26 - labels:
27 env: staging
28 app: web
29 instanceNamePrefixes:
30 - webappprod-
31 - webappstaging-
32 osTypes:
33 - osArchitecture: x86_64
34 osShortName: debian
35 osVersion: "10"
36 - osArchitecture: x86_64
37 osShortName: windows
38 osVersion: 10.0.14393
39 packageRepositories:
40 - apt:
41 archiveType: DEB
42 distribution: aiy-debian-buster
43 components:
44 - main
45 uri: https://packages.cloud.google.com/apt
46 gpgKey: https://packages.cloud.google.com/apt/dists/aiy-debian-buster/Release.gpg
47 - yum:
48 id: liamtest
49 displayName: Liam Test
50 baseUrl: https://packages.cloud.google.com/yum/repos/liamtest
51 gpgKeys:
52 - https://packages.cloud.google.com/yum/doc/yum-key.gpg
53 - https://packages.cloud.google.com/yum/doc/rpm-pkg-key.gpg
54 packages:
55 - desiredState: INSTALLED
56 manager: APT
57 name: add-apt-key
58 - desiredState: REMOVED
59 manager: YUM
60 name: ssl
61 - desiredState: UPDATED
62 manager: ANY
63 name: ansible-doc
64 recipes:
65 - name: latest-ansible
66 version: 1.0.0.1
67 artifacts:
68 - id: ansible
69 remote:
70 uri: https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz
71 allowInsecure: true
72 desiredState: INSTALLED
73 installSteps:
74 - fileCopy:
75 artifactId: ansible
76 destination: /installbackups/ansible
77 overwrite: true
78 permissions: "555"
79 - archiveExtraction:
80 destination: /var/ansible/
81 type: TAR_GZIP
82 artifactId: ansible
83 - name: prod-web-app
84 version: 2.5.27
85 artifacts:
86 - id: web-app
87 allowInsecure: false
88 gcs:
89 generation: 1829485032948520
90 object: latest/prod
91 bucketRef:
92 external: https://storage.googleapis.com/storage/v1/b/webapp
93 desiredState: UPDATED
94 installSteps:
95 - fileCopy:
96 overwrite: false
97 permissions: "777"
98 artifactId: web-app
99 destination: /installbackups/prod
100 - fileExec:
101 localPath: /installbackups/prod
102 allowedExitCodes:
103 - 0
104 args:
105 - prodcompile
106 updateSteps:
107 - fileCopy:
108 permissions: "755"
109 artifactId: web-app
110 destination: /installbackups/prod
111 - fileExec:
112 localPath: /installbackups/prod
113 allowedExitCodes:
114 - 0
115 - 4
116 args:
117 - updatecompile
View as plain text