Created
September 12, 2021 14:50
-
-
Save zeitounator/e3ea522a8129562d1b4f8f215ff023a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat test.yml | |
--- | |
- hosts: localhost | |
gather_facts: false | |
vars: | |
my_user_name: toto | |
my_password: with$sign | |
tasks: | |
- set_fact: | |
win_shell: "invoke-sqlcmd -username \"{{my_user_name}}\" -password \"{{my_password}}\" -Query \"CREATE TABLE TempLogs (Command varchar(255), Paramenter varchar(255), Value varchar(255))\"" | |
- debug: | |
var: win_shell | |
$ ansible-playbook test.yml | |
PLAY [localhost] *********************************************************************************************************************************************************************************************************************** | |
TASK [set_fact] ************************************************************************************************************************************************************************************************************************ | |
ok: [localhost] | |
TASK [debug] *************************************************************************************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"win_shell": "invoke-sqlcmd -username \"toto\" -password \"with$sign\" -Query \"CREATE TABLE TempLogs (Command varchar(255), Paramenter varchar(255), Value varchar(255))\"" | |
} | |
PLAY RECAP ***************************************************************************************************************************************************************************************************************************** | |
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment