@@ -75,10 +75,10 @@ func (t *AnsibleApp) Clear() {
7575}
7676
7777func (t * AnsibleApp ) InstallRequirements (args LocalAppInstallingArgs ) error {
78- if err := t .installCollectionsRequirements (); err != nil {
78+ if err := t .installCollectionsRequirements (args . EnvironmentVars ); err != nil {
7979 return err
8080 }
81- if err := t .installRolesRequirements (); err != nil {
81+ if err := t .installRolesRequirements (args . EnvironmentVars ); err != nil {
8282 return err
8383 }
8484 return nil
@@ -88,7 +88,7 @@ func (t *AnsibleApp) getRepoPath() string {
8888 return t .Repository .GetFullPath (t .Template .ID )
8989}
9090
91- func (t * AnsibleApp ) installGalaxyRequirementsFile (requirementsType GalaxyRequirementsType , requirementsFilePath string ) error {
91+ func (t * AnsibleApp ) installGalaxyRequirementsFile (requirementsType GalaxyRequirementsType , requirementsFilePath string , environmentVars [] string ) error {
9292 requirementsHashFilePath := fmt .Sprintf ("%s_%s.md5" , requirementsFilePath , requirementsType )
9393
9494 if _ , err := os .Stat (requirementsFilePath ); err != nil {
@@ -103,7 +103,7 @@ func (t *AnsibleApp) installGalaxyRequirementsFile(requirementsType GalaxyRequir
103103 "-r" ,
104104 requirementsFilePath ,
105105 "--force" ,
106- }); err != nil {
106+ }, environmentVars ); err != nil {
107107 return err
108108 }
109109 if err := writeMD5Hash (requirementsFilePath , requirementsHashFilePath ); err != nil {
@@ -129,46 +129,46 @@ const (
129129 GalaxyCollection GalaxyRequirementsType = "collection"
130130)
131131
132- func (t * AnsibleApp ) installRolesRequirements () (err error ) {
132+ func (t * AnsibleApp ) installRolesRequirements (environmentVars [] string ) (err error ) {
133133 // default roles path
134- err = t .installGalaxyRequirementsFile (GalaxyRole , path .Join (t .GetPlaybookDir (), "roles" , "requirements.yml" ))
134+ err = t .installGalaxyRequirementsFile (GalaxyRole , path .Join (t .GetPlaybookDir (), "roles" , "requirements.yml" ), environmentVars )
135135 if err != nil {
136136 return
137137 }
138- err = t .installGalaxyRequirementsFile (GalaxyRole , path .Join (t .GetPlaybookDir (), "requirements.yml" ))
138+ err = t .installGalaxyRequirementsFile (GalaxyRole , path .Join (t .GetPlaybookDir (), "requirements.yml" ), environmentVars )
139139 if err != nil {
140140 return
141141 }
142142
143143 // alternative roles path
144- err = t .installGalaxyRequirementsFile (GalaxyRole , path .Join (t .getRepoPath (), "roles" , "requirements.yml" ))
144+ err = t .installGalaxyRequirementsFile (GalaxyRole , path .Join (t .getRepoPath (), "roles" , "requirements.yml" ), environmentVars )
145145 if err != nil {
146146 return
147147 }
148- err = t .installGalaxyRequirementsFile (GalaxyRole , path .Join (t .getRepoPath (), "requirements.yml" ))
148+ err = t .installGalaxyRequirementsFile (GalaxyRole , path .Join (t .getRepoPath (), "requirements.yml" ), environmentVars )
149149 return
150150}
151151
152- func (t * AnsibleApp ) installCollectionsRequirements () (err error ) {
152+ func (t * AnsibleApp ) installCollectionsRequirements (environmentVars [] string ) (err error ) {
153153 // default collections path
154- err = t .installGalaxyRequirementsFile (GalaxyCollection , path .Join (t .GetPlaybookDir (), "collections" , "requirements.yml" ))
154+ err = t .installGalaxyRequirementsFile (GalaxyCollection , path .Join (t .GetPlaybookDir (), "collections" , "requirements.yml" ), environmentVars )
155155 if err != nil {
156156 return
157157 }
158- err = t .installGalaxyRequirementsFile (GalaxyCollection , path .Join (t .GetPlaybookDir (), "requirements.yml" ))
158+ err = t .installGalaxyRequirementsFile (GalaxyCollection , path .Join (t .GetPlaybookDir (), "requirements.yml" ), environmentVars )
159159 if err != nil {
160160 return
161161 }
162162
163163 // alternative collections path
164- err = t .installGalaxyRequirementsFile (GalaxyCollection , path .Join (t .getRepoPath (), "collections" , "requirements.yml" ))
164+ err = t .installGalaxyRequirementsFile (GalaxyCollection , path .Join (t .getRepoPath (), "collections" , "requirements.yml" ), environmentVars )
165165 if err != nil {
166166 return
167167 }
168- err = t .installGalaxyRequirementsFile (GalaxyCollection , path .Join (t .getRepoPath (), "requirements.yml" ))
168+ err = t .installGalaxyRequirementsFile (GalaxyCollection , path .Join (t .getRepoPath (), "requirements.yml" ), environmentVars )
169169 return
170170}
171171
172- func (t * AnsibleApp ) runGalaxy (args []string ) error {
173- return t .Playbook .RunGalaxy (args )
172+ func (t * AnsibleApp ) runGalaxy (args []string , environmentVars [] string ) error {
173+ return t .Playbook .RunGalaxy (args , environmentVars )
174174}
0 commit comments