ansible template vars for command line invocation

72 views
Skip to first unread message

Ed Greenberg

unread,
Aug 11, 2021, 9:58:34 AM8/11/21
to Ansible Project
Hi, I have a bash command of:

ansible beta -m template -a 'src=../templates/www.conf.j2 dest=/root/www.conf '

I need to specify a variable on the command line. 

I tried specifying it in the -a string, but got an error that template only accepts certain variables. 

IF the template was in a playbook I could provide the variable(s) using -e.  How can I do this from the command line invocation? 

Thanks, 
Ed 

Roberto Paz

unread,
Aug 11, 2021, 10:14:06 AM8/11/21
to Ansible Project
Can you share the error message? Didn't work if you use as an "extra var" added to the command line you posted?
Reply all
Reply to author
Forward
0 new messages