[ansible-project] How can we prevent 2 Ansible playbook to run on the same host at the same time?

2020-03-29 Thread tamar matelles
?How can we prevent from 2 ansible running on the same host at the same time we are working with facts_catch json file and sometimes have problem that 2 ansibles try write the same json fact_caching = jsonfile fact_caching_connection = /tmp/facts_cache fact_caching_timeout = 7200 -- You

[ansible-project] Re: Invoke-CommandInDesktopPackage ( Not able to execute Invoke-CommandInDesktopPackage with Ansible (win_shell) option

2020-03-29 Thread Raviteja Jinkala
Even windows to windows execution, it is giving below error, does Invoke-CommandInDesktopPackage don't work through remote execution. Invoke-CommandInDesktopPackage : A specified logon session does not exist. It may already have been terminated. \r\n(Exception from HRESULT: 0x80070520)\r\nAt

[ansible-project] Invoke-CommandInDesktopPackage ( Not able to execute Invoke-CommandInDesktopPackage with Ansible (win_shell) option

2020-03-29 Thread Raviteja Jinkala
Hi Team, I am not able to execute Invoke-CommandInDesktopPackage with Ansible (win_shell) , facing below error. please check and let me how to fix the issue. I am running with Full access User. Invoke-CommandInDesktopPackage : System.UnauthorizedAccessException occurred when attempting to

RE: [ansible-project] nfs client ansible

2020-03-29 Thread sandy.hung
Dear all: � I can connect to this ip and share folder "msg": "Error mounting /nfs: mount.nfs: remote share not in 'host:dir' format\n" � BR Sandy � � � my ansible --- �- hosts: all � �gather_facts: no � �become: yes � � �tasks: � � �- name: Ensure NFS Common is

Re: [ansible-project] How to execute Play 2 only if Play 1 succeeds

2020-03-29 Thread Dick Visser
It works if you do it in a single play. Why are you using two different plays anyway? On Sun, 29 Mar 2020 at 13:00, Shifa Shaikh wrote: > I have two Plays having one task each. > > > The first Play 1 checks if the/var/test.datexists on each target host. > > > Only if the Play 1 is successful

[ansible-project] How to execute Play 2 only if Play 1 succeeds

2020-03-29 Thread Shifa Shaikh
I have two Plays having one task each. The first Play 1 checks if the/var/test.datexists on each target host. Only if the Play 1 is successful do I want the second play Play 2 to run which executes scripts in parallel. If Play 1 fails i.e if the test.dat does not exist I wish to

Re: [ansible-project] Specifying template src with a variable

2020-03-29 Thread Geo P.C.
Yes I am using templates and created template files as: templates app1.conf.j2 app2.conf.j2 app3.conf.j2 taks app.yml On Sun, 29 Mar, 2020, 1:57 PM Stefan Hornburg (Racke), wrote: > On 3/29/20 10:16 AM, Geo P.C. wrote: > > Yes template located on controller itself. We can it's getting the

Re: [ansible-project] Specifying template src with a variable

2020-03-29 Thread Stefan Hornburg (Racke)
On 3/29/20 10:16 AM, Geo P.C. wrote: > Yes template located on controller itself. We can it's getting the name > "app1".  > > For template src only its getting error.   > > Pls see variable instance_name >  got it's value as app1 in the result. Issue is only with src: > > TASK [test :

Re: [ansible-project] Specifying template src with a variable

2020-03-29 Thread Geo P.C.
Yes template located on controller itself. We can it's getting the name "app1". For template src only its getting error. Pls see variable instance_name got it's value as app1 in the result. Issue is only with src: TASK [test : Copy app1 file to /opt/conf.d/ Directory On Sun, 29 Mar, 2020,

Re: [ansible-project] Specifying template src with a variable

2020-03-29 Thread Stefan Hornburg (Racke)
On 3/29/20 9:52 AM, Geo P.C. wrote: > Thanks Racke. > > Sorry it was my typo. Pls see my app.yml: > > > - name:  'Copy {{ instance_name }} file to /opt/conf.d/ Directory' >     template: >       src: "{{ instance_name }}.conf.j2" >       dest: "/opt/{{ instance_name }}/conf.d/" >       owner:

Re: [ansible-project] Specifying template src with a variable

2020-03-29 Thread Geo P.C.
Thanks Racke. Sorry it was my typo. Pls see my app.yml: - name: 'Copy {{ instance_name }} file to /opt/conf.d/ Directory' template: src: "{{ instance_name }}.conf.j2" dest: "/opt/{{ instance_name }}/conf.d/" owner: root group: root mode: 0644 In defaults

Re: [ansible-project] Specifying template src with a variable

2020-03-29 Thread Stefan Hornburg (Racke)
On 3/29/20 9:14 AM, Geo P.C. wrote: > > In ansible we are trying to access different templates based on variable. > > We have following template files like: > > templates > app1.conf.j2 > app2.conf.j2 > app3.conf.j2 > > taks > app.yml > > > In tasks we need to copy template file based on the

[ansible-project] Specifying template src with a variable

2020-03-29 Thread Geo P.C.
In ansible we are trying to access different templates based on variable. We have following template files like: templates app1.conf.j2 app2.conf.j2 app3.conf.j2 taks app.yml In tasks we need to copy template file based on the app name. for eg: we will specify a variable named "instance_name"