[ansible-project] Check if Vagrant Server

2015-07-07 Thread Mischa ter Smitten
We use {% if ansible_virtualization_type == 'virtualbox' %} -- 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] Re: How to get item by item from the item.stdout so you can execute a command for each item on the item.stdout.

2015-07-07 Thread Esteban Freire
Hi Tom, Thanks a lot for your answer :) I already tried this yesterday but it is not working for me. Probably, I am not understanding it correctly. This is what I tried: First, I tried this task: - name: Getting the IDs for the VMs running under the user sudo: True sudo_user: oneadmin shell

[ansible-project] Re: How to get item by item from the item.stdout so you can execute a command for each item on the item.stdout.

2015-07-07 Thread Esteban Freire
This is what I tried yesterday: https://docs.ansible.com/playbooks_conditionals.html El martes, 7 de julio de 2015, 9:31:29 (UTC+2), Esteban Freire escribió: > > Hi Tom, > > Thanks a lot for your answer :) > > I already tried this yesterday but it is not working for me. Probably, I > am not unde

[ansible-project] Re: Odd "Authentication or permission failure" error with initial Ansible play

2015-07-07 Thread Anthony Green
> > > GATHERING FACTS > *** > fatal: [hostname.edu] => Authentication or permission failure. In some > cases, you may have been able to authenticate and did not have permissions > on the remote directory. Consider changing the remote

[ansible-project] ansible docker module issues

2015-07-07 Thread Anthony Green
I'm trying to recreate the following docker commands with the docker module: - name: Jenkins data directory shell: "docker create -v {{ansible_env.HOME}}/.jenkins:/var/jenkins_home --name jenkins.data jenkins" - name: Run Jenkins container shell: docker run -d -p 8080:8080 -p 5:5 --v

Re: [ansible-project] Check if Vagrant Server

2015-07-07 Thread Nigel Metheringham
The virtualisation will change depending on what vagrant provider you use - and you people may use virtualbox without vagrant. I suspect that there are a few signals that can be used to pick out vagrant - specifically I am thinking of ansible being run from vagrant provision rather than other acce

[ansible-project] Issues with Ansible Docker module

2015-07-07 Thread Anthony Green
These tasks - name: Create Jenkins data directory on host file: "path=/home/{{ansible_ssh_user}}/.jenkins state=directory mode=0777" - name: Jenkins data directory shell: "docker create -v {{ansible_env.HOME}}/.jenkins:/var/jenkins_home --name jenkins.data mediaplayout/jenkins" sudo: yes

[ansible-project] Dynamic NIC list using cobbler profile

2015-07-07 Thread Rakesh Dobariya
Hi, I wish if someonce can help me with my issue I am creating VM, but passing cobbler inventory using cobbler.py as below ansible-playbook -i /etc/ansible/cobbler.py /etc/ansible/vm.yml --e {"hostname" : "esxi.server","guestname" : "vm.name"} Below is snap for my vm.uml file vm_extra_

[ansible-project] Best practise for DTAP

2015-07-07 Thread Marcel van den Brink
Hi, I was wondering if someone has some best practises regarding a workflow using Git in a DTAP environment. It is usually the case, that you use a more experimental version of your scripts on development and test. A more stable version should be used in acceptance. Production should be fully

[ansible-project] Filter plugins

2015-07-07 Thread Valentin Fadeev
Recently I had to write templates containing somewhat long filter pipelines. Part of the logic involved lookuping current output of the pipeline in a dictionary (hostvars) and then extracting the value of a field of the resulting dictionary. In order to keep things decoupled I wrote two almost

Re: [ansible-project] Check if Vagrant Server

2015-07-07 Thread Adrià
On Tue, Jul 07, 2015 at 01:13:59PM +0100, Nigel Metheringham wrote: >The virtualisation will change depending on what vagrant provider you use >- and you people may use virtualbox without vagrant. > >I suspect that there are a few signals that can be used to pick out >vagrant - spe

Re: [ansible-project] Re: Odd "Authentication or permission failure" error with initial Ansible play

2015-07-07 Thread David Reagan
I don't remember exactly what the issue was, but are you trying to use --ask-pass (or ansible_ssh_pass) when you have ssh-key auth set up? I do that every once in a while, and Ansible tries to force password authentication, rather than try ssh-key, then drop to password auth. When that happens, a s

[ansible-project] Ansible Augeas module

2015-07-07 Thread Dimitar Hristov
Hi Guys, I'm having some issues implementing the augeas module for ansible. I'm running it on CentOS 6.6 and I have the following packages installed: augeas.x86_64 python-augeas.noarch augeas-libs.x86_64 augeas-devel.x86_64 I've added augeas.py to /usr/lib/python2.6/site-packages/ansible/modu

Re: [ansible-project] Running from Source - callbacks error

2015-07-07 Thread Ethan Merrill
Ok, can you please try this simple test and let me know if you see the same? Start with new ubuntu machine $ git clone git://github.com/ansible/ansible.git --recursive $ cd ./ansible $ sudo make install $ python >>> from ansible import callbacks Traceback (most recent call last): File "", line 1

Re: [ansible-project] Running from Source - callbacks error

2015-07-07 Thread Brian Coca
"from ansible import callbacks" is not valid in v2 On Tue, Jul 7, 2015 at 9:56 AM, Ethan Merrill wrote: > Ok, can you please try this simple test and let me know if you see the same? > > Start with new ubuntu machine > $ git clone git://github.com/ansible/ansible.git --recursive > $ cd ./ansible

Re: [ansible-project] Filter plugins

2015-07-07 Thread Brian Coca
something like: - name: find another host to join to form a cluster (e.g. Consul) set_fact: host_to_join: > {{ (groups['my_group'] | difference([inventory_hostname]) | random | intersection(hostvars.keys()) ).'ec2_private_ip_

[ansible-project] ec2_group removed egress rules for internal IPs

2015-07-07 Thread Gregory Spranger
hi there, so we had something odd happen to us and i figured i would reach out to the community for help .. so the background: 1) ansible 1.9.1 1) we have a YML data set that contains "normal" info for SGs like ingress and egress rules 2) this data rarely changes 3) we execute the ec2_group

[ansible-project] Re: ec2_group removed egress rules for internal IPs

2015-07-07 Thread Gregory Spranger
> > just some more info .. for the SG that "failed" -- we have 15 ingress > rules and 20 egress rules .. not sure if that matters .. > thanks !! -- 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] Best practise for DTAP

2015-07-07 Thread Jim Gumbley
Perhaps use a deployment pipeline? http://martinfowler.com/bliki/DeploymentPipeline.html On 7 July 2015 at 07:10, Marcel van den Brink wrote: > Hi, > > I was wondering if someone has some best practises regarding a workflow > using Git in a DTAP environment. > > It is usually the case, that you

[ansible-project] Ansible Community Meeting

2015-07-07 Thread Toshio Kuratomi
This week's Ansible Community Meeting taking place on google hangouts: https://plus.google.com/hangouts/_/e5clury3sjkdpcfbxz3yckyctub Come on out for up to two hours where you can have committers' attention to review, merge, and discuss pull requests or general development issues. -Toshio --

[ansible-project] Create Dynamic Array Based on OS?

2015-07-07 Thread Joaquin Menchaca
Hello. I am new to Ansible. Is there a way to create a dynamic array called packages. I currently have the following blow, but I would like to just have it called packages, depending on debian or redhat, and if another OS, packages is empty. vars: - packages_debian: - dash

[ansible-project] Re: Create Dynamic Array Based on OS?

2015-07-07 Thread Joaquin Menchaca
I solved it, but if there is better solution for this. vars: - packages: - dash - bash - ksh - tcsh - gawk - perl - python - php5-cli - ruby - tcl8.5 when: ansible_os_family == "Debian" - packages: - dash - bash - ksh - tcsh - gaw

[ansible-project] Dynamic Package Installs?

2015-07-07 Thread Joaquin Menchaca
Currently I have the following. tasks: - name: install the Debian packages apt: name={{ item }} state=latest with_items: "{{ packages }}" when: ansible_os_family == "Debian" - name: install the RedHat packages yum: pkg={{ item }} state=latest with_items:

Re: [ansible-project] Send playbook output to Logstash/Elasticsearch

2015-07-07 Thread David Reagan
With some work I have almost exactly what I want. See: http://pastebin.com/G819PEZY Questions: The status of that restart apache 2 task should be "CHANGED", since it actually did change during the play run. But it seems like the value for changed tasks is always "OK". Is there a way to change that

[ansible-project] Re: Dynamic Package Installs?

2015-07-07 Thread Joaquin Menchaca
Would it be possible to do something like this? tasks: - include: "tasks/{{ ansible_os_family }}.yml" I get this error ERROR: file could not read: /Users/testuser/testarea/provisioning/tasks/{{ ansible_os_family }}.yml Ansible failed to complete successfully. Any error output should be vi

[ansible-project] lookup csvfile with_items issue

2015-07-07 Thread Bart Pit
Hi! I'm struggling to get 'lookup' with 'csvfile' in combination with 'with_items' to work. I have this csv file (shortened snippet): "col1","col2" 1,"Mike" 2,"Sally" Than I also have this var: test_ids: - 1 - 2 Now I want to lookup (docs: https://docs.ansible.com/playbooks_lookups.html#

Re: [ansible-project] Running from Source - callbacks error

2015-07-07 Thread Ethan Merrill
Is there doc on how to do this in v2? The equivalent of: from ansible import callbacks from ansible import utils stats = callbacks.AggregateStats() playbook_cb = callbacks.PlaybookCallbacks(verbose=utils.VERBOSITY) runner_cb = callbacks.PlaybookRunnerCallbacks(stats, verbose=utils.VERBOSITY)

Re: [ansible-project] Running from Source - callbacks error

2015-07-07 Thread Brian Coca
no, we really never have had API docs, the changes in v2 are substantial and you'll probably need to rewrite all that, for example runner does not exist anymore. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

Re: [ansible-project] Send playbook output to Logstash/Elasticsearch

2015-07-07 Thread Brian Coca
status will be OK in both cases, you need to look at changed : true/false On Tue, Jul 7, 2015 at 2:26 PM, David Reagan wrote: > With some work I have almost exactly what I want. See: > http://pastebin.com/G819PEZY > > Questions: The status of that restart apache 2 task should be "CHANGED", > sinc

Re: [ansible-project] lookup csvfile with_items issue

2015-07-07 Thread Brian Coca
you are forcing item to be a static string, it needs to be like this: - name: read from csv file debug: msg="{{ lookup('csvfile', item + ' file=/path/to/file.csv delimiter=, col=1') }}" with_items: test_ids -- Brian Coca -- You received this message because you are subscribed to the Google

Re: [ansible-project] lookup csvfile with_items issue

2015-07-07 Thread Bart Pit
Thanks Brian! It doing something more now, that's good :) However, I now get this error: fatal: [localhost] => Failed to template msg="{{ lookup('csvfile', item + ' file=test.csv delimiter="," col=2') }}": csvfile: "delimiter" must be string , not unicode I tried quoting the comma, double and s

[ansible-project] Copy/Template modules hang on AIX - sh.py

2015-07-07 Thread Matthew Irish
I've been having issues running Ansible against AIX; specifically with the copy/template modules. Periodically, copy/template plays will hang; either for a long time (read hours, as in leave it overnight and it might be completed the next day) or indefinitely. After reviewing debug output for

Re: [ansible-project] Re: Create Dynamic Array Based on OS?

2015-07-07 Thread Brian Coca
test again, this should just make the 2nd definition overwrite the first, you can do this with include_vars: "{{ansible_os_family}}.yml" and have the definition of each in a file or you can do this: vars: - packages: Debian: - dash - bash - ksh - tcsh

Re: [ansible-project] lookup csvfile with_items issue

2015-07-07 Thread Bart Pit
For extra clarification: I started getting this error without the quotes around the comma. So like this, produces the same error: debug: msg="{{ lookup('csvfile', item + ' file=test.csv delimiter=, col=2') }}" Op dinsdag 7 juli 2015 22:57:47 UTC+2 schreef Bart Pit: > > Thanks Brian! It doing s

Re: [ansible-project] Send playbook output to Logstash/Elasticsearch

2015-07-07 Thread David Reagan
Ah, that makes sense. Thanks! --David Reagan On Tue, Jul 7, 2015 at 1:19 PM, Brian Coca wrote: > status will be OK in both cases, you need to look at changed : true/false > > On Tue, Jul 7, 2015 at 2:26 PM, David Reagan wrote: > > With some work I have almost exactly what I want. See: > > http

[ansible-project] How to use cached facts inside ansible module and caching custom facts

2015-07-07 Thread Yasir Saleem
Hi, I am writing module that validates host facts(large number of them) with inventory database for audit and monitoring purposes. I have couple of questions in this regard: 1. Is there a way to cache custom facts? 2. Is there an API to use cached or ansible gathered facts inside module?

Re: [ansible-project] How to use cached facts inside ansible module and caching custom facts

2015-07-07 Thread Brian Coca
1. they are cached with rest of facts 2. no On Tue, Jul 7, 2015 at 7:30 PM, Yasir Saleem wrote: > Hi, >I am writing module that validates host facts(large number of them) with > inventory database for audit and monitoring purposes. I have couple of > questions in this regard: > > 1. Is there