[ansible-project] Re: How to use hosts listed in a group in a template, excluding the current host.

2014-07-14 Thread John Wang
I know it should be simple, but never imagine it is s simple. Thanks guys. -- 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...@go

Re: [ansible-project] Absolute path for playbook.basedir + vars.playbook_path

2014-07-14 Thread Michael DeHaan
If you'd like to get something reviewed, definitely submit a pull request - though I'd like to see this without the extraneous whitespace changes that complicate the diff and code attribution. My gut feeling is that rather than doing the "x or y", os.path.abspath just needs to be called on the pat

[ansible-project] Absolute path for playbook.basedir + vars.playbook_path

2014-07-14 Thread Nick Shobe
Hey I've been doing some lookup() local command jank to get the absolute directory path to my playbook where I store some additional non role specific config files... plabook_basedir/files/playbookspecific.tar.gz. I then pass that path in to my various roles that require the centrally located

[ansible-project] Design advice?

2014-07-14 Thread Nico K.
Hi, First off I wanted to say that I've been using Ansible for a while now and so far I'm really pleased with it. The product is powerful and flexible and the community is alive and helpful. I was hoping that some of you might be able to share your insights on how to best approach the following

Re: [ansible-project] Re: shell/command json output into variables

2014-07-14 Thread Stuart Reynolds
On Monday, July 14, 2014 12:39:23 PM UTC-7, Michael DeHaan wrote: > > well it does return content already, all the stdout and such. > I see -- but I don't see how to usefully use that in subsequent tasks (beyond debug). I can do: register: result=std_out|to_json Or some such? > I think wha

Re: [ansible-project] Configuring AWS metric alarm using newly created scaling policy ARN

2014-07-14 Thread Claire Lee
D'oh, looks like I was still on 1.6.6. Using the devel branch now and it works, thanks! On Monday, July 14, 2014 2:10:35 PM UTC-5, James Cammarata wrote: > > What version of Ansible are you running? The above PR was merged into > devel and will be included in 1.7, however it is not yet available

Re: [ansible-project] Re: lineinfile module replace only if line is present, do not add

2014-07-14 Thread Ming Qian
Thanks! On Mon, Jul 14, 2014 at 4:38 PM, Michael DeHaan wrote: > Then perhaps we have an answer :) > > If you don't see a related issue in github please do file one. > > Thank you! > > > > > On Mon, Jul 14, 2014 at 4:14 PM, Ming Qian wrote: > >> Thanks for your quick reply! >> I tried ansibl

Re: [ansible-project] Re: lineinfile module replace only if line is present, do not add

2014-07-14 Thread Michael DeHaan
Then perhaps we have an answer :) If you don't see a related issue in github please do file one. Thank you! On Mon, Jul 14, 2014 at 4:14 PM, Ming Qian wrote: > Thanks for your quick reply! > I tried ansible 1.7 (devel 5e27f12ada). > It would appear that the problem still exists. > > Thanks!

Re: [ansible-project] Re: lineinfile module replace only if line is present, do not add

2014-07-14 Thread Ming Qian
Thanks for your quick reply! I tried ansible 1.7 (devel 5e27f12ada). It would appear that the problem still exists. Thanks! On Monday, July 14, 2014 3:10:01 PM UTC-4, Michael DeHaan wrote: > > Your version of Ansible is rather downlevel. > > If you have a problem in 1.6.6 (the latest) let us kn

Re: [ansible-project] Re: Starting Openstack VMs in parallel

2014-07-14 Thread Michael DeHaan
Minor process note: If you're going to submit the code to try, don't open the feature requests, just clutters up the queue. If you aren't, opening an RFE usually doesn't mean the code fairies implement it anyway, since we're likely going to attend to existing bug reports/PRs and feature PRs first

Re: [ansible-project] Re: shell/command json output into variables

2014-07-14 Thread Michael DeHaan
well it does return content already, all the stdout and such. I think what you are saying is that have a flag that if the output of the command is already JSON and you requested this behavior, return the JSON datastructure in an element called "json"? I'm somewhat open to it, but also think that

Re: [ansible-project] Re: Starting Openstack VMs in parallel

2014-07-14 Thread Kurt Yoder
Opened two github issues: - https://github.com/ansible/ansible/issues/8131 - https://github.com/ansible/ansible/issues/8132 On Monday, July 14, 2014 3:09:21 PM UTC-4, Michael DeHaan wrote: > > Yep, I think we'd be open to that. > > > > > On Mon, Jul 14, 2014 at 1:07 PM, Kurt Yoder > w

Re: [ansible-project] Re: Starting Openstack VMs in parallel

2014-07-14 Thread Kurt Yoder
Is this a "pull requests welcome" situation? If so, I can try my best... :D On Monday, July 14, 2014 3:09:21 PM UTC-4, Michael DeHaan wrote: > > Yep, I think we'd be open to that. > > > > > On Mon, Jul 14, 2014 at 1:07 PM, Kurt Yoder > wrote: > >> To answer your other question about neutron: I u

Re: [ansible-project] Re: shell/command json output into variables

2014-07-14 Thread Michael Peters
Would it be possible to have an extra option to command to so that it can work similar to the uri module's "return_content" option? That way results that are registered would be the same except for an extra json key with the structured data. Not sure what to call it as "return_content" isn't partic

[ansible-project] AnsibleFest SF date now set - October 14th

2014-07-14 Thread Michael DeHaan
For those interested in AnsibleFest SF, there's now a date set, which is October 14th. It's going to be downtown near Union Square at the Parc 55 hotel. http://www.ansible.com/ansiblefest-san-francisco If you would like to present, email your abstract to c...@ansible.com. Admission for accepted

Re: [ansible-project] Configuring AWS metric alarm using newly created scaling policy ARN

2014-07-14 Thread James Cammarata
What version of Ansible are you running? The above PR was merged into devel and will be included in 1.7, however it is not yet available in 1.6.x. On Mon, Jul 14, 2014 at 1:42 PM, Claire Lee wrote: > Hi guys, I'm still pretty new to Ansible and was wondering if you could > answer a question I h

Re: [ansible-project] Re: lineinfile module replace only if line is present, do not add

2014-07-14 Thread Michael DeHaan
Your version of Ansible is rather downlevel. If you have a problem in 1.6.6 (the latest) let us know. On Mon, Jul 14, 2014 at 12:21 PM, Ming Qian wrote: > Hello Everyone, > > Has this problem been fixed? > I actually had the exact same issue today. > I am using ansible 1.5.4 > > Thanks! > >

Re: [ansible-project] Re: Starting Openstack VMs in parallel

2014-07-14 Thread Michael DeHaan
Yep, I think we'd be open to that. On Mon, Jul 14, 2014 at 1:07 PM, Kurt Yoder wrote: > To answer your other question about neutron: I use "quantum_floating_ip" > to assign IPs on Openstack. > > It would be very useful if these API calls could also be parallelized. I > imagine a lot more time

Re: [ansible-project] Pipeline in command error

2014-07-14 Thread James Cammarata
You'll need to use the "shell:" version of the module for the piping of commands: - name: execute script shell: "yes | bash /tmp/a.sh" On Mon, Jul 14, 2014 at 9:05 AM, Paco p wrote: > Hello, I need interact with a script, so I have a script as(/tmp/a.sh): > > > read var > > if [[ $var ==

Re: [ansible-project] Re: shell/command json output into variables

2014-07-14 Thread Michael DeHaan
callback plugins exist in ansible for this purpose and there is the '--tree' flag to ad-hoc /usr/bin/ansible mode. However, we're not really trying to be a system that emits arbitrary JSON as many playbooks will include results for multiple systems and this would get very very large and unwieldy.

Re: [ansible-project] Getting 'ansible_processor' is undefined error

2014-07-14 Thread Michael DeHaan
See you have fact gathering turned on and if the fact is in the output of ansible hostname -m setup [...] On Mon, Jul 14, 2014 at 2:51 AM, Dhastha Gheer wrote: > Hi all, > > I am running a role with following command to deploy it in a remote > machine > > sudo ansible-playbook run_role.yml

[ansible-project] Re: lineinfile module replace only if line is present, do not add

2014-07-14 Thread Ming Qian
Hello Everyone, Has this problem been fixed? I actually had the exact same issue today. I am using ansible 1.5.4 Thanks! On Monday, August 19, 2013 9:51:36 PM UTC-4, Kavin Kankeshwar wrote: > > Hi, > > Wanted to know if it is possible for lineinfile to only replace line if > regex matches, if

[ansible-project] Pipeline in command error

2014-07-14 Thread Paco p
Hello, I need interact with a script, so I have a script as(/tmp/a.sh): read var if [[ $var == "y" ]]; then exit 0; else exit 1; fi And in my playbook - name: execute script command: "yes | bash /tmp/a.sh" And I am getting the following: failed: [192.168.1.104] => {"failed": true,

[ansible-project] Configuring AWS metric alarm using newly created scaling policy ARN

2014-07-14 Thread Claire Lee
Hi guys, I'm still pretty new to Ansible and was wondering if you could answer a question I have. I'm trying to create an AWS scaling policy and attach a metric alarm to it. >From what I understand, the ec2_metric_alarm module needs the ARN of the scaling policy so that it can associate itself

Re: [ansible-project] execute roles more then one times (with_sequence ?)

2014-07-14 Thread Michael DeHaan
Right, role iteration just can't happen, because what happens is people will want different values to iterate for different hosts, and the way Ansible is built all task definitions in a play go to all hosts, and then those hosts evaluate conditionals. What you ask would involve auto-converting som

Re: [ansible-project] OS variables variance

2014-07-14 Thread Leibo
Didn't help but I eventually got all Linux vars into a Linux.yml, all RedHat dependent or Suse into their own and more specific OS family with specific version into its own file. Created an empty vars file and used the list includes feature. In the playbook I include: ansible_system file than tr

Re: [ansible-project] Re: Starting Openstack VMs in parallel

2014-07-14 Thread Kurt Yoder
To answer your other question about neutron: I use "quantum_floating_ip" to assign IPs on Openstack. It would be very useful if these API calls could also be parallelized. I imagine a lot more time would be spent on 100 serial API calls than doing them in parallel. -Kurt On Monday, July 14, 2

Re: [ansible-project] make deb issue

2014-07-14 Thread 'Diogene Laerce' via Ansible Project
Thanks. On 07/14/2014 06:55 PM, Serge van Ginderachter wrote: > > On 14 July 2014 18:28, 'Diogene Laerce' via Ansible Project > > wrote: > > Do you have a protocol somewhere that I can read to submit ? > That's my first. :) > > > > ​https://

Re: [ansible-project] make deb issue

2014-07-14 Thread Serge van Ginderachter
On 14 July 2014 18:28, 'Diogene Laerce' via Ansible Project < ansible-project@googlegroups.com> wrote: > Do you have a protocol somewhere that I can read to submit ? > That's my first. :) > ​https://github.com/ansible/ansible/blob/devel/CONTRIBUTING.md​ -- You received this message because you

Re: [ansible-project] make deb issue

2014-07-14 Thread 'Diogene Laerce' via Ansible Project
Do you have a protocol somewhere that I can read to submit ? That's my first. :) On 07/14/2014 06:19 PM, Serge van Ginderachter wrote: > I suspect the make deb was only tested from a git checkout. Sounds like > a bug. > > > On 14 July 2014 17:06, 'Diogene Laerce' via Ansible Project >

Re: [ansible-project] make deb issue

2014-07-14 Thread Serge van Ginderachter
I suspect the make deb was only tested from a git checkout. Sounds like a bug. On 14 July 2014 17:06, 'Diogene Laerce' via Ansible Project < ansible-project@googlegroups.com> wrote: > Actually it was (and just did again) a clean checkout : > > 1 - download archive > 2 - untar > 3 - cd to dir > 4

[ansible-project] Re: shell/command json output into variables

2014-07-14 Thread Stuart Reynolds
Re:(1) I've found that I can do this: - hosts: localhost - name: Describe instances hosts: localhost gather_facts: false # Prevents immediately logging in to hosts tasks: - command: aws ec2 describe-instances register: result - debug: var=result.stdout|from_json However, reall

[ansible-project] shell/command json output into variables

2014-07-14 Thread Stuart Reynolds
(1) Many command line tools (such as the aws CLI tools) output results directory as JSON. Is there a way to slurp up stdout and json-to-pydict it? In many cases this would be preferable to using modules which are i) highly coupled to fast-paced external code sources, ii) only implement a subset o

Re: [ansible-project] make deb issue

2014-07-14 Thread 'Diogene Laerce' via Ansible Project
Actually it was (and just did again) a clean checkout : 1 - download archive 2 - untar 3 - cd to dir 4 - make deb 5 - same error I maybe do something wrong but I don't know what, if I. And there's no problem at all with the dev repo version. I did find some other errors at the beginning of the p

Re: [ansible-project] OS variables variance

2014-07-14 Thread Michael DeHaan
Seems like the intermediate directory "playbooks/" may be the problem. On Mon, Jul 14, 2014 at 3:24 AM, Leibo wrote: > Hi, > > trying *include_vars* I encounter an issue > > Trying this inside a role task: > > - include_vars: "{{item}}" > with_first_found: > - > "vars/OS/{{ansible_distr

Re: [ansible-project] make deb issue

2014-07-14 Thread Serge van Ginderachter
Can't reproduce that. Could you try cleaning up some dirs manually, then retrying: debian/ deb-dist/ build/ or starting from a clean checkout Serge On 14 July 2014 16:25, 'Diogene Laerce' via Ansible Project < ansible-project@googlegroups.com> wrote: > It seems that the archive name is not

Re: [ansible-project] make deb issue

2014-07-14 Thread 'Diogene Laerce' via Ansible Project
It seems that the archive name is not defined : [hard-linking process] ... copying setup.cfg -> ansible-1.6.6 Writing ansible-1.6.6/setup.cfg creating dist Creating tar archive removing 'ansible-1.6.6' (and everything under it) tar: dist/ansible-.tar.gz: Cannot open: No such file or directory tar:

Re: [ansible-project] make deb issue

2014-07-14 Thread Serge van Ginderachter
Can you paste the errors you get when making deb? On 14 July 2014 16:18, 'Diogene Laerce' via Ansible Project < ansible-project@googlegroups.com> wrote: > Hi, > > I try to make a deb package from the sources and when it works > fine with the git repository (dev version), yet it doesn't with the

[ansible-project] make deb issue

2014-07-14 Thread 'Diogene Laerce' via Ansible Project
Hi, I try to make a deb package from the sources and when it works fine with the git repository (dev version), yet it doesn't with the latest version 1.6.6. I ran a diff here : http://pastebin.com/c9WKEkVB But I couldn't find why. Anyone ? Thank you. -- “One original thought is worth a thousa

Re: [ansible-project] Re: Starting Openstack VMs in parallel

2014-07-14 Thread Kurt Yoder
There's an undocumented min_count and max_count option in python-novaclient ServerManager.create() which looks like what you want [1]. -Kurt [1] https://github.com/openstack/python-novaclient/blob/cc7364067f995bd952149cd172cebf083fe4dc99/novaclient/v3/servers.py#L427 On Friday, July 11, 2014

Re: [ansible-project] How to use hosts listed in a group in a template, excluding the current host.

2014-07-14 Thread Brian Coca
also: {% for svr in groups.ntp_servers|difference([inventory_hostname]) %} peer svr {% endfor %} -- Brian Coca Stultorum infinitus est numerus 0111011100100110010101101110001001110111011000010110011101010010011100110110110101110111001001110111 Pedo mellon

Re: [ansible-project] How to use hosts listed in a group in a template, excluding the current host.

2014-07-14 Thread Michael Peters
Try something like this: {% for svr in groups.ntp_servers %} {% if not svr == inventory_hostname %} peer svr {% endif %} {% endfor %} On Mon, Jul 14, 2014 at 4:30 AM, John Wang wrote: > I'm new to Ansible and want use it to configure a NTP service. here is my > situation: > > my hosts file

[ansible-project] How to use hosts listed in a group in a template, excluding the current host.

2014-07-14 Thread John Wang
I'm new to Ansible and want use it to configure a NTP service. here is my situation: my hosts file: [ntp_servers] s1.aaa.com s2.aaa.com s3.aaa.com s4.aaa.com The "/taskts/mail.yaml" for role "ntp_server": - name: install ntp apt: name=ntp state=present - nam

[ansible-project] Getting 'ansible_processor' is undefined error

2014-07-14 Thread Dhastha Gheer
Hi all, I am running a role with following command to deploy it in a remote machine sudo ansible-playbook run_role.yml -c ssh -i inventory.ini --limit=hostname -e role=rolename -u username -k -K But I am getting following error fatal: [192.168.1.5] => {'msg': "One or more undefined variables:

Re: [ansible-project] execute roles more then one times (with_sequence ?)

2014-07-14 Thread Serkan C.
Yes i can do that, for example; - name: do something1 module: parameters with_sequence: start=0 end={{count}} - name: do something2 module: parameters with_sequence: start=0 end={{count}} - name: do something3 module: parameters with_sequence: start=0 end={{count}} - name: do someth

Re: [ansible-project] OS variables variance

2014-07-14 Thread Leibo
Hi, trying *include_vars* I encounter an issue Trying this inside a role task: - include_vars: "{{item}}" with_first_found: - "vars/OS/{{ansible_distribution}}_{{ansible_distribution_major_version}}.yml" - "vars/OS/{{ansible_distribution}}.yml" - "vars/OS/{{ansible_system}}.yml"