[ansible-project] seting environment

2017-12-13 Thread coach . rhca
I have few variables defined in a variable.yml file for example cat variable.com ( its a dynamic file and the value keeps changing ) ptr_image: my.example.com/jobname/testname ver_number: v99 I am using this in my playbook ... build.yml where i am using this file for the variables.. --- -

[ansible-project] debugging ansible internals

2017-12-13 Thread vartika darshana
hi all, it looks like we are running into an odd, internal ansible bug, we are getting: module_stdout: "/usr/bin/python: can't open file '/root/.ansible/tmp/ansible-tmp-1513221896.59-46487435467258/my_module' it doesn't happen all the time, just sporadically. is there a good way to track

Re: [ansible-project] Add conditional logic to variable files?

2017-12-13 Thread Brian Coca
data files have no logic, but you can use a templated value instead: foo: "{{ enabled_setting|ternary('bar', '') }}" baz: "{{ enabled_setting|ternary('', 'barf') }}" -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project"

Re: [ansible-project] Variable precedence and why to over rule ?

2017-12-13 Thread Brian Coca
Just to clarify some things that looked wrong: - include_vars is allowed in plays, as a task - vars_files is only allowed on plays, directly as a keyword - you can pass files to extra vars by using the '@' symbol: -e @filename.yml or -e @filname.json for when you data does not fit on the

Re: [ansible-project] Trying to duplicate a Bash script into ansible -- Not sure how to best handle alternatives with Slaves

2017-12-13 Thread Toshio Kuratomi
If you don't need idempotence (I assume you don't since the shell module doesn't have idempotence either) I'd use the script module with your existing bash script. -toshio On Dec 13, 2017 7:39 AM, "Justin Seiser" wrote: > I see there was a feature >

Re: [ansible-project] Templete statement that can qualify mulitiple inventory_hostname

2017-12-13 Thread Mike Johnston
That was it! I knew it would be simple...just not that simple. Thank you Stian. :) On Tuesday, December 12, 2017 at 11:42:54 PM UTC-6, Kai Stian Olstad wrote: > > On 12.12.2017 23:56, Mike Johnston wrote: > > *hosts file:* > > [group1] > > system1 > > system2 > > system3 > > > >

[ansible-project] Trying to duplicate a Bash script into ansible -- Not sure how to best handle alternatives with Slaves

2017-12-13 Thread Justin Seiser
I see there was a feature request for this, but they do not note how they actually worked around it. In a nutshell, we download a groovy archive, unzip it, and create slaves for every file in the archive that is not the groovy executable, and

[ansible-project] iisue when evaluating a complex var in become

2017-12-13 Thread Mike C
Hi all, im trying to use a 'complex' expression to evaluate if a task should run as root or not. Here is what i have defined: ``` debian_based_system: ansible_os_family == 'Debian' or ansible_os_family == 'Linuxmint' ``` My tasks look like this ``` - debug: var=ansible_os_family - debug:

[ansible-project] Re: win_Shell or win_command executing a variable taken from win_reg_stat

2017-12-13 Thread Gareth Stockdale
Appears the vendor is not storing productID in the expected path :( ON a different tact to avoid the extra single quoting on the executable, I tried obtaining the windows short path for the file. win_stat does not provide it. So I ran a successful win_shell cmd as follows: win_shell: cmd /c

[ansible-project] Play aborted if one host is unreachable

2017-12-13 Thread Iryna Oliinykova
Hello, I have a play with a "serial" defined in it. This play fails if one of the hosts in the inventory is unreachable and is not executed on the rest of the hosts. I have found the exact same problem that was reported to Ansible bug report: https://github.com/ansible/ansible/issues/11997

[ansible-project] Microsoft SQL server play

2017-12-13 Thread area0
Hi guys, Just wondering what's the best way to run an SQL UPDATE on a remote Microsoft SQL database; the idea is that, once a machine runs through the win_updates module, a field in the SQL database called 'last patched' is updated to the current day/time. Am i looking at the command module

[ansible-project] Re: win_Shell or win_command executing a variable taken from win_reg_stat

2017-12-13 Thread Gareth Stockdale
HI Jordan, Example uninstall path: C:\Program Files (x86)\My Software\It Is Mine\myagent\uninstall.exe The full command woudl be... C:\Program Files (x86)\My Software\It Is Mine\myagent\uninstall.exe /S _?=C:\Program Files (x86)\My Software\It Is Mine\myagent I will take a look at

[ansible-project] Re: win_Shell or win_command executing a variable taken from win_reg_stat

2017-12-13 Thread Gareth Stockdale
SO the problem I have now is if I try and add args eg win_shell: '"{{uninstall}}" /S _?="{{installloc}}"' It fails to run it with "unable to exec C:\Program.exe" - ie the single quote i had around the "{{uninstall}" previously have moved around the entire command, but it now has issue with

[ansible-project] ANSIBLE_KEEP_REMOTE_FILES location on windows target?

2017-12-13 Thread Gareth Stockdale
Anyone know the default location of files on windows when using this to run a playbook? ANSIBLE_KEEP_REMOTE_FILES=1 Thanks -- 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,

[ansible-project] Re: win_Shell or win_command executing a variable taken from win_reg_stat

2017-12-13 Thread Gareth Stockdale
OK so I go the basic command working with... win_command: '"{{ uninstall}}"' Now working on the extra arguments On Wednesday, December 13, 2017 at 9:32:14 AM UTC, Gareth Stockdale wrote: > > I have some vendor software where I am trying to uninstall (following > their procedure) by obtaining

[ansible-project] Re: win_Shell or win_command executing a variable taken from win_reg_stat

2017-12-13 Thread Jordan Borean
We would probably need some more information and not just a blank variable called uninstall. You can omit names but keep the structure and arguments the same so we can see what exactly is the value from the registry key. Are you also able to share the registry path you are querying as you might

[ansible-project] win_Shell or win_command executing a variable taken from win_reg_stat

2017-12-13 Thread Gareth Stockdale
I have some vendor software where I am trying to uninstall (following their procedure) by obtaining the uninstall command and install location from the windows registry. I do this by querying win_reg_stat and storing result in two facts. I am then trying to execute the variable via win_shell

Re: [ansible-project] Ansible 2.4 gathering facts stuck

2017-12-13 Thread Dick Visser
Does it get stuck at the same host(s) every time? If so, I would log in to such a host and check what is going on at the time of fact gathering. Could be busy, or I/O issues, etc. Dick On 13 December 2017 at 07:16, Mona Gopal wrote: > Hi, > > Ansible2.4 is setup on

[ansible-project] How will you deal with this problem? [extra-variable problem]

2017-12-13 Thread 강동인
Currently I am using citirx's L4 switch. I need to create 1 to 10 servers for each L4 switch. To do this I need extra_variables. ( The extra variable below was used to create only two servers. ) When I have to make 10 servers, I have too many to define in extra_variable The problem is that

Re: [ansible-project] Changing credentials between tasks

2017-12-13 Thread Pshem Kowalczyk
Hi, One thing comes to mind - you could create two different entries in the inventory pointing to the same 'ansible_host' with different set of credentials. So the bootstrap process could run against the the first host (with default password) and the rest of the play - against the second. The