File tree 1 file changed +15
-11
lines changed
1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change 118
118
119
119
# }}}
120
120
121
+ def provision_ansible ( node , host , groups )
122
+ ansible_mode = run_locally? ? 'ansible_local' : 'ansible'
123
+ node . vm . provision ansible_mode do |ansible |
124
+ ansible . compatibility_mode = '2.0'
125
+ if ! groups . nil?
126
+ ansible . groups = groups
127
+ end
128
+ ansible . playbook = host . key? ( 'playbook' ) ?
129
+ "ansible/#{ host [ 'playbook' ] } " :
130
+ "ansible/site.yml"
131
+ ansible . become = true
132
+ end
133
+ end
134
+
121
135
Vagrant . configure ( VAGRANTFILE_API_VERSION ) do |config |
122
136
config . ssh . insert_key = false
123
137
hosts . each do |host |
@@ -142,17 +156,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
142
156
end
143
157
144
158
# Ansible provisioning
145
- ansible_mode = run_locally? ? 'ansible_local' : 'ansible'
146
- node . vm . provision ansible_mode do |ansible |
147
- ansible . compatibility_mode = '2.0'
148
- if ! groups . nil?
149
- ansible . groups = groups
150
- end
151
- ansible . playbook = host . key? ( 'playbook' ) ?
152
- "ansible/#{ host [ 'playbook' ] } " :
153
- "ansible/site.yml"
154
- ansible . become = true
155
- end
159
+ provision_ansible ( node , host , groups )
156
160
end
157
161
end
158
162
end
You can’t perform that action at this time.
0 commit comments