[ansible-project] AWS vpc creation problem on Mac OS X

2016-01-19 Thread Arbab Nazar
Hi, I have a problem while creating aws vpc from mac os x but the exact same command/role is working from ubuntu. Steps that I have already taken on Mac OS X: - update the time using ntp - upgrade the ansible to version 2 - downgrade the ansible to version 1.9.1,1.9.2,1.9.3 and 1.9.4 - boto

[ansible-project] One issue about ansible_host with ansible 2.0, when I use lineinfile module.

2016-01-19 Thread rella . guo
When I use ansible_host in lineinfile module with ansible 2.0, I get ansible_host="". But in debug module, I can get exact host name by ansible_host. Is it a ansible 2.0 bug? Actually, when I used ansible_ssh_host with ansible 1.9, it was OK. My tasks are: - debug: msg="ansible_host is {{

[ansible-project] Re: Some important features in Ansible that I'd like to see ('creates', 'removes', 'run_once_by')

2016-01-19 Thread Alexey Vazhnov
Moved to «Ansible Development» https://groups.google.com/d/msg/ansible-devel/kYUi8fvKZMI/vRdYrKYbFwAJ On Wednesday, December 23, 2015 at 9:50:07 AM UTC+5, Alexey Vazhnov wrote: > > Hi! > > I want to suggest a few major and valuable, as I see it, features and > invite community to discuss: > > *

[ansible-project] Changing actions in case a node fails

2016-01-19 Thread Dan C
Hi there, I've been looking arround trying to find a way, with no luck. When running a playbook against multiple nodes (say 5), and one of them fail a task (or block), I would like the other 4 nodes to run different tasks than the ones they would run if non of the nodes fail. Is there any way

[ansible-project] Re: Run .exe on windows command prompt

2016-01-19 Thread Balaji Chandrababu
Hi Dimitri, I'm trying to do pretty much the same with our own installer. This is what i have got in the playbook. Example: - name: Install ZoneSense and Niva latest version raw: 'C:\Temp\ZoneSense 16.0.0.343.exe /S' I tried other options as well: raw: '"C:\Temp\ZoneSense 16.0.0.343.exe" /S'

Re: [ansible-project] Getting pieces from a list with ansible

2016-01-19 Thread Dan C
Thanks Brian, You are right about not needing the "|list", it works perfectly without it. But I am yet not able to assign the variable, using what you suggested I am now getting a different error: - set_fact: mylist={{["l10","j82","b83","8jk","j83"]}} - debug: var=mylist - set_fact:

Re: [ansible-project] Ansible's philosophy about running playbooks against localhost and use lot of delegate_to in roles

2016-01-19 Thread Sylvain
Thanks for your reply. My play run already on *localhost*. If I don't use *delegate_to*, this will be hard to make actions on servers. My roles are parametrized to take server in parameters among others so my roles are already reusable but I'm ok to say that it will be more clean to suppress

[ansible-project] Re: [Ansible 2.*] Problem with variables

2016-01-19 Thread George Khan
I'll must declare it in /etc/ansible/roles/preconf/defaults/main.yml Thanks to navern ^_^ воскресенье, 17 января 2016 г., 1:55:53 UTC+5 пользователь George Khan написал: > > Hi there! I have some troubles with vars in ansible... > What i have: > > [root@ansible ansible]# cat

Re: [ansible-project] callbacks with --check

2016-01-19 Thread Mike Biancaniello
worked great, thanks! Is there a way to do this in 1.94? For now, I added to my callback: from ansible import __version__ as ANSIBLE_VERSION if not ANSIBLE_VERSION.startswith('2'): from ansible.callbacks import display display("Logging not supported in Ansible <2.0",'red') from

[ansible-project] Re: ssh error connection time out

2016-01-19 Thread Cody McCoder
I believe I know the generic answer to your question from reading other posts: ~/.ssh/known_hosts must exist on the target machine for the user you are ssh as (also make sure you have the correct perms on this file and the .ssh directory) The part that I would like to understand is WHY this

[ansible-project] How to normalize Absible output?

2016-01-19 Thread zbernie123
I have a playbook entry which is performing an rpm command on a remote host: - hosts: testgroup gather_facts: no remote_user: bartonbf tasks: - name: List SIS packages shell: /bin/rpm -qa --queryformat '%-50{NAME} %{VENDOR}\n' | sort -d -f The problem is the output stair

[ansible-project] Re: Template unable to replace file; the playbook uses "become" to get the elevated permission

2016-01-19 Thread Indra Gunawan
> > I am running it as me (userid: ingunawa) like this "ansible-playbook -i > hosts jenkins-master.xml --limit -k -K" > I have sudo permission on the target machine/VM. I can create/copy file to /etc/init.d as root and create/copy file to the other directory owned by the other user (generic

[ansible-project] Bounty for moving simple lookup plugin to API V2!

2016-01-19 Thread Marcus Morris
https://www.bountysource.com/issues/30020306-modify-to-use-ansible-api-v2 -- 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: group_vars precedence?

2016-01-19 Thread Bill Wiens
Did you ever find out how this works? I have a variable that's set in both group_vars/aws/secrets.yml and group_vars/aws_dogfood/secrets.yml, and I can't figure out why on some servers it uses the variable from "aws" and others use the variable from "aws_dogfood". -Bill On Monday, August 24,

Re: [ansible-project] callbacks with --check

2016-01-19 Thread Matt Martz
I think you can check `self.playbook.check` in a callback for 1.x. I'm not sure how soon you can access `self.playbook`. It may not be accessible until `playbook_on_start`. I'll leave that for you to determine ;) On Tue, Jan 19, 2016 at 3:55 PM, Mike Biancaniello wrote: >

[ansible-project] callbacks with --check

2016-01-19 Thread Mike Biancaniello
I am trying to put together a logging module to log changes, but I do not want to log anything when run in check-mode (because no changes were made, so this would be confusing to anyone reading the logs). Is there any way to do this? I can't find any place where play_context (or anything else

Re: [ansible-project] callbacks with --check

2016-01-19 Thread Matt Martz
There is an approach that Brian Coca and I have been working on which would be to do the following: from __main__ import cli and then in __init__ of your callback: if cli.options.check: self.disabled = True Eventually, the plan is to make `cli.options` available to all callbacks natively

Re: [ansible-project] ERROR! duplicate loop in task: - please explain why

2016-01-19 Thread Steve Kieu
Hi Brian, proxy_env is a dict defined in inventory/group/all files. I have the code: - name: Install postgres93 yum: name={{item}} state=present with_items: - "{{cron_pkgname}}" - "{{mail_pkgname}}" - rdiff-backup - which - postgresql93-server - postgresql93-contrib

[ansible-project] Disable become sudo "-n" flag?

2016-01-19 Thread Josef Fortier
I've a few old server in maintenance with older versions of sudo. Since upgrading to ansible 2.0 (and 2.01) these servers are erroring out on sudo/become calls with: sudo: illegal option `-n' Checking these servers, I do see that the sudo versions do not support "-n". Is there a workaround for

Re: [ansible-project] Disable become sudo "-n" flag?

2016-01-19 Thread Brian Coca
You can set the sudo flags in ansible.cfg, env var or in ansible_sudo_flags inventory variable. The default is "-H -s -n". I recommend you keep -H and -s. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from

Re: [ansible-project] ERROR! duplicate loop in task: - please explain why

2016-01-19 Thread Brian Coca
already gave you the solution: environment: "{{proxy_env}}" environment won't take bare vars to confuse with strings in 2.0, it will properly validate. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from

[ansible-project] Ansible Tower Alternative - My OpenSource Project

2016-01-19 Thread Larry Smith
All, I wanted to share and open this up for anyone who may be interested. I started working on an Ansible Tower replacement and then some 6-7 months ago. I worked on it for about 2-3 weeks and put it down and never did much more with it. I have published this to my GitHub repository for anyone

[ansible-project] Ansible 2.0 parameter escaping problem

2016-01-19 Thread Rob White
I've starting seeing the following problem since I upgraded to Ansible v2.0 Here's the task: raw: PowerShell "C:\Temp\db_scripts\copy_db_file.ps1" \"{{ system_db_default_location }}/master.mdf\" \"{{ system_db_master_mdf_location }}/master.mdf\" It used to work fine in Ansible 1.9 but now I

Re: [ansible-project] Changing actions in case a node fails

2016-01-19 Thread James Cammarata
In 2.0.1, we're going to allow the use of any_errors_fatal at the block level, so you can simply do this: - block: - task1: .. - task2: .. ... - taskN: .. rescue: - undo_taskN: .. ... - undo_task2: .. - undo_task1: .. any_errors_fatal: yes However, there is currently a bug in

Re: [ansible-project] Re: yum state=absent leads to "you need to be root to perform this command"

2016-01-19 Thread Paul Davies
Hi - this resolved it and makes sense but I don't understand why I didn't need this line in my install script It was only a demo so I won't be spending any more time on it thanks all On Saturday, 16 January 2016 14:38:13 UTC, Alex Leonhardt wrote: > > you probably want "sudo: yes" above the

[ansible-project] Error executing maven_artifact plugin

2016-01-19 Thread Bob Nuggett
I get the following error when trying to execute the maven_artifact plugin fatal: [172.28.128.6]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n File

[ansible-project] Using Ansible to manage remote lxc container

2016-01-19 Thread Thibault Jouannic
Hi all, I very recently started to work with Ansible, and my problem is that I cannot find a way to handle our remote lxc containers. We have a remote host that I can ssh into, and on that host we set up a few lxc containers with no sshd servers (and I'd like to keep it that way). All I could

[ansible-project] Roles directory not found anymore in Ansible 2

2016-01-19 Thread Petri Lehtinen
Hi! I started using Ansible with 1.9 and soon upgraded to a pre-release version of 2.0.0. Today, I upgraded to 2.0.0.2 and Ansible no longer finds my roles directory. My directory hierarchy looks like this: ansible/ production roles/ foo/ ... bar/ ... services/

Re: [ansible-project] Roles directory not found anymore in Ansible 2

2016-01-19 Thread Matt Martz
I'm unsure about a change in the search paths, however on a slightly different topic, the section in ansible.cfg is [defaults] with an 's'. You indicated using 'default' without an 's' which could be why setting roles_path didn't work. On Tuesday, January 19, 2016, Petri Lehtinen

[ansible-project] Template unable to replace file; the playbook uses "become" to get the elevated permission

2016-01-19 Thread Indra Gunawan
This error is a blocker my effort to use Template to automate our Jenkins installation to target Jenkins master on our corporate environment: PUT /tmp/tmpUjjIrF TO /users/ingunawa/.ansible/tmp/ansible-tmp-1453075333.7-198301965511122/source EXEC ( umask 22 && mkdir -p "$( echo

[ansible-project] CenturyLink nested groups - how to create a server?

2016-01-19 Thread Imre Zima
Hello, I am using Ansible v2 and I am able to create a server on CenturyLink in a group "MyGroup" using the new *clc_server *module: http://docs.ansible.com/ansible/clc_server_module.html The problem is this: I have a group "ChildGroup" inside "ParentGroup" created on CenturyLink. I am trying

[ansible-project] Dependencies among roles with pluggability

2016-01-19 Thread Flavius Aspra
Hi Let's say I have an *editor* role which contains a list (in form of a variable, let's call it plugins) of programming-language-agnostic plugins plus an editor_type variable, and additional roles for each language like *python*, *C++*, etc. What is the most elegant way of organizing these

Re: [ansible-project] Error executing maven_artifact plugin

2016-01-19 Thread Matt Martz
lxml needs to be installed on the remote target device where the task is executing, not on the local control machine (unless they are one in the same) I suggest adding a task that will install lxml via the pip module before executing any tasks that require it. On Tuesday, January 19, 2016, Bob

Re: [ansible-project] Re: [Ansible 2.*] Problem with variables

2016-01-19 Thread Brian Coca
you can use 'vars' or 'defaults', but not 'variables: /etc/ansible/roles/main/{vars,defaults}/main.yml On Tue, Jan 19, 2016 at 6:50 AM, George Khan wrote: > I'll must declare it in /etc/ansible/roles/preconf/defaults/main.yml > Thanks to navern ^_^ > > воскресенье, 17

Re: [ansible-project] One question about the default variables of dependency roles override in ansible 2.0

2016-01-19 Thread Brian Coca
tasks still execute in order, so 'anywhere prior' if you want to split hairs. -- 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] For 2.0 How to test if variable set to null in when clause

2016-01-19 Thread Michael Baydoun
pre 2.0 set_fact: uberHost: "{{ ansible_ssh_host }}" when: ansible_ssh_host is defined set fact: uberHost: "{{ inventory_hostname }}" when: ansible_ssh_host is not defined Post 2.0, changed to use ansible_host uberHost is always getting set to null ansible_host is defined and set to null

[ansible-project] Whitespace in multi-line variables on ansible 2.x

2016-01-19 Thread Andrew Martin
Hello, When creating multi-line variables, I would often use the following technique to insert tabs in ansible 1.x: myvar: | {{'\t'}}one {{'\t'}}two {{'\t'}}three This would result in the 3 lines being indented by a tab character in the resulting file. However this does not seem to work

Re: [ansible-project] For 2.0 How to test if variable set to null in when clause

2016-01-19 Thread Matt Martz
It should be enough to just check: when: ansible_ssh_host However it may be good to come at it from a little different direction and use something like: set_fact: uberHost: "{{ ansible_ssh_host|default(inventory_hostname, True) }}" The True in default() will tell jinja2 to use pythons

Re: [ansible-project] For 2.0 How to test if variable set to null in when clause

2016-01-19 Thread Brian Coca
you can even chain them and make it future proof set_fact: uberHost: "{{ ansible_host|default(ansible_ssh_host|default(inventory_hostname, True), True) }}" On Tue, Jan 19, 2016 at 9:56 AM, Matt Martz wrote: > It should be enough to just check: > > when: ansible_ssh_host > >

Re: [ansible-project] Changing actions in case a node fails

2016-01-19 Thread Dan C
Hi James, This is a really nice feature! I was just trying to get there by using "delegate_facts" which is not that clean of a solution,... ;-) Will this feature be in the "devel" branch soon? And till now (with this new feature) was there any other way to achieve this? Thank you very much!

Re: [ansible-project] Re: [Ansible 2.*] Problem with variables

2016-01-19 Thread George Khan
Brian, i try to use /etc/ansible/roles/main/vars/main.yml but all that i got: FAILED! => {"failed": true, "msg": "ERROR! 'adm_users' is undefined"} вторник, 19 января 2016 г., 20:22:55 UTC+5 пользователь Brian Coca написал: > > you can use 'vars' or 'defaults', but not 'variables: > >

[ansible-project] Include wildcard

2016-01-19 Thread Patrick McMahon
Hi Guys, Quick question. How can I do this in my playbook? # Include all of new-apps - include: ../*/new-app.yml I get the following error: ERROR: file could not read: /ansible/playbooks/*/new-app.yml I want ansible to include all files called new-app.yml under any directory. Thanks Paddy

Re: [ansible-project] Include wildcard

2016-01-19 Thread Brian Coca
no but you can try using fileglob lookup On Tue, Jan 19, 2016 at 11:00 AM, Patrick McMahon wrote: > Hi Guys, > > Quick question. How can I do this in my playbook? > > # Include all of new-apps > - include: ../*/new-app.yml > > I get the following error: > > ERROR:

Re: [ansible-project] when conditional failing to skip a task on string comparison (2.0)

2016-01-19 Thread Brian Coca
is it 'False' or False? they are different things, a better check that can deal with both is: when: project_subtree_path|bool and not project_subtree_full_path.stat.exists On Tue, Jan 19, 2016 at 10:37 AM, Eduardo Esclapés Giménez wrote: > Hi there, > > A task that

[ansible-project] when conditional failing to skip a task on string comparison (2.0)

2016-01-19 Thread Eduardo Esclapés Giménez
Hi there, A task that shoud skip is running and failing. This is the task - name: Fail if project_subtree_path is set incorrectly > fail: > msg: "subtree is set to '{{ project_subtree_path }}' but that path > does not exist in the repo. Edit `subtree_path` for '{{ site }}' in >

[ansible-project] "ERROR! module (ec2) is missing interpreter line"

2016-01-19 Thread Jim Razmus II
I'm running a simple play to create an ec2 instance and encountering the error mentioned in the subject. Something must be wrong with my setup but I don't know what it could be. I'm running Ansible from a clone of the repo on github. I've sourced the hacking/env_setup file and have many

Re: [ansible-project] when conditional failing to skip a task on string comparison (2.0)

2016-01-19 Thread Matt Martz
You are explicitly checking that project_subtree_path is the string value of "False", and not the boolean False. I would likely recommend making that part of the check look like: when: project_subtree_path|bool and not project_subtree_full_path.stat.exists On Tue, Jan 19, 2016 at 9:37 AM,

[ansible-project] Re: when conditional failing to skip a task on string comparison (2.0)

2016-01-19 Thread Eduardo Esclapés Giménez
Hi, thanks for your responses, That variable is supposed to hold a string and 'False' meant that it was not applicable. Probably a bad choice. I guess using an empty string would make more sense in this case, right? El martes, 19 de enero de 2016, 16:41:21 (UTC+1), Eduardo Esclapés Giménez

[ansible-project] Re: For 2.0 How to test if variable set to null in when clause

2016-01-19 Thread Michael Baydoun
when: ansible_host still caused the set_fact to execute when it was not present / null However, the other suggestions worked great, thanks! > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

Re: [ansible-project] custom jinja filter inside role

2016-01-19 Thread Brian Coca
filter_plugins/file_with_custom_filter.py -- 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...@googlegroups.com. To

[ansible-project] custom jinja filter inside role

2016-01-19 Thread Hleb Valoshka
I want to add own jinja filter to my role, is it possible? If yes, where I should put it. I've tried library subdir but unsuccessfully. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails

Re: [ansible-project] ERROR! duplicate loop in task: - please explain why

2016-01-19 Thread Brian Coca
env: proxy_env? there is no such directive, i'm guessing you want: environment: "{{proxy_env}}" 2.0 is now better at validating playbooks and unlike previous versions it does not ignore incorrect entries. The error message itself seems a bit confusing, but it does point at the correct task.

Re: [ansible-project] "ERROR! module (ec2) is missing interpreter line"

2016-01-19 Thread Brian Coca
some other ec2.py is being found in the python path and ansible is trying to use it instead of the module On Tue, Jan 19, 2016 at 11:09 AM, Jim Razmus II wrote: > I'm running a simple play to create an ec2 instance and encountering the > error mentioned in the subject.

Re: [ansible-project] Problem with Playbook - one liner works

2016-01-19 Thread Arthur Francis
That's awesome Brian, it worked. Thank you for the advice! On Thursday, 14 January 2016 16:51:24 UTC, Brian Coca wrote: > > try adding gather_facts: false to avoid running the setup module (you > don't seem to need it here), also check that you don't have sudo > enabled in ansible.cfg, as the

Re: [ansible-project] "ERROR! module (ec2) is missing interpreter line"

2016-01-19 Thread Jim Razmus II
I thought the same thing so I tried mv'ing conflicting files. PYTHONPATH=/Users/jtr2/Development/github/ansible/lib: Histogram:lib jtr2$ pwd /Users/jtr2/Development/github/ansible/lib Histogram:lib jtr2$ find . -name ec2.py -print ./ansible/module_utils/ec2.py