Hello,
Has anyone ever attempted to dynamically build an email, in html, which
populates a table with server details from anisble facts and registered
variables?
I am trying to solve this and I am having issues with the design:
[image: 2023-02-07_19-15-38.jpg]
--
You received this message
I’ve tried that way, but it doesn’t work either:
nsible-playbook -i hosts --extra-vars "wc2env=stage carrier=LL"
alta_carrier/playbook/tasks_targe
t.yaml
PLAYBOOK: tasks_target.yaml
***
Alex pointed out your first mistake, but you also are using moustaches in
'when' when you shouldn't
when: wc2env == 'prod'
conditionals are already in an implied template context.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscr
Hi,
The error says all:
"[WARNING]: conditional statements should not include jinja2 templating
delimiters such as {{ }}"
So, your "when" statement should look like:
when: wc2env == 'stage'
Something else:
You are already passing on "wc2env" as an extra variable. You don't need
the lines below,
I again, thank you all for your help, I’m really learning a lot.
I have a new query. I am passing via "extra-vars" a variable called wc2env
and I need to compare it with a string (stage or prod).
Here is my playbook:
hosts: all
gather_facts: no
vars:
wc2env: '{{ wc2env }}'
tasks:
- name:
Your ansible playbook can run the shell command and pass these vars as values
on the command line.
- shell: "my_script {{ jenkins_var1 }} {{ jenkins_var2 }} {{ jenkins_var3 }}"
As I said they come into the playbook as ansible extra_vars. If your survey
accepts values for these three vars and yo
But how can we pass this values to bash script on remote server?
On Tue, 7 Feb 2023, 18:19 'Rowe, Walter P. (Fed)' via Ansible Project, <
ansible-project@googlegroups.com> wrote:
> Since you are submitting the job via Jenkins and web services you can use
> a survey on the ansible tower workflow t
Since you are submitting the job via Jenkins and web services you can use a
survey on the ansible tower workflow to define variables. The web services call
can supply their values. Ansible Tower will provide these variables to your
playbook(s) as extra_vars. Read the ansible tower api docs to se
Hi Abhi,
I used
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/expect_module.html
for a VPN script, I use.
---
Lee
On Tue, Feb 7, 2023 at 12:06 AM Linux Study wrote:
> Hi All,
>
> Is there way to pass user inputs to bash script via ansible?
>
>
> Regards,
> Abhi
>
> --
> Y