Re: [ansible-project] ImportError: No module named six.moves

2015-05-20 Thread Toshio Kuratomi
Hmm... how does ansible figure into this? Looking at the traceback it seems like the jenkins-job tool is somehow miss-installed (it's not finding its required libraries). -Toshio On May 20, 2015 5:40 AM, "William Attwood" wrote: > > Running Ansible 1.9.1 and Vagrant 1.7.2. Recently, without co

Re: [ansible-project] Ansible coming from a Fabric perspective

2015-05-20 Thread Brian Coca
ansible does not keep state, that does not mean you cannot. You can use local facts as mentioned above or you can use callback/lookup plugins to keep your own data store up to date. I would also ping the Ansible Tower team as they are working on things in this direction. On Wed, May 20, 2015 at 2:

[ansible-project] Re: Create a varaible list conditionally from dictionary items

2015-05-20 Thread Javeria Khan
Right thanks guys. And what about using a condition that checks if my_dict contains a entry with name == name2 ? Its not a loop, just a conditional for file include so I need a one liner. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

Re: [ansible-project] Re: Create a varaible list conditionally from dictionary items

2015-05-20 Thread Shawn Ferry
On Wed, May 20, 2015 at 3:19 PM Javeria Khan wrote: > > Also, another quick question. If I was using my_dict in a task loop, could > i put a condition on: > > Right that is my example. Here it is in code when item_en is false the item is skipped. TASK: [Loop]

[ansible-project] Re: Create a varaible list conditionally from dictionary items

2015-05-20 Thread Christian Thiemann
Yes, I have that stuff in my group_vars/all and in various vars.yml files. There no special magic to it except that you have to enable the do extension in ansible.cfg. Every string variable in Ansible is fed through the templating engine: --- foobar_config_path: "/etc/foobar" foobar_foomatic_

[ansible-project] Re: Create a varaible list conditionally from dictionary items

2015-05-20 Thread Javeria Khan
Also, another quick question. If I was using my_dict in a task loop, could i put a condition on: with_items: my_dict when: item.key is defined will that work? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this gr

[ansible-project] Re: Create a varaible list conditionally from dictionary items

2015-05-20 Thread Javeria Khan
Thanks guys, Christian is your solution doable in a regular yml? I thought jinja constructs were only allowed in jinja templates? What I have is a regular .yml that defines all my variables. Shawn I believe your solution requires creating a task to loop over my_dict, I prefer to do it outside

[ansible-project] Re: Create a varaible list conditionally from dictionary items

2015-05-20 Thread Shawn Ferry
Why not something like this? do_something_with: item.name with_items: your_dict when: item.item_en == True On Wednesday, May 20, 2015 at 8:41:00 AM UTC-4, Javeria Khan wrote: > > Hi, > > I've tried searching everything but can't find a possible solution. I have > a yml that defines all my varia

Re: [ansible-project] Ansible coming from a Fabric perspective

2015-05-20 Thread J Hawkesworth
Have you considered setting local facts. You could then test for the local fact being present and then skip steps which don't need to be repeated? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop recei

Re: [ansible-project] Create a varaible list conditionally from dictionary items

2015-05-20 Thread Christian Thiemann
Matt's solution is fine (and elegant!) for simple cases like this particular one. However, I found myself needing to filter items on some more complex conditions a few times and started using the Jinja do extension to effectively turn variable assignments into arbitrary computations: my_list:

Re: [ansible-project] Ansible coming from a Fabric perspective

2015-05-20 Thread Chris Spencer
On Monday, May 11, 2015 at 1:11:32 AM UTC-4, Marcus Franke wrote: > > > Hi, > > > > > For example, in my toolkit, to ping a server I would run: > > > > fab role ping > > > > but from one of the first examples in the Ansible intro docs, it would > be: > > > > ansible all --inventory-file=in

[ansible-project] Failed to find required executable mysql

2015-05-20 Thread Albert Mikaelyan
Hey guys, All I'm trying to do, is import a schema in case a database does not exist yet ansible --version ansible 1.9.1 remote host is running centos 7 (fully updated) with mysql and mysql-python packages installed. I have found only one person with this error, but in his case, the error

[ansible-project] Re: Using Ansible for Application Deployment

2015-05-20 Thread J Hawkesworth
Yeah so vars_prompt is local to a specific play (remember here you can have multiple plays in a playbook). I'm wondering if you could, or would want to pass the prompted values to your jenkinsfetch role though? I use set_fact to set facts which aren't just true for the current host in some cas

Re: [ansible-project] Create a varaible list conditionally from dictionary items

2015-05-20 Thread Matt Martz
I think you want something like: my_list: "{{ my_dict|selectattr('item_en')|map(attribute='name')|list }}" On Tuesday, May 19, 2015, Javeria Khan wrote: > Hi, > > I've tried searching everything but can't find a possible solution. I have > a yml that defines all my variables for a playbook and

Re: [ansible-project] Ansible Tower stuck on "Host verification"

2015-05-20 Thread Timothy Gerla
Hi Andres, Can you email supp...@ansible.com with your issue? We'll be happy to help. This mailing list is primarily for Ansible open source support only, but we can help you with Tower questions directly. Thanks! -Tim On Wed, May 20, 2015 at 4:22 AM, Andres Ivanov wrote: > Hello, > > I'm tryi

[ansible-project] Re: Possible to set Serial per task ( needed when using delegate_to ) ?

2015-05-20 Thread Roman Belyakovsky
As this post is stilled in top of google search let me describe one more way for a single task that should not be done simultaneously on multiple servers: - hosts: all tasks: - name: set fact set_fact: marker: marker - name: group by marker group_by: key=

[ansible-project] ImportError: No module named six.moves

2015-05-20 Thread William Attwood
Running Ansible 1.9.1 and Vagrant 1.7.2. Recently, without code changes, and with software version updates, every job .yml file when doing a vagrant provision resulted in: stderr: Traceback (most recent call last): File "/bin/jenkins-jobs", line 6, in from jenkins_jobs.cmd import main

[ansible-project] Using Ansible for Application Deployment

2015-05-20 Thread Mike Herron
I've been using Ansible for a few years, mostly for server provisioning and configuration management. I think it's a fantastic tool. For a new project, I've also begun to attempt to use Ansible as a web application deployment tool where I would have previously used ant. However, there are a coup

Re: [ansible-project] Any way to make a task serial (or set mutex so only 1 thread run it at a time)?

2015-05-20 Thread Roman Belyakovsky
Looks like it's going to be possible in v2.0. Move tasks that should be done in 'serial: 1' mode to a separate file. Include it with items iterating over hosts in a group and set some variable to a host name. Add to files in a separate task condition to check if hostname is similar to that vari

[ansible-project] Ansible Tower stuck on "Host verification"

2015-05-20 Thread Andres Ivanov
Hello, I'm trying to learn Ansible and started with installing Ansible with Tower UI. Tried simple "Helloworld" echo task that fails on Tower but works manually through ansible-playbook. I need to connect to Host through ProxyCommand so my playbook configuration looks like this: - Hellowor

[ansible-project] use variable with a default in a role

2015-05-20 Thread fabix
I have this role (roles/dummy/tasks/main.yml) : --- - debug: var=dum_name and this playbook (test.yml) : --- - hosts: localhost vars: name: "{{ foo_name | default('boom') }}" tasks: - debug: var=name roles: - { role: dummy, dum_name: "{{ name }}" } If I define a variable "foo_nam

[ansible-project] Create a varaible list conditionally from dictionary items

2015-05-20 Thread Javeria Khan
Hi, I've tried searching everything but can't find a possible solution. I have a yml that defines all my variables for a playbook and I need to do something like the following inside of it: my_dict: - { item_en: True, name: name1, type: type1, key: value1 } - { item_en: F