Re: [ansible-project] Group variables conditional based on OS distribution release

2016-02-26 Thread Brian Coca
​Y​ ou cannot use jinja2 commands in vars file, the templates are not used in the vars file, they are just assigned as strings that later get recognized as templates and templated. But you can do this: ansible_become_method: "{{ (ansible_distribution_release|version_compare('5.8', '>='))|ternary('

[ansible-project] Group variables conditional based on OS distribution release

2016-02-26 Thread Darren S.
Hi, After various docs and some trial and error, I can't figure out how to handle setting a variable differently when the target operating system version is newer than a certain release. OpenBSD 5.8 and newer have replaced sudo(8) with doas(1), so I'd like to set ansible_become_method correctly ba

Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2016-02-26 Thread Jason Hiatt
You will need to open up the ISO and add a few parameters to boot config. I added the location of my dynamic kickstart web service (ks=http://example.com/ks.php) and the kssendmac parameter. Once you modify that file recreate your ISO. This link should help. http://www.softpanorama.org/Comm

[ansible-project] Re: Ansible windows modules

2016-02-26 Thread Quang Truong
The problem with installing msu file via WinRM (as Ansible uses Py connects to window host via WinRM). I grab this article on the net (http://www.hurryupandwait.io/blog/safely-running-windows-automation-operations-that-typically-fail-over-winrm-or-powershell-remoting) and this one from MS (http

Re: [ansible-project] Appending to fact provided by module, and use aggregated fact in module function

2016-02-26 Thread timss
All right. Thanks for the clarification. - Tim On Thursday, February 25, 2016 at 4:46:28 AM UTC+1, Brian Coca wrote: > > Sorry, currently there is no way to append facts, they always overwrite. > > > -- > Brian Coca > -- You received this message because you are subscribed to the Google

Re: [ansible-project] How to skip the task by checking the file exists or not using when

2016-02-26 Thread Brian Coca
use stat module and make a condition on the registered result, when won't execute a shell, a lookup could be used but they run on 'master' not on target. also you can use file: state=touch​ -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2016-02-26 Thread afroz . cci
Hi Mark, bit confusion, need your suggestion... i made a play book to create vm machine and attached iso_path. when i run the playbook it creates a vm automatically boot from rhel6 iso. if it is booting from iso automatically then why i need to use pxe ? can i install rhel6 OS by kickstart ?

[ansible-project] How to delete multiple lines after a match?

2016-02-26 Thread Weiwen Chen
Hello Expert, Is there a way in ansible to delete multiple lines after a pattern matched? For example, I have a file with following contents, and need to delete lines 'bb', 'cc'. However I really do not know what are those two lines as they are generated dynamically. I only know line '

Re: [ansible-project] Using custom message when a task fails

2016-02-26 Thread Brian Coca
no, pretty much what you already noted are the only options. On Fri, Feb 26, 2016 at 11:30 AM, abraham johnson < abraham23johnson2...@gmail.com> wrote: > Hello > > I am using ansible version 1.8.2. > I would like to know if its possible to add a custom message when a task > fails. > I understand

[ansible-project] Re: Ansible managing Windows hosts with non admin user

2016-02-26 Thread 'J Hawkesworth' via Ansible Project
could you try running playbook with -vv this should show a bit more information about how ansible is connecting also check the event log on the windows host to see if the login request is a success. Something else you could try is to run the python pywinrm example here against your host:

Re: [ansible-project] Ho do I unset/remove/delete a variable in Ansible?

2016-02-26 Thread Brian Coca
no undefined but you can make it null/None varname: !!null -- Brian Coca -- 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..

[ansible-project] Re: Ansible managing Windows hosts with non admin user

2016-02-26 Thread Julian Saunders
I managed to find the root/CIMV2 namespace, and I set the security permissions of "Execute Methods" and "Remote Enable" and restarted the WMI and WinRM services. Unfortunately I still receive the same error. As I mentioned, I can use WinRM from another Windows server via Powershell session, wi

[ansible-project] Re: Ansible managing Windows hosts with non admin user

2016-02-26 Thread Julian Saunders
I have since tried win_ping and raw, but I haven't had time to test "allow on Execute Methods and Remote enable" on the windows server. Both modules work fine when I'm a local admin on the windows server. Both fail at the "Gather Facts" when I'm not a local admin. ansible windows -i inventory/d

[ansible-project] Using custom message when a task fails

2016-02-26 Thread abraham johnson
Hello I am using ansible version 1.8.2. I would like to know if its possible to add a custom message when a task fails. I understand that one way to do is - name: Run Shell Command shell: ./script.sh register: results ignore_errors: yes - fails: msg="Command was not executed succe

[ansible-project] Ho do I unset/remove/delete a variable in Ansible?

2016-02-26 Thread 'Thomas Steinbach' via Ansible Project
Hi, does anybody know how I can unset a variable in Ansible so that it becomes 'undefined'? -- 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+

Re: [ansible-project] Update Ansible SSH Address Mid-Playbook

2016-02-26 Thread Dan Rough
I've just checked the rax.py file that we're using for our inventory, and I can't find any reference to any caching. If you have a minute Liam, would you mind pasting a working example of how you're using meta: refresh_inventory? It'll most likely turn out to be something that I have done incorrect

[ansible-project] Re: how to tag in vmware?

2016-02-26 Thread mtw
Please post if you do this, it would be hugely useful. It is my understanding that the vsphere api makes it difficult/impossible to work with tags in ESX 5.x, but pretty easy in ESX 6.x. On Tuesday, January 12, 2016 at 12:03:29 PM UTC-5, Kesten Broughton wrote: > > There's a ton of new module

[ansible-project] Re: Galaxy 2.0.1 Release

2016-02-26 Thread Chris Houseknecht
Smarter people than me pointed out that Monday morning would be better. They may be right. Galaxy 2.0.1 will release Monday morning at 7:30AM EST. --c On Friday, February 26, 2016 at 7:43:06 AM UTC-5, Chris Houseknecht wrote: > > False start. We're having some jenkins issues. Delaying until thi

[ansible-project] Dynamic variables includes in roles

2016-02-26 Thread chris scott
This should be simple but I cant figure it. I want to read in a list of packages to install dependent on the os major version. However I want to do this at the role level. eg I have 3 package lists, one for RHEL5, one for RHEL6 machines and one for RHEL7 machines. I want to dynamically pick t

Re: [ansible-project] Update Ansible SSH Address Mid-Playbook

2016-02-26 Thread Dan Rough
Hi Liam, Thanks for responding - I'd all but given up on getting this to work. I'm using Rackspace rather than AWS, I'll see if the Rackspace equivalent, rax.py has a similar issue with the cache. Thanks again! Dan. On 26 February 2016 at 07:55, Liam Jones wrote: > Hey Dan, > > I put what I

[ansible-project] How to skip the task by checking the file exists or not using when

2016-02-26 Thread Dinesh E
I have to check whether a file exists or not in /etc/. If the file exists then I have to skip the task otherwise the task should be run. Below is the code - name: check whether the file exists command: touch /etc/file.txt when: $(! -s /etc/file.txt) If the file exists then task should be s

Re: [ansible-project] lineinfile task that spans multiple lines

2016-02-26 Thread Chris McConnell
Hello, although this is an older thread, I came across it today while searching for a solution to also use lineinfile to edit multiple lines after a designated regex. Apologies if this is not the right way to do it, (and if its a bad way, would love to see the "right" way to do it). But hey, I

Re: [ansible-project] Update Ansible SSH Address Mid-Playbook

2016-02-26 Thread Liam Jones
Hey Dan, I put what I found in some comments on this stackoverflow article, but have you tried disabling the cache on the dynamic inventory? To disable, set cache_max_age = 0 in the ec2.ini file. This was the issu

[ansible-project] using cs_instance

2016-02-26 Thread Daan Hoogland
LS, I am trying to use the cloudstack set of modules with ansible 2.0 host file: [vms] vm01 end of host file stip.yaml: - hosts: all gather_facts: no tasks: - name: stop vm local_action: cs_instance name="{{ inventory_hostname }}" state=stopped end of stop.yaml command: $ ansible-playb

[ansible-project] Re: Galaxy - Install Role from Subdirectory of Github Repo

2016-02-26 Thread Chris Houseknecht
The role installation process does not support this at present. We're in the middle of re-thinking how role installs work. If you're interested, there is a proposal at github.com/ansible/ansible. Look in docs/proposals. Combining multiple roles into a single repo makes things like testing, lin

[ansible-project] Re: Updated ansible to track latest, now I have error 'Connection' object has no attribute '_split_ssh_args'

2016-02-26 Thread 'J Hawkesworth' via Ansible Project
Not seen this myself but a couple of things to investigate. You don't mention which version of ansible you were running previously - if it wasn't from a development checkout, ensure you have run source hacking/env-setup Probably worth re-running even if you were on a dev checkout before. Also

[ansible-project] Re: Galaxy 2.0.1 Release

2016-02-26 Thread Chris Houseknecht
False start. We're having some jenkins issues. Delaying until this evening at 6:00 PM EST. Stay tuned! --Chris On Friday, February 26, 2016 at 7:28:02 AM UTC-5, Chris Houseknecht wrote: > > Starting the upgrade... > > On Tuesday, February 23, 2016 at 12:54:57 PM UTC-5, Chris Houseknecht > wro

[ansible-project] Re: Galaxy 2.0.1 Release

2016-02-26 Thread Chris Houseknecht
Starting the upgrade... On Tuesday, February 23, 2016 at 12:54:57 PM UTC-5, Chris Houseknecht wrote: > > We will be releasing Galaxy 2.0.1 this > Friday 2/26 starting at 7:30AM EST and ending at 8:00AM EST. During this > window access to Galaxy may be interrupted, s