@@ -96,7 +96,7 @@ def self.it_should_set_arguments_and_environment_variables(
9696 expect ( args [ 1 ] ) . to eq ( "--connection=ssh" )
9797 expect ( args [ 2 ] ) . to eq ( "--timeout=30" )
9898
99- inventory_count = args . count { |x | x . match ( /^--inventory-file =.+$/ ) if x . is_a? ( String ) }
99+ inventory_count = args . count { |x | x . match ( /^--inventory=.+$/ ) if x . is_a? ( String ) }
100100 expect ( inventory_count ) . to be > 0
101101
102102 expect ( args [ args . length -2 ] ) . to eq ( "playbook.yml" )
@@ -200,9 +200,9 @@ def self.it_should_create_and_use_generated_inventory(with_user = true)
200200
201201 it "sets as ansible inventory the directory containing the auto-generated inventory file" do
202202 expect ( Vagrant ::Util ::Subprocess ) . to receive ( :execute ) . with ( 'ansible-playbook' , any_args ) { |*args |
203- inventory_index = args . rindex ( "--inventory-file =#{ generated_inventory_dir } " )
203+ inventory_index = args . rindex ( "--inventory=#{ generated_inventory_dir } " )
204204 expect ( inventory_index ) . to be > 0
205- expect ( find_last_argument_after ( inventory_index , args , /--inventory-file =\w +/ ) ) . to be ( false )
205+ expect ( find_last_argument_after ( inventory_index , args , /--inventory=\w +/ ) ) . to be ( false )
206206 } . and_return ( default_execute_result )
207207 end
208208 end
@@ -621,7 +621,7 @@ def ensure_that_config_is_valid
621621 "-l localhost" ,
622622 "--limit=foo" ,
623623 "--limit=bar" ,
624- "--inventory-file =/forget/it/my/friend" ,
624+ "--inventory=/forget/it/my/friend" ,
625625 "--user=lion" ,
626626 "--new-arg=yeah" ]
627627 end
@@ -639,7 +639,7 @@ def ensure_that_config_is_valid
639639 it "sets raw arguments after arguments related to supported options" do
640640 expect ( Vagrant ::Util ::Subprocess ) . to receive ( :execute ) . with ( 'ansible-playbook' , any_args ) { |*args |
641641 expect ( args . index ( "--user=lion" ) ) . to be > args . index ( "--user=testuser" )
642- expect ( args . index ( "--inventory-file =/forget/it/my/friend" ) ) . to be > args . index ( "--inventory-file =#{ generated_inventory_dir } " )
642+ expect ( args . index ( "--inventory=/forget/it/my/friend" ) ) . to be > args . index ( "--inventory=#{ generated_inventory_dir } " )
643643 expect ( args . index ( "--limit=bar" ) ) . to be > args . index ( "--limit=all" )
644644 expect ( args . index ( "--skip-tags=ignored" ) ) . to be > args . index ( "--skip-tags=foo,bar" )
645645 } . and_return ( default_execute_result )
@@ -736,8 +736,8 @@ def ensure_that_config_is_valid
736736
737737 it "does not generate the inventory and uses given inventory path instead" do
738738 expect ( Vagrant ::Util ::Subprocess ) . to receive ( :execute ) . with ( 'ansible-playbook' , any_args ) { |*args |
739- expect ( args ) . to include ( "--inventory-file =#{ existing_file } " )
740- expect ( args ) . not_to include ( "--inventory-file =#{ generated_inventory_file } " )
739+ expect ( args ) . to include ( "--inventory=#{ existing_file } " )
740+ expect ( args ) . not_to include ( "--inventory=#{ generated_inventory_file } " )
741741 expect ( File . exist? ( generated_inventory_file ) ) . to be ( false )
742742 } . and_return ( default_execute_result )
743743 end
@@ -912,7 +912,7 @@ def ensure_that_config_is_valid
912912
913913 it "shows the ansible-playbook command and set verbosity to '-#{ verbose_option } ' level" do
914914 expect ( machine . env . ui ) . to receive ( :detail )
915- . with ( "PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\" machine1\" --inventory-file =#{ generated_inventory_dir } -#{ verbose_option } playbook.yml" )
915+ . with ( "PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\" machine1\" --inventory=#{ generated_inventory_dir } -#{ verbose_option } playbook.yml" )
916916 end
917917 end
918918
@@ -926,7 +926,7 @@ def ensure_that_config_is_valid
926926
927927 it "shows the ansible-playbook command and set verbosity to '-#{ verbose_option } ' level" do
928928 expect ( machine . env . ui ) . to receive ( :detail )
929- . with ( "PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\" machine1\" --inventory-file =#{ generated_inventory_dir } -#{ verbose_option } playbook.yml" )
929+ . with ( "PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\" machine1\" --inventory=#{ generated_inventory_dir } -#{ verbose_option } playbook.yml" )
930930 end
931931 end
932932 end
@@ -941,7 +941,7 @@ def ensure_that_config_is_valid
941941
942942 it "shows the ansible-playbook command and set verbosity to '-v' level" do
943943 expect ( machine . env . ui ) . to receive ( :detail )
944- . with ( "PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\" machine1\" --inventory-file =#{ generated_inventory_dir } -v playbook.yml" )
944+ . with ( "PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --limit=\" machine1\" --inventory=#{ generated_inventory_dir } -v playbook.yml" )
945945 end
946946 end
947947
@@ -1172,7 +1172,7 @@ def ensure_that_config_is_valid
11721172
11731173 it "shows the ansible-playbook command, with additional quotes when required" do
11741174 expect ( machine . env . ui ) . to receive ( :detail )
1175- . with ( %Q(PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_ROLES_PATH='/up/to the stars' ANSIBLE_CONFIG='#{ existing_file } ' ANSIBLE_HOST_KEY_CHECKING=true ANSIBLE_SSH_ARGS='-o IdentitiesOnly=yes -o IdentityFile=/my/key1 -o IdentityFile=/my/key2 -o ForwardAgent=yes -o ControlMaster=no -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --ask-sudo-pass --ask-vault-pass --limit="machine*:&vagrant:!that_one" --inventory-file =#{ generated_inventory_dir } --extra-vars=\\ {\\ "var1\\ ":\\ "string\\ with\\ \\ 'apo\\ $trophe\\ $\\ ',\\ \\ \\ \\ \\ ,\\ \\ \\ \\ "\\ and\\ \\ =\\ ",\\ "var2\\ ":\\ {\\ "x\\ ":42\\ }\\ } --sudo --sudo-user=deployer -vvv --vault-password-file=#{ existing_file } --tags=db,www --skip-tags=foo,bar --start-at-task="joe's awesome task" --why-not --su-user=foot --ask-su-pass --limit=all --private-key=./myself.key --extra-vars='{\" var3\" :\" foo\" }' playbook.yml) )
1175+ . with ( %Q(PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ANSIBLE_ROLES_PATH='/up/to the stars' ANSIBLE_CONFIG='#{ existing_file } ' ANSIBLE_HOST_KEY_CHECKING=true ANSIBLE_SSH_ARGS='-o IdentitiesOnly=yes -o IdentityFile=/my/key1 -o IdentityFile=/my/key2 -o ForwardAgent=yes -o ControlMaster=no -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --connection=ssh --timeout=30 --ask-sudo-pass --ask-vault-pass --limit="machine*:&vagrant:!that_one" --inventory=#{ generated_inventory_dir } --extra-vars=\\ {\\ "var1\\ ":\\ "string\\ with\\ \\ 'apo\\ $trophe\\ $\\ ',\\ \\ \\ \\ \\ ,\\ \\ \\ \\ "\\ and\\ \\ =\\ ",\\ "var2\\ ":\\ {\\ "x\\ ":42\\ }\\ } --sudo --sudo-user=deployer -vvv --vault-password-file=#{ existing_file } --tags=db,www --skip-tags=foo,bar --start-at-task="joe's awesome task" --why-not --su-user=foot --ask-su-pass --limit=all --private-key=./myself.key --extra-vars='{\" var3\" :\" foo\" }' playbook.yml) )
11761176 end
11771177 end
11781178
0 commit comments