[ansible-project] Re: Create Dynamic Array Based on OS?
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 - gawk - perl - python - php-cli - ruby - tcl when: ansible_os_family == RedHat -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5c437beb-1103-4b53-a2b7-b0d590b0c475%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Ansible Community Meeting
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 -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAG9juErtbJ6KHhf7eVTCAVmgVd9YWOrZh_i9jO0VrXN-dcDg2w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Best practise for DTAP
Perhaps use a deployment pipeline? http://martinfowler.com/bliki/DeploymentPipeline.html On 7 July 2015 at 07:10, Marcel van den Brink marcel.vandenbr...@gmail.com 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 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 stable. So my question is, how do you handle changes going through DTAP? Cheers, -- Marcel -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/11663bc4-679e-4fd2-a10b-e69e39f90c09%40googlegroups.com https://groups.google.com/d/msgid/ansible-project/11663bc4-679e-4fd2-a10b-e69e39f90c09%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- *Jim Gumbley**Lead Consultant**Telephone+44 7521 266838* [image: ThoughtWorks] http://www.thoughtworks.com/ -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOiJUp-wb_56ahRiTxua_v8SHbn9KQqaGw-GWDPm0zbFWrmOgw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[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.
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: onevm list | grep {{ item.value.login_name }} | awk 'BEGIN {FS= }{print $1}' with_dict: disable_users_account register: VMIDs_per_user ignore_errors: yes tags: - delete_VMs - name: Delete the VMs running under the user sudo: True sudo_user: oneadmin command: onevm delete {{ item }} with_items: {{VMIDs_per_user.stdout_lines}} tags: - delete_VMs But I got the following error: ansible-playbook -i inventory/production site.yml -vvv --limit opennebula --tags=delete_VMs Traceback (most recent call last): File /usr/bin/ansible-playbook, line 324, in module sys.exit(main(sys.argv[1:])) File /usr/bin/ansible-playbook, line 264, in main pb.run() File /usr/lib/python2.7/site-packages/ansible/playbook/__init__.py, line 310, in run play = Play(self, play_ds, play_basedir, vault_password=self.vault_password) File /usr/lib/python2.7/site-packages/ansible/playbook/play.py, line 194, in __init__ self._tasks = self._load_tasks(self._ds.get('tasks', []), load_vars) File /usr/lib/python2.7/site-packages/ansible/playbook/play.py, line 669, in _load_tasks loaded = self._load_tasks(data, mv, role_params, default_vars, included_become_vars, list(included_additional_conditions), original_file=include_filename, role_name=new_role) File /usr/lib/python2.7/site-packages/ansible/playbook/play.py, line 650, in _load_tasks (k,v) = t.split(=, 1) ValueError: need more than 1 value to unpack Also tried with stdout split, I don't remember now the exactly thing that I tried it but it did not work. This is my ansible version: ansible --version ansible 1.9.1 configured module search path = None Thanks in advance, Esteban El lunes, 6 de julio de 2015, 22:59:14 (UTC+2), Tom Paine escribió: https://docs.ansible.com/playbooks_loops.html#iterating-over-the-results-of-a-program-execution -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/502864e3-a9e3-4b66-a09f-84c335f41124%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Check if Vagrant Server
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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8a4ba6c6-98c2-4989-ba63-203b0d79eaf0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Dynamic Package Installs?
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: {{ packages }} when: ansible_os_family == RedHat Is there anyway to have one task? I have packages array dynamically created. I wish at least I can just have tasks completely ignored if it is on the wrong OS, so it won't be included -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/02f37300-db62-4f70-87ec-8a175aa7c388%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Send playbook output to Logstash/Elasticsearch
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? --David Reagan On Mon, Jul 6, 2015 at 5:37 PM, David Reagan jer...@gmail.com wrote: The default log_plays doesn't actually output all the information I need. I have lots of stuff going to syslog and then into ELK already, but in this case, I figured I'd just let logstash-forwarder watch the ansible log file. Then format the output so that logstash doesn't have to filter it at all. Currently, I figured out how to get valid json out per line. But I'm stuck figuring out how to get the task name, the role name, and the command line command information. Are there global vars I can reference from the plugin? Where could I find a list of them? --David Reagan On Mon, Jul 6, 2015 at 5:25 PM, Brian Coca bc...@ansible.com wrote: log_plays was designed to drop the json to syslog-ng which would then push it to elastic search w/o need for logstash, probably easier to just setup syslog-ng to do the same. -- Brian Coca -- You received this message because you are subscribed to a topic in the Google Groups Ansible Project group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/zOjsYxLN578/unsubscribe . To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8n722sXnV547ZCjrTxBeaDQOqxzxQ1QEs0fYeq5AuQ6Sg%40mail.gmail.com . For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CANo%2B_AfMFvypiqYdFWbOopLNNa3yx_Y-vxQBmY%2BHiY85fYCSYg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Re: Dynamic Package Installs?
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 visible above. Please fix these errors and try again. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3113fc47-edcd-49cf-923b-874194b744ec%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] lookup csvfile with_items issue
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#the-csv-file-lookup) the values in the second column of the csv file: - name: read from csv file debug: msg={{ lookup('csvfile', 'item file=/path/to/file.csv delimiter=, col=1') }} with_items: test_ids Where 'item' before file=/... should output 1 and 2 right?? This doesn't work, output is: TASK: [client-setup | read from csv file] ok: [localhost] = (item=1) = { item: 1, msg: [] } ok: [localhost] = (item=2) = { item: 2, msg: [] } As you can see it recognizes 1 and 2, but I don't get the values of the second column in the csv. If I hardcode the number in like so: - name: read from csv file debug: msg={{ lookup('csvfile', '1 file=test.csv delimiter=, col=1') }} with_items: test_ids It does give me the correct result: TASK: [client-setup | read from csv file] ok: [localhost] = (item=1) = { item: 1, msg: Mike } ok: [localhost] = (item=2) = { item: 2, msg: Mike } I tried quoting the var with '1' and '2', but that doesn't work either. Is this a bug or am I doing something wrong? -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4d6c6057-b0a5-4ed4-91f1-ac179f99655f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Running from Source - callbacks error
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) On Tuesday, July 7, 2015 at 10:01:41 AM UTC-4, Brian Coca wrote: from ansible import callbacks is not valid in v2 On Tue, Jul 7, 2015 at 9:56 AM, Ethan Merrill ekme...@gmail.com javascript: 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 $ sudo make install $ python from ansible import callbacks Traceback (most recent call last): File stdin, line 1, in module ImportError: cannot import name callbacks On Monday, July 6, 2015 at 4:28:42 PM UTC-4, Brian Coca wrote: we have not finished porting allt he callbacks, the API has changed a bit, but the default ones used by ansible and ansible-playbook should be there On Mon, Jul 6, 2015 at 4:25 PM, Ethan Merrill ekme...@gmail.com wrote: I see plugins/callback (notice it's singular) and the contents don't appear to be the same as the callbacks py/pyc files from earlier. Ethan On Monday, July 6, 2015 at 4:16:22 PM UTC-4, Brian Coca wrote: they should be under plugins/callbacks On Mon, Jul 6, 2015 at 3:39 PM, Ethan Merrill ekme...@gmail.com wrote: Hi... I just setup a new ubuntu system to run from source using the sudo make install command. When I try to run scripts that use from ansible import callbacks Python gives an error that callbacks doesn't exist. If I just try running the following from the command line I get the same: vagrant@precise64:~/ansible$ python Python 2.7.3 (default, Jun 22 2015, 19:33:41) [GCC 4.6.3] on linux2 Type help, copyright, credits or license for more information. from ansible import callbacks Traceback (most recent call last): File stdin, line 1, in module ImportError: cannot import name callbacks However importing other things like ansible utils does work. I notice that there are no longer any callback py or pyc files in /usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible/: vagrant@precise64:/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible$ ll total 112 drwxr-sr-x 18 root staff 4096 Jul 6 19:32 ./ drwxr-sr-x 4 root staff 4096 Jul 6 19:32 ../ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 cli/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 compat/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 config/ -rwxr-xr-x 1 root staff 15580 Jul 6 19:32 constants.py* -rw-r--r-- 1 root staff 13616 Jul 6 19:32 constants.pyc drwxr-sr-x 2 root staff 4096 Jul 6 19:32 errors/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 executor/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 galaxy/ -rwxr-xr-x 1 root staff 765 Jul 6 19:32 __init__.py* -rw-r--r-- 1 root staff 242 Jul 6 19:32 __init__.pyc drwxr-sr-x 3 root staff 4096 Jul 6 19:32 inventory/ drwxr-sr-x 4 root staff 4096 Jul 6 19:32 modules/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 module_utils/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 new_inventory/ drwxr-sr-x 5 root staff 4096 Jul 6 19:32 parsing/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 playbook/ drwxr-sr-x 12 root staff 4096 Jul 6 19:32 plugins/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 template/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 utils/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 vars/ vagrant@precise64:/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible$ Are callbacks being referenced differently now? Ethan -- 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-proje...@googlegroups.com. To post to this group, send email to ansible...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/daf6990b-e940-4096-ad97-9256a1a7d509%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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-proje...@googlegroups.com. To post to this group, send
[ansible-project] Create Dynamic Array Based on OS?
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 - bash - ksh - tcsh - gawk - perl - python - php5-cli - ruby - tcl8.5 - packages_redhat: - dash - bash - ksh - tcsh - gawk - perl - python - php-cli - ruby - tcl -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7d63e3bb-f87a-4c5e-878e-263e13cd93cc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Send playbook output to Logstash/Elasticsearch
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 jer...@gmail.com 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, 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? --David Reagan On Mon, Jul 6, 2015 at 5:37 PM, David Reagan jer...@gmail.com wrote: The default log_plays doesn't actually output all the information I need. I have lots of stuff going to syslog and then into ELK already, but in this case, I figured I'd just let logstash-forwarder watch the ansible log file. Then format the output so that logstash doesn't have to filter it at all. Currently, I figured out how to get valid json out per line. But I'm stuck figuring out how to get the task name, the role name, and the command line command information. Are there global vars I can reference from the plugin? Where could I find a list of them? --David Reagan On Mon, Jul 6, 2015 at 5:25 PM, Brian Coca bc...@ansible.com wrote: log_plays was designed to drop the json to syslog-ng which would then push it to elastic search w/o need for logstash, probably easier to just setup syslog-ng to do the same. -- Brian Coca -- You received this message because you are subscribed to a topic in the Google Groups Ansible Project group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/zOjsYxLN578/unsubscribe. To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8n722sXnV547ZCjrTxBeaDQOqxzxQ1QEs0fYeq5AuQ6Sg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CANo%2B_AfMFvypiqYdFWbOopLNNa3yx_Y-vxQBmY%2BHiY85fYCSYg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8nvqO_3HKZmfBD_NhxW6nY7mfoZHPCuZTfz%2B2QiRM1QJQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] lookup csvfile with_items issue
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 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kA-VLXAuQ9F5VH5L8CnCk0rkQowFtcHD2fW9Nju6-9qg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Copy/Template modules hang on AIX - sh.py
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 a number of these instances, it appears to be an issue that occurs in the sh.py code under runner. The problem is in the 'checksum' function. Below is an example debug output of where the copy/template module will hang: aix14.mgmt.loc EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 aix14.mgmt.loc /bin/sh -c 'sudo -k sudo -H -S -p [sudo via ansible, key=sfknwylttinwgjiawaunhugtrjbqdymg] password: -u root /bin/sh -c '''echo SUDO-SUCCESS-sfknwylttinwgjiawaunhugtrjbqdymg; rc=flag; [ -r /etc/ntp.conf ] || rc=2; [ -f /etc/ntp.conf ] || rc=1; [ -d /etc/ntp.conf ] rc=3; python -V 2/dev/null || rc=4; [ x$rc != xflag ] echo ${rc} /etc/ntp.conf exit 0; (python -c 'import hashlib; print(hashlib.sha1(open(/etc/ntp.conf, rb).read()).hexdigest())' 2/dev/null) || (python -c 'import sha; print(sha.sha(open(/etc/ntp.conf, rb).read()).hexdigest())' 2/dev/null) || (echo 0 /etc/ntp.conf) This will happen during random copy/template plays, not necessarily for the same file as in the example above. The issue is reproducible, but not consistently; 1 in 5 runs or more may have the issue. It appears that the file actually copies over successfully, and then the session hangs. If I run a who -u on the AIX host, and kill pid the pid of the SSH session, the playbook will continue on. I can confirm this happens using SFTP, and with scp_if_ssh = True. It also happens with pipelining = True configured. After digging about on the interwebs, I have found a handful references to issues with the version of python included by IBM as part of the Linux-for-AIX toolbox. The version we're using is from http://www.perzl.org/aix/, which doesn't suffer the same issues (see https://github.com/ansible/ansible-modules-core/issues/80). I tried substituting 'hashlib.sha1' with 'hashlib._md5', and was able to reproduce the same hanging issue. As part of some references online to other folks using Ansible to manage AIX, I've symlink'd /bin/md5sum to /bin/csum; this also did not fix our issues. I can also periodically reproduce the issue when running a single ad-hoc ansible command using the copy module. Below is a truss output from an AIX box where this issue occurs; this is a truss against the ssh process of the user connected in from Ansible. I'm by no means an expert at debugging truss output, however, it appears that the /bin/sh is called, then it forks off a subprocess, which right away sends a SIGCHLD, and then the process hangs with close(8) (sleeping...). This is where it will hang for a loggg time. The PID that gets forked off (24379542 in the example below), ends up in a 'defunct' state. kwrite(4, \0\00304 / b i n / s h .., 776)= 776 kfcntl(7, F_DUPFD, 0x) = 9 kfcntl(7, F_DUPFD, 0x) = 10 sigprocmask(0, 0xF02B4970, 0xF02B4978) = 0 kfork() = 24379542 thread_setmymask_fast(0x, 0x, 0x, 0xD052A400, 0x, 0x11 960029, 0x) = 0x Received signal #20, SIGCHLD [caught] sigprocmask(2, 0xF02B4970, 0x2FF21E80) = 0 _sigaction(20, 0x, 0x2FF21F30) = 0 thread_setmymask_fast(0x0008, 0x, 0x, 0x11960029, 0x0003, 0x00 00, 0x) = 0x kwrite(6, \0, 1) = 1 ksetcontext_sigreturn(0x2FF21FE0, 0x2FF22FF8, 0x2002D0D0, 0xD032, 0x0003, 0x00 00, 0x) close(8)(sleeping...) In the interest of disclosing all information, I also notice weird behavior with the 'w' command when trying to determine if Ansible has an SSH session open on a host where a playbook is hanging. The 'w' command will hang for a few seconds when it hits the user logged in and running the Ansible playbook. When I run a truss against the 'w' command, I get the output below. the command is getting the status of the user's pts, then it gets a SIGALRM, which apparently means the system call is taking too long to respond: kopen(/dev/pts/4, O_RDONLY|O_NONBLOCK) (sleeping...) kopen(/dev/pts/4, O_RDONLY|O_NONBLOCK)Err#4 EINTR Received signal #14, SIGALRM [caught] _sigaction(14, 0x0FFFEEB0, 0x0FFFEEE0) = 0 ksetcontext_sigreturn(0x0000, 0x, 0x0FE8, 0x8000D032, 0x3FFC0003,
Re: [ansible-project] lookup csvfile with_items issue
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 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 single. And tried the approach in this thread, both single and double: https://groups.google.com/forum/#!topic/ansible-project/r2L3UONwaN0 like so: debug: msg={{ lookup('csvfile', item + ' file=test.csv delimiter=',' col=2') }} But also doesn't work. Any ideas? Op dinsdag 7 juli 2015 22:23:18 UTC+2 schreef 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 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2a8ec8d9-a545-4ac6-8192-a7eb638ea8c7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] lookup csvfile with_items issue
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 single. And tried the approach in this thread, both single and double: https://groups.google.com/forum/#!topic/ansible-project/r2L3UONwaN0 like so: debug: msg={{ lookup('csvfile', item + ' file=test.csv delimiter=',' col=2') }} But also doesn't work. Any ideas? Op dinsdag 7 juli 2015 22:23:18 UTC+2 schreef 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 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a5a39b91-5c6d-4b82-9766-4da3d6aa1639%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Filter plugins
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_address' }} On Tue, Jul 7, 2015 at 6:39 AM, Valentin Fadeev fadeevvalen...@gmail.com wrote: 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 trivial plugins. Here an example: - name: find another host to join to form a cluster (e.g. Consul) set_fact: host_to_join: {{ groups['my_group'] | difference([inventory_hostname]) | list | random | find_in(hostvars) | get_key('ec2_private_ip_address') }} Just wondering whether there are other existing ways of achieving the same result, with/without plugins, as surely someone must have faced a similar task. Thanks Valentin -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0b9c36de-08e3-41df-a21c-1d2e8df19e1b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kd3S_%3D-jyZLa2-x0fAkE%2B-V6Psu-u%3Dn83KN9eDiywG4w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] ec2_group removed egress rules for internal IPs
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 command on a regular basis since it is part of our normal ansible runs (4 times a day) so this is where it starts to get weird .. our SGs show changed on a regular basis, since we do NOT allow ALL to cidr_ip 0.0.0.0/0 for egress rules .. in the ansible code, i *THINK* you will see that this is part of the default data: https://github.com/ansible/ansible-modules-core/blob/devel/cloud/amazon/ec2_group.py (lines ~305 ?? possibly 409ish ??).. so since we don't allow this egress rule, ansible thinks the SG has changed when in fact it has not -- and issues a changed command on every run .. for example: changed: [localhost] = (item={'rules': [{'to_port': 5666, 'from_port': 5666, 'group_name': '1-admin', 'proto': 'tcp'}, ...], 'rules_egress': [{'to_port': 'all', 'from_port': 'all', 'cidr_ip': '10.137.0.0/16', 'proto': 'all'}, ...], 'name': '1-base-zero', 'description': 'Default global SG to be attached to all EC2 instances'}) this is kind of not cool since it shows as changed when it has not .. but since no real change happened, AWS Config does not view it as a change .. i think there is a feature idea out there for this: https://github.com/ansible/ansible/issues/11249 so then .. here is what happened .. we were minding our own business ansible ran at 10AM, it did it's normal SG business -- no issues .. it ran again at 12PM, and BAM !! egress rules from an important SG ( prolly our most important SG) were removed .. what is even more odd is that the output of the run that was successful at 10AM was identical to the output of the run at 12PM .. the same changed output i alluded to earlier .. but AWS Config revealed all kinds of nastiness .. it showed that we did this: https://lh3.googleusercontent.com/-s6bethAkASA/VZvs7yCKvJI/AMI/LOcW7O0Pu90/s1600/egress.png i will say the one odd thing we do that stands out in my mind is we do this as part of our data set for egress rules: - proto: icmp from_port: -1 to_port: -1 cidr_ip: 0.0.0.0/0 other than a few comments we add in to the array, it all is pretty normal .. so .. any ideas about WTF happened ?? we are reaching out to AWS for support as well but no info to share there yet .. thanks for any help you can offer .. NOTE: this has only happened once like in 50+ executions .. we re-ran the exact same ansible play to fix what was broken .. so that even adds more weirdness to it -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3ca3543b-f379-48c9-9326-06fdf87b48c8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Re: ec2_group removed egress rules for internal IPs
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 receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b847946d-18e4-4bbb-885c-79aae0b1fc63%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] How to use cached facts inside ansible module and caching custom facts
1. they are cached with rest of facts 2. no On Tue, Jul 7, 2015 at 7:30 PM, Yasir Saleem yasir...@gmail.com 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 a way to cache custom facts? 2. Is there an API to use cached or ansible gathered facts inside module? Thanks, Yasir. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/936e9add-caa3-449c-8719-159fd1c01774%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kJGAbXjjAYVN0xTD0Z-%3DEKgwxptA4cD%2BRXD8WENiA7mw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Check if Vagrant Server
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 access to a vagrant produced box:- * the ssh user is likely to be vagrant * there are probably some magic environment variables * the vagrant provided hosts file seems to have some magic in it Nigel. Mischa ter Smitten mailto:mis...@tersmitten.nl 7 July 2015 08:16 We use {% if ansible_virtualization_type == 'virtualbox' %} Phill Pafford mailto:phillpaff...@gmail.com 6 July 2015 17:33 Is there something I can check to see if the playbook is being executed on a vagrant server? Example: If vagrant run this additional role or If vagrant skip this role Thoughts on how I can do this? -- 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 mailto:ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com mailto:ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/44224986-111d-4c79-9c87-56f59353adc8%40googlegroups.com https://groups.google.com/d/msgid/ansible-project/44224986-111d-4c79-9c87-56f59353adc8%40googlegroups.com?utm_medium=emailutm_source=footer. For more options, visit https://groups.google.com/d/optout. -- [ Nigel Metheringham -- ni...@dotdot.it ] [ Ellipsis Intangible Technologies ] -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/559BC287.7020809%40dotdot.it. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Dynamic NIC list using cobbler profile
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_config: vcpu.hotadd: yes mem.hotadd: yes notes: This is a test VM vm_disk: disk1: size_gb: {{ host.virt_file_size }} type: thin datastore: datastore1 vm_nic: nic1: type: vmxnet3 network: VM Network network_type: standard macaddress: {{ host.interfaces.eth0.mac_address }} All variables are available... I am stuck in configuring nic. My cobbler profiles have 3 nics so is there any way to loop for nic1, nic2 like wise??? -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9bae599c-8079-4c7d-9c0a-31b0dc4217ae%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Best practise for DTAP
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 stable. So my question is, how do you handle changes going through DTAP? Cheers, -- Marcel -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/11663bc4-679e-4fd2-a10b-e69e39f90c09%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Filter plugins
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 trivial plugins https://gist.github.com/ValFadeev/9bf421fc1262c9ec7e31. Here an example: - name: find another host to join to form a cluster (e.g. Consul) set_fact: host_to_join: {{ groups['my_group'] | difference([inventory_hostname]) | list | random | find_in(hostvars) | get_key('ec2_private_ip_address') }} Just wondering whether there are other existing ways of achieving the same result, with/without plugins, as surely someone must have faced a similar task. Thanks Valentin -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0b9c36de-08e3-41df-a21c-1d2e8df19e1b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Issues with Ansible Docker module
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 - name: Run Jenkins container shell: docker run -d -p 8080:8080 -p 5:5 --volumes-from jenkins.data --name jenkins.master mediaplayout/jenkins sudo: yes generates a docker container with a volume that is shared with the host at ~/.jenkins These tasks: - name: Create Jenkins data directory on host file: path=/home/{{ansible_ssh_user}}/.jenkins state=directory mode=0777 - name: Jenkins data directory docker: name: jenkins.data image: mediaplayout/jenkins state: present volumes: /home/{{ansible_ssh_user}}/.jenkins:/var/jenkins_home sudo: yes - name: Start Jenkins container docker: name: jenkins.master image: mediaplayout/jenkins pull: always state: started volumes_from: - 'jenkins.data' ports: - 8080:8080 - 5:5 sudo: yes don't shared the directory at that location Is the second playbook correct or is there a issue with the Ansible docker module? -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d5b185ee-19ad-4343-aa77-d701d2fc6041%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] ansible docker module issues
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 --volumes-from jenkins.data --name jenkins.master jenkins I've tried - name: Jenkins data directory docker: name: jenkins.data image: jenkins state: present volumes: /home/{{ansible_ssh_user}}/.jenkins:/var/jenkins_home sudo: yes - name: Start Jenkins container docker: name: jenkins.master image: mediaplayout/jenkins pull: always state: started volumes_from: - 'jenkins.data' ports: - 8080:8080 - 5:5 sudo: yes but it doesn't work Where am I going wrong? -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/76f3c4d9-3c8e-4143-9a4d-36ab5dbbee57%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Running from Source - callbacks error
from ansible import callbacks is not valid in v2 On Tue, Jul 7, 2015 at 9:56 AM, Ethan Merrill ekmer...@gmail.com 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 $ sudo make install $ python from ansible import callbacks Traceback (most recent call last): File stdin, line 1, in module ImportError: cannot import name callbacks On Monday, July 6, 2015 at 4:28:42 PM UTC-4, Brian Coca wrote: we have not finished porting allt he callbacks, the API has changed a bit, but the default ones used by ansible and ansible-playbook should be there On Mon, Jul 6, 2015 at 4:25 PM, Ethan Merrill ekme...@gmail.com wrote: I see plugins/callback (notice it's singular) and the contents don't appear to be the same as the callbacks py/pyc files from earlier. Ethan On Monday, July 6, 2015 at 4:16:22 PM UTC-4, Brian Coca wrote: they should be under plugins/callbacks On Mon, Jul 6, 2015 at 3:39 PM, Ethan Merrill ekme...@gmail.com wrote: Hi... I just setup a new ubuntu system to run from source using the sudo make install command. When I try to run scripts that use from ansible import callbacks Python gives an error that callbacks doesn't exist. If I just try running the following from the command line I get the same: vagrant@precise64:~/ansible$ python Python 2.7.3 (default, Jun 22 2015, 19:33:41) [GCC 4.6.3] on linux2 Type help, copyright, credits or license for more information. from ansible import callbacks Traceback (most recent call last): File stdin, line 1, in module ImportError: cannot import name callbacks However importing other things like ansible utils does work. I notice that there are no longer any callback py or pyc files in /usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible/: vagrant@precise64:/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible$ ll total 112 drwxr-sr-x 18 root staff 4096 Jul 6 19:32 ./ drwxr-sr-x 4 root staff 4096 Jul 6 19:32 ../ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 cli/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 compat/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 config/ -rwxr-xr-x 1 root staff 15580 Jul 6 19:32 constants.py* -rw-r--r-- 1 root staff 13616 Jul 6 19:32 constants.pyc drwxr-sr-x 2 root staff 4096 Jul 6 19:32 errors/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 executor/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 galaxy/ -rwxr-xr-x 1 root staff 765 Jul 6 19:32 __init__.py* -rw-r--r-- 1 root staff 242 Jul 6 19:32 __init__.pyc drwxr-sr-x 3 root staff 4096 Jul 6 19:32 inventory/ drwxr-sr-x 4 root staff 4096 Jul 6 19:32 modules/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 module_utils/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 new_inventory/ drwxr-sr-x 5 root staff 4096 Jul 6 19:32 parsing/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 playbook/ drwxr-sr-x 12 root staff 4096 Jul 6 19:32 plugins/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 template/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 utils/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 vars/ vagrant@precise64:/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible$ Are callbacks being referenced differently now? Ethan -- 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-proje...@googlegroups.com. To post to this group, send email to ansible...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/daf6990b-e940-4096-ad97-9256a1a7d509%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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-proje...@googlegroups.com. To post to this group, send email to ansible...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e4229b86-0dc0-47f3-aaf0-17677bfb17a7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit
[ansible-project] Ansible Augeas module
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/modules/custom and when I run my playbook I get the following error: msg: Could not import python augeas module. Please install augeas related packages and augeas python bindings. Any ideas what am I missing? Regards, Dimitar -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7d88d48e-7ca7-4d93-a480-d9f3f6f06e1b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Check if Vagrant Server
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 - specifically I am thinking of ansible being run from vagrant provision rather than other access to a vagrant produced box:- I assume that below solution isn't the most elegant one, but what about it? - name: Check if I'm in a vagrant environment stat: path=/vagrant/Vagrantfile register: checkVagrant - name: Let's do something if Vagrant is here debug: msg=do something here when: checkVagrant.stat.exists -- Adrià García-Alzórriz 0x09494C14 Una retirada a tiempo es una victoria. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20150707124544.GA3968%40gmail.com. For more options, visit https://groups.google.com/d/optout. signature.asc Description: Digital signature
Re: [ansible-project] Running from Source - callbacks error
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 stdin, line 1, in module ImportError: cannot import name callbacks On Monday, July 6, 2015 at 4:28:42 PM UTC-4, Brian Coca wrote: we have not finished porting allt he callbacks, the API has changed a bit, but the default ones used by ansible and ansible-playbook should be there On Mon, Jul 6, 2015 at 4:25 PM, Ethan Merrill ekme...@gmail.com javascript: wrote: I see plugins/callback (notice it's singular) and the contents don't appear to be the same as the callbacks py/pyc files from earlier. Ethan On Monday, July 6, 2015 at 4:16:22 PM UTC-4, Brian Coca wrote: they should be under plugins/callbacks On Mon, Jul 6, 2015 at 3:39 PM, Ethan Merrill ekme...@gmail.com wrote: Hi... I just setup a new ubuntu system to run from source using the sudo make install command. When I try to run scripts that use from ansible import callbacks Python gives an error that callbacks doesn't exist. If I just try running the following from the command line I get the same: vagrant@precise64:~/ansible$ python Python 2.7.3 (default, Jun 22 2015, 19:33:41) [GCC 4.6.3] on linux2 Type help, copyright, credits or license for more information. from ansible import callbacks Traceback (most recent call last): File stdin, line 1, in module ImportError: cannot import name callbacks However importing other things like ansible utils does work. I notice that there are no longer any callback py or pyc files in /usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible/: vagrant@precise64:/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible$ ll total 112 drwxr-sr-x 18 root staff 4096 Jul 6 19:32 ./ drwxr-sr-x 4 root staff 4096 Jul 6 19:32 ../ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 cli/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 compat/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 config/ -rwxr-xr-x 1 root staff 15580 Jul 6 19:32 constants.py* -rw-r--r-- 1 root staff 13616 Jul 6 19:32 constants.pyc drwxr-sr-x 2 root staff 4096 Jul 6 19:32 errors/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 executor/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 galaxy/ -rwxr-xr-x 1 root staff 765 Jul 6 19:32 __init__.py* -rw-r--r-- 1 root staff 242 Jul 6 19:32 __init__.pyc drwxr-sr-x 3 root staff 4096 Jul 6 19:32 inventory/ drwxr-sr-x 4 root staff 4096 Jul 6 19:32 modules/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 module_utils/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 new_inventory/ drwxr-sr-x 5 root staff 4096 Jul 6 19:32 parsing/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 playbook/ drwxr-sr-x 12 root staff 4096 Jul 6 19:32 plugins/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 template/ drwxr-sr-x 3 root staff 4096 Jul 6 19:32 utils/ drwxr-sr-x 2 root staff 4096 Jul 6 19:32 vars/ vagrant@precise64:/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/ansible$ Are callbacks being referenced differently now? Ethan -- 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-proje...@googlegroups.com. To post to this group, send email to ansible...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/daf6990b-e940-4096-ad97-9256a1a7d509%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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-proje...@googlegroups.com javascript:. To post to this group, send email to ansible...@googlegroups.com javascript:. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e4229b86-0dc0-47f3-aaf0-17677bfb17a7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit