|
4 | 4 | "encoding/json" |
5 | 5 | "fmt" |
6 | 6 | "sort" |
7 | | - "strings" |
8 | 7 |
|
9 | 8 | "github.com/openstack-k8s-operators/lib-common/modules/storage" |
10 | 9 | yaml "gopkg.in/yaml.v3" |
@@ -37,9 +36,6 @@ type EEJob struct { |
37 | 36 | // ServiceAccountName allows to specify what ServiceAccountName do we want the ansible execution run with. Without specifying, |
38 | 37 | // it will run with default serviceaccount |
39 | 38 | ServiceAccountName string `json:"serviceAccountName,omitempty"` |
40 | | - // Inventory is the primary inventory that the ansible playbook will use to launch the job. |
41 | | - // Further inventories may be provided as ExtraMount in the `/runner/inventory/` path. |
42 | | - Inventory string `json:"inventory,omitempty"` |
43 | 39 | // Args are the command plus the playbook executed by the image. If args is passed, Playbook is ignored. |
44 | 40 | Args []string `json:"args,omitempty"` |
45 | 41 | // NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network |
@@ -152,32 +148,6 @@ func (a *EEJob) JobForOpenStackAnsibleEE(h *helper.Helper) (*batchv1.Job, error) |
152 | 148 | if len(a.ServiceAccountName) > 0 { |
153 | 149 | job.Spec.Template.Spec.ServiceAccountName = a.ServiceAccountName |
154 | 150 | } |
155 | | - // Set primary inventory if specified as string |
156 | | - existingInventoryMounts := "" |
157 | | - if len(a.Inventory) > 0 { |
158 | | - setRunnerEnvVar(h, "RUNNER_INVENTORY", a.Inventory, "inventory", job, hashes) |
159 | | - existingInventoryMounts = CustomInventory |
160 | | - } |
161 | | - // Report additional inventory paths mounted as volumes |
162 | | - // AnsibleEE will later attempt to use them all together with the primary |
163 | | - // If any of the additional inventories uses location of the primary inventory |
164 | | - // provided by the dataplane operator raise an error. |
165 | | - if len(a.ExtraMounts) > 0 { |
166 | | - for _, inventory := range a.ExtraMounts { |
167 | | - for _, mount := range inventory.Mounts { |
168 | | - // Report when we mount other inventories as that alters ansible execution |
169 | | - if strings.HasPrefix(mount.MountPath, "/runner/inventory/") { |
170 | | - h.GetLogger().Info(fmt.Sprintf("additional inventory %s mounted", mount.Name)) |
171 | | - if searchIndex := strings.Index(existingInventoryMounts, mount.MountPath); searchIndex != -1 { |
172 | | - return nil, fmt.Errorf( |
173 | | - "inventory mount %s overrides existing inventory location", |
174 | | - mount.Name) |
175 | | - } |
176 | | - existingInventoryMounts = existingInventoryMounts + fmt.Sprintf(",%s", mount.MountPath) |
177 | | - } |
178 | | - } |
179 | | - } |
180 | | - } |
181 | 151 |
|
182 | 152 | if len(a.Role) > 0 { |
183 | 153 | setRunnerEnvVar(h, "RUNNER_ROLE", a.Role, "role", job, hashes) |
|
0 commit comments