Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Asm/Ansible/Command/AnsiblePlaybook.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function diff(): AnsiblePlaybookInterface
*
* Example:
* ```php
* $ansible = new Ansible()->playbook()->extraVars('/path/to/extra/vars.yml');
* $ansible = new Ansible()->playbook()->extraVars('@"/path/to/extra/vars.yml"');
* ```
*
* ## String
Expand Down Expand Up @@ -210,8 +210,8 @@ public function extraVars(string|array $extraVars = ''): AnsiblePlaybookInterfac
throw new InvalidArgumentException(sprintf('Expected string|array, got "%s"', gettype($extraVars)));
}

if (!str_contains($extraVars, '=')) {
throw new InvalidArgumentException('The extra vars raw string should be in the "key=value" form.');
if (!str_contains($extraVars, '=') && !str_starts_with($extraVars, '@')) {
throw new InvalidArgumentException('The extra vars raw string should either be in the "key=value" form or be a file path starting with @.');
}

$this->addOption('--extra-vars', $extraVars);
Expand Down