11package com .batix .rundeck ;
22
33import com .dtolabs .rundeck .core .common .INodeSet ;
4+ import com .dtolabs .rundeck .core .utils .OptsUtil ;
45import com .dtolabs .utils .Streams ;
56import com .google .gson .JsonObject ;
67import com .google .gson .JsonParser ;
@@ -56,7 +57,7 @@ public static AnsibleRunner playbook(String playbook) {
5657 private final AnsibleCommand type ;
5758 private String module ;
5859 private String arg ;
59- private String extraArgs ;
60+ private String [] extraArgs ;
6061 private String playbook ;
6162 private final List <String > limits = new ArrayList <>();
6263 private int result ;
@@ -79,6 +80,14 @@ public AnsibleRunner limit(INodeSet nodes) {
7980 * Additional arguments to pass to the process
8081 */
8182 public AnsibleRunner extraArgs (String args ) {
83+ extraArgs = OptsUtil .burst (args );
84+ return this ;
85+ }
86+
87+ /**
88+ * Additional arguments to pass to the process
89+ */
90+ public AnsibleRunner extraArgs (String [] args ) {
8291 extraArgs = args ;
8392 return this ;
8493 }
@@ -130,8 +139,8 @@ public int run() throws Exception {
130139 procArgs .add ("@" + tempFile .getAbsolutePath ());
131140 }
132141
133- if (extraArgs != null && extraArgs .length () > 0 ) {
134- procArgs .add ( extraArgs );
142+ if (extraArgs != null && extraArgs .length > 0 ) {
143+ procArgs .addAll ( Arrays . asList ( extraArgs ) );
135144 }
136145
137146 Process proc = new ProcessBuilder ()
0 commit comments