My jinja2 template yields correct value for the variable
{{ vars[allip.name | join("")] | default('ERR') }}
The variable has value 82.3 which gets printed by Ansible's template module.
I wish to write an if condition where I want to check if the value of the
variable is more than 80
{% if (
Having some difficulty finding what is the Ansible code to do this:
Downloading files with a specific regular expression from remote http /
https host to a target server local path.
So would like to wget http://remote.com/rpm/app*.rpm to a set of target
servers. get_url doesn't appear to
I also tried that one but it also fails:
- name: test with json_query 1/2
vars:
- domain_definition:
- name: server11
cluster: cluster1
port: '8080'
- name: server12
cluster: cluster2
Let’s suppose the following data structure:
- domain_definition:
- name: server11
cluster: cluster1
port: '8080'
- name: server12
cluster: cluster2
port: '8090'
- name:
On Thu, 26 Mar 2020 11:43:33 -0700 (PDT)
jean-christophe manciot wrote:
> Let’s suppose the following data structure:
> - domain_definition:
> - name: server11
> cluster: cluster1
> port: '8080'
> - name: server12
>
On Thu, 26 Mar 2020 20:02:47 +0100
Vladimir Botka wrote:
>
> The playbook below
>
> - name: test with json_query 1/2
> hosts: localhost
> vars:
> domain_definition:
> - name: server11
> cluster: cluster1
> port: '8080'
> - name: server12
> cluster:
My jinja2 template yields correct value for the variable
{{ vars[allip.name | join("")] | default('ERR') }}
The variable has value 82.3 which gets printed by Ansible's template module.
I wish to write an if condition where I want to check if the value of the
variable is more than 80
{% if (
What Vladimir said (twice):
You are using:
debug:
var:
while you should be doing:
debug:
msg:
Dick
On Thu, 26 Mar 2020 at 20:19, jean-christophe manciot
wrote:
>
> Same result with your second proposal.
>
> --
> You received this message because you are subscribed to the Google Groups
It's fundamentally impossible to do what you want, unless the remote
server offers some sort of file system equivalent, like a directory
index.
Dick
On Thu, 26 Mar 2020 at 19:24, Tom K. wrote:
>
> Having some difficulty finding what is the Ansible code to do this:
>
> Downloading files with a
Same result with your second proposal.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion
Thank you @Kai for the excellent explanation :)
On Thursday, March 26, 2020 at 12:41:00 AM UTC+5:30, Kai Stian Olstad wrote:
>
> On Wed, Mar 25, 2020 at 09:54:07AM -0700, Shifa Shaikh wrote:
> > @Kia Hi,
> >
> > As suggested I tried
> >
> > item.size_total instead of item.size_available
> >
Hello,
Whenever a ternary is used are both conditions evaluated regardless ?
For example, I want to convert "my_other_var" to an object only if it is
passed as as string, otherwise I don't want to touch the object, and leave
it as it is.
- set_fact:
my_var: "{{ ( my_other_var |
EFS tags is error?
- hosts: localhost
>
>connection: local
>
>gather_facts: no
>
>
>
>vars_files:
>
> - ec2key.yml
>
>
>
>tasks:
>
>
>
>- name: Create EFS
>
>
> Whenever a ternary is used are both conditions evaluated regardless ?
A ternary filter consists of three parts:
a) the condition
b) the statement to be evaluated if the condition is true
c) the statement to be evaluted if the condition is false.
Only one of b) and c) will be evaluated, but
Thank you all for the answers. I used the solution "from_yaml" provided by
Vladimir and it works like a charm, and it's also cleaner. However, if this
is the case, I don't believe this is an issue of how ternary works, but of
how "from_json" works. My gut feeling is that it shouldn't behave that
On Wed, Mar 25, 2020 at 10:41:35PM -0700, Shifa Shaikh wrote:
> ---
> hosts: remote_hosts
> tasks:
> - name: Generate JSON data
> lineinfile:
> path: "{{ playbook_dir }}/tmpfiles/stats.yml"
> line: "{{ inventory_hostname }}_{{ item.mount }}: {{ (100 *
>
On Wed, 25 Mar 2020 23:54:57 -0700 (PDT)
Davide Scrimieri wrote:
> I want to convert "my_other_var" to an object only if it is
> passed as as string, otherwise I don't want to touch the object, and leave
> it as it is.
>
> - set_fact:
> my_var: "{{ ( my_other_var | type_debug == 'str' )
Would constructing your own lookup plugin be an option?
There seem to be lots of lookup plugins that look things up in various
kinds of vaults:
https://docs.ansible.com/ansible/latest/plugins/lookup.html#plugin-list
Could you create one of your own.
If you created an inventory plugin, rather
On Thu, Mar 26, 2020 at 7:55 AM Davide Scrimieri wrote:
>
> Hello,
>
> Whenever a ternary is used are both conditions evaluated regardless ?
>
> For example, I want to convert "my_other_var" to an object only if it is
> passed as as string, otherwise I don't want to touch the object, and leave
UPDATE: PLEASE, DISCARD what I said about the when statement at the end of
my post, in my original code I had a typo, and was not working for other
reasons. The first part of the post about the ternary statement still stands
On Thursday, March 26, 2020 at 7:54:58 AM UTC+1, Davide Scrimieri
Hello,
I'm branching to a problem with gcp_compute_instance. The server should be
created inside a project that has a shared subnet in custom mode.
These are the individual steps to gather the informations for the network:
- name: "Gather network information for {{ vpc_project }}"
If I specify only the subnetwork value, then the server is assigned an IP
address:
network_interfaces:
- subnetwork: "{{ selfLink }}"
Thomas
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and
Sorry, found it:
network_interfaces:
- network_ip: "{{ ipaddress.address }}"
- subnetwork: "{{ selfLink }}"
is wrong
network_interfaces:
- subnetwork: "{{ selfLink }}"
network_ip: "{{ ipaddress.address }}"
is right. My fault.
Thomas
--
You received this
23 matches
Mail list logo