Re: [ansible-project] Is there anyway to consolidate these set_fact tasks?

2016-03-19 Thread Michael Baydoun
I previously tried ec2_vpc_net_facts, but it's not available until version 
2.1 (not release yet).

On Wednesday, March 16, 2016 at 2:47:27 PM UTC-4, Stephen Granger wrote:
>
> Yes, but it is also possible to lookup the VPC id. This just gets the 
> default, based on the filters, VPC id.
>
> # Get the vpc id
> - name: Get the default VPCs details
>   ec2_vpc_net_facts:
> aws_access_key: "{{ aws_access_key }}"
> aws_secret_key: "{{ aws_secret_key }}"
> region: "{{ aws_region }}"
> filters:
>   is_default: "true"
>   register: returned_vpc
>
> - name: The VPC id
>   debug:
> var: returned_vpc.vpcs[0].id
>
>
>

-- 
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/07396ff8-1639-42a5-8de2-5a9ecfd6409b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Is there anyway to consolidate these set_fact tasks?

2016-03-19 Thread Michael Baydoun
- name: create all vpc's for all accounts and regions
  ec2_vpc:
state: "{{ item.internet_gateway | default('no') }}"
region: "{{ item.region }}"
state: "{{ item.state | default('present') }}"
cidr_block: "{{ item.cidr_block }}"
resource_tags: "{{ item.resource_tags }}"
subnets: "{{ item.subnets }}"
wait: yes
  when: item.controlEnvironment == env
  with_items: "{{ vpcList }}"
  register: vpcOut

- set_fact:
mainVpcId: "{{ item.vpc_id }}"
  with_items: vpcOut.results
  when:
- not item | skipped
- item.item.resource_tags.WhichRegion == 'mainRegion'

- set_fact:
mainSubnet0: "{{ item.subnets.0.id }}"
  with_items: vpcOut.results
  when:
- not item | skipped
- item.item.resource_tags.WhichRegion == 'mainRegion'

- set_fact:
mainSubnet1: "{{ item.subnets.1.id }}"
  with_items: vpcOut.results
  when:
- not item | skipped
- item.item.resource_tags.WhichRegion == 'mainRegion'

- set_fact:
mainSubnet2: "{{ item.subnets.2.id }}"
  with_items: vpcOut.results
  when:
- not item | skipped
- item.item.resource_tags.WhichRegion == 'mainRegion'

-- 
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/75e5da0c-8212-4b06-aa9b-c07d7462699a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Is there anyway to consolidate these set_fact tasks?

2016-03-19 Thread Michael Baydoun
Wouldn't I still need to register the output and extract the vpc_id for use 
in subsequent subnet, security group, and other tasks.

On Wednesday, March 16, 2016 at 12:39:16 PM UTC-4, Stephen Granger wrote:
>
> Have you looked at the Ansible 2.0 modules for deploying a VPC and 
> subnets? It may simplify the setting of facts. I don't have time to give 
> you an example at the moment but have found the new modules a lot easier to 
> use.
>
> http://docs.ansible.com/ansible/ec2_vpc_net_module.html
>
>
>

-- 
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/22f46234-c6e9-43cf-bc1d-6915cfd69ee4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Understanding ansible branching model

2016-02-22 Thread Michael Baydoun
Thanks Brian 

-- 
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/9ea1ecf2-98a5-42eb-87ce-9fc672af3dff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Understanding ansible branching model

2016-02-16 Thread Michael Baydoun
Can anyone point me to a doc or site that details what branching model the 
ansible project is following?
I'd like to better understand what I'm seeing in the github repository, and 
apply some of that to our internal workflow if appropriate and useful.

-- 
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/c6d5add3-d641-4030-ab61-0dbe92e4cbb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-12 Thread Michael Baydoun
Spoke too soon, turning off fact caching fixed or worked around the 
problem.  Opened a bug report 
https://github.com/ansible/ansible/issues/14456 


>>

-- 
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/f18e015b-7f4d-423a-8539-32e9c9963474%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-11 Thread Michael Baydoun
Turning off fact caching completely did not improve the situation.

On Thursday, February 11, 2016 at 12:32:02 PM UTC-5, Michael Baydoun wrote:
>
> We do, and have been looking at that.  The facts for all hosts are getting 
> gathered/refreshed during the first included playbook in site.yml, and the 
> cache is not supposed to be expiring for 3 hours, with our entire run 
> taking less than 2 hours.  The cache files are present on disk, etcetera.  
>
> We did launch a site.yml run with fact caching commented out of 
> ansible.cfg, waiting to see how that run works.
>
> On Thursday, February 11, 2016 at 11:48:36 AM UTC-5, J Hawkesworth wrote:
>>
>> Do you have fact gathering set to smart in your ansible.cfg?
>>
>>
>>>>>

-- 
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/f26c963c-8d6b-4642-8bde-c558b50d9cd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-11 Thread Michael Baydoun
We do, and have been looking at that.  The facts for all hosts are getting 
gathered/refreshed during the first included playbook in site.yml, and the 
cache is not supposed to be expiring for 3 hours, with our entire run 
taking less than 2 hours.  The cache files are present on disk, etcetera.  

We did launch a site.yml run with fact caching commented out of 
ansible.cfg, waiting to see how that run works.

On Thursday, February 11, 2016 at 11:48:36 AM UTC-5, J Hawkesworth wrote:
>
> Do you have fact gathering set to smart in your ansible.cfg?
>
>


-- 
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/df7a26ca-f8de-4712-bd1a-2a7d3235bd83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-11 Thread Michael Baydoun
In our case, the facts are being gathered, and used other plays included in 
site.yml, but later on in a subsequent play the a fact that was defined 
previously is suddenly undefined, on some random hosts, but not all.  It's 
happening on windows and linux hosts.


On Thursday, February 11, 2016 at 2:20:23 AM UTC-5, Alex Leonhardt wrote:
>
> I had something like it, not on Windows though,at the time the problem was 
> that I set it not to gather_facts, when I actually tried to use a few facts 
> later on. May not be the same but may be worth checking..
>
> Alex
>
>
>>

-- 
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/02101a12-2785-4f57-881c-60fef570a05b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-10 Thread Michael Baydoun
This is still occurring during our full site.yml run, but it's so far 
impossible to replicate in a small example.  It only occurs on our full 
site.yml run with no limits, any attempt to limit to certain hosts or tags 
result in no errors.

On Wednesday, February 3, 2016 at 9:56:26 AM UTC-5, Michael Baydoun wrote:
>
> Some ansible playbook runs will work on most hosts, but 1-3 will fail with 
> an undefined variable that is an ansible fact.  Run it a second time and it 
> works.
> Example:
>
> fatal: [wdv-sitefinity1]: FAILED! => {"failed": true, "msg": "ERROR! The 
> conditional check 'ansible_os_family == 'Windows'' failed. The error was: 
> ERROR! error while evaluating conditional (ansible_os_family == 'Windows'): 
> ERROR! 'ansible_os_family' is undefined\n\nThe error appears to have been 
> in '/home/icansible/ansible/roles/newrelic/tasks/main.yml': line 11, column 
> 3, but may\nbe elsewhere in the file depending on the exact syntax 
> problem.\n\nThe offending line appears to be:\n\n\n- name: create temp 
> directory\n  ^ here\n"}
>
>

-- 
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/8cf0c8f1-f1c6-4aea-8b7d-c1ca97607698%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] question with aws ec2 exact_count

2016-02-04 Thread Michael Baydoun
Thought the task below would create 1 instance with the count_tag "demo", 
only if there wasn't one running, but it's creating a new instance every 
time.
Am I using exact_count incorrectly?

- name: spin up ec2 instance
  ec2:
count_tag: demo
exact_count: 1
image: ami-60b6c60a
region: us-east-1
type: t2.nano
wait: yes

Using ansible 2.0.0.2 and boto 2.39.0

-- 
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/0f7cbebd-9f04-4406-b78a-802458ec9e87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-03 Thread Michael Baydoun
Some ansible playbook runs will work on most hosts, but 1-3 will fail with 
an undefined variable that is an ansible fact.  Run it a second time and it 
works.
Example:

fatal: [wdv-sitefinity1]: FAILED! => {"failed": true, "msg": "ERROR! The 
conditional check 'ansible_os_family == 'Windows'' failed. The error was: 
ERROR! error while evaluating conditional (ansible_os_family == 'Windows'): 
ERROR! 'ansible_os_family' is undefined\n\nThe error appears to have been 
in '/home/icansible/ansible/roles/newrelic/tasks/main.yml': line 11, column 
3, but may\nbe elsewhere in the file depending on the exact syntax 
problem.\n\nThe offending line appears to be:\n\n\n- name: create temp 
directory\n  ^ here\n"}

-- 
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/8f5d179e-f9af-4376-9d79-cff635f220f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible --version and pip list

2016-02-01 Thread Michael Baydoun
Both report ansible 2.0.0.0 no matter what 2.x version I really have 
installed, 2.0.0.0-1, 2.0.0.2, doesn't matter.

Is this an error with ansible, or an error on the part of the pip packager?

-- 
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/44cdc219-8f74-4b4d-8b44-7029ca320ced%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-01-19 Thread Michael Baydoun
when: ansible_host still caused the set_fact to execute when it was not 
present / null

However, the other suggestions worked great, thanks!


>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop 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/b8d1690f-0fec-4632-9a48-b207171343eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-01-19 Thread Michael Baydoun
pre 2.0

set_fact:
  uberHost: "{{ ansible_ssh_host }}"
when: ansible_ssh_host is defined

set fact:
  uberHost: "{{ inventory_hostname }}"
when: ansible_ssh_host is not defined


Post 2.0, changed to use ansible_host
uberHost is always getting set to null 
ansible_host is defined and set to null even when it's not present in the 
inventory file
I haven't figured out how to test to see if ansible_host is null in a when 
clause.


-- 
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/ce3c97d5-f321-4ab6-868f-e83a11aa863f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Using ansible to upgrade ansible in envronment with restrictive umask

2016-01-14 Thread Michael Baydoun
We install ansible via pip
We can't use the ansible pip module to ensure the desired version is 
installed, as the restrictive umask breaks the permissions on the ansible 
files in /usr/lib/python2.6/site-packages 
The pip module does not allow us to override the umask

We can use the shell module to elevate to root, change the umask, and pip 
install the desired version however, we can't write that shell command to 
be idempotent. 
The desired version right now is 2.0.0.0-1 but ansible --version and pip 
show both return 2.0.0.0 as the current version when 2.0.0.0-1 is installed

suggestions?  We don't have any access to production so the upgrade must be 
automated via ansible code

-- 
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/01c3a55a-c15b-4971-abe4-14df28cc80a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: TypeError: argument of type 'NoneType' is not iterable

2016-01-14 Thread Michael Baydoun
Additional note, only fails if the inventory_hostname in question at the 
time is a windows server, I can work around that with a when clause.

On Thursday, January 14, 2016 at 8:36:45 AM UTC-5, Michael Baydoun wrote:
>
> Worked in 1.9.x, fails with error in 2.0 (see subject line for error)
>
> roles/x/vars/main.yml
> --- 
> dotNetAgentVersion: 5.3.90.0
> javaAgentVersion: 3.18.0
> binaryFiles:
>   - "NewRelicAgent_x64_{{ dotNetAgentVersion }}.msi" 
>   - "newrelic-java-{{ javaAgentVersion }}.zip" 
>   - "newrelic-sysmond-2.1.0.124-1.x86_64.rpm"
>
> roles/x/tasks/main.yml
> ---
> - name: binary file permissions
>   file:
>path: /var/www/html/{{ item }}
>group: apache
>mode: 0744
>owner: apache
>setype: httpd_sys_content_t
>seuser: system_u
>delegate_to: LinuxWebServer
>run_once: yes
>sudo: yes
>with_items: binaryFiles
>

-- 
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/7d7ca8cc-6896-4003-a0d0-c42d827104a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] In 2.0, when is the inventory read and the special "groups" variable populated?

2016-01-14 Thread Michael Baydoun
Thanks for the tip.  Some code that managed .ansible.cfg was misbehaving 
and changing the default inventory file unexpectedly.

On Wednesday, January 13, 2016 at 9:45:28 AM UTC-5, Brian Coca wrote:
>
> That should only happen if you are using no inventory, the internal 
> fallback is to create a 'localhost' entry which defaults to those 
> groups. 
>
>
>
>
> -- 
> 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/cab6f30a-7ac2-4c24-880b-249d2edd62fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] TypeError: argument of type 'NoneType' is not iterable

2016-01-14 Thread Michael Baydoun
Worked in 1.9.x, fails with error in 2.0 (see subject line for error)

roles/x/vars/main.yml
--- 
dotNetAgentVersion: 5.3.90.0
javaAgentVersion: 3.18.0
binaryFiles:
  - "NewRelicAgent_x64_{{ dotNetAgentVersion }}.msi" 
  - "newrelic-java-{{ javaAgentVersion }}.zip" 
  - "newrelic-sysmond-2.1.0.124-1.x86_64.rpm"

roles/x/tasks/main.yml
---
- name: binary file permissions
  file:
   path: /var/www/html/{{ item }}
   group: apache
   mode: 0744
   owner: apache
   setype: httpd_sys_content_t
   seuser: system_u
   delegate_to: LinuxWebServer
   run_once: yes
   sudo: yes
   with_items: binaryFiles

-- 
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/f558c773-a215-4e2e-ab8d-04f06f62a41d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] In 2.0, when is the inventory read and the special "groups" variable populated?

2016-01-13 Thread Michael Baydoun
Our playbooks set facts similar to

- name: illustrate problem
  set_fact:
monitoringServer: "{{ groups.nagios.0 }}"

In 1.9.x that would evaluate to the first server in the nagios group in 
inventory
In 2.0, groups doesn't contain a value for nagios, or any other inventory 
group.  It only contains "all" and "ungrouped", both of which contain 
localhost.

  

-- 
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/45528151-b8b3-43eb-ab76-012e609acad0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: skipping playbook include due to conditional test failure

2016-01-13 Thread Michael Baydoun
The problem here seems to be the groups variable is not populated yet, it 
only contains all.localhost and upgrouped.localhost

On Tuesday, January 12, 2016 at 3:45:45 PM UTC-5, Michael Baydoun wrote:
>
> Just upgraded to ansible 2.0 in our sandbox environment
> In our site.yml we include a number of playbooks like so
>
> - include: coolapp.yml
>   when: groups.coolapp is defined
>
> This allows our code to not fail if the production coolapp server hasn't 
> been built yet.
>
> Now in 2.0, these includes are all being skipped
>
> "skipping playbook include 'coolapp.yml' due to conditional test failure"
>
> Even running with - doesn't supply any additional information
>
> Obviously we need to change our design for 2.0.  Suggestions?
>

-- 
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/cae156b9-e2ee-4bad-9a97-74916f6d176f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] skipping playbook include due to conditional test failure

2016-01-12 Thread Michael Baydoun
Just upgraded to ansible 2.0 in our sandbox environment
In our site.yml we include a number of playbooks like so

- include: coolapp.yml
  when: groups.coolapp is defined

This allows our code to not fail if the production coolapp server hasn't 
been built yet.

Now in 2.0, these includes are all being skipped

"skipping playbook include 'coolapp.yml' due to conditional test failure"

Even running with - doesn't supply any additional information

Obviously we need to change our design for 2.0.  Suggestions?

-- 
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/9a5ffe5e-efad-4b2a-8b1c-cab1e1f4bdee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Slow fact gathering or slow winrm on windows hosts

2015-10-09 Thread Michael Baydoun
All servers are local in this building.  Will look at increasing forks even
more than we already have, though limited in what we can do until 2.0 is
released and allows for per task serial values.

On Fri, Oct 9, 2015 at 12:02 PM Trond Hindenes  wrote:

> There's no getting around the fact that winrm is a much slower protocol
> than ssh. Those numbers seem unreasonably high tho. Any chance you're using
> a local ansible control node against cloud-based windows servers?
>
> You could also consider speeding up your playbooks using the "forks" (
> http://www.ansible.com/blog/ansible-performance-tuning)
>
>
> On Friday, October 9, 2015 at 3:46:52 PM UTC+2, Michael Baydoun wrote:
>>
>> A few of our windows hosts take 20-30 seconds to gather facts, and that's
>> the good news.  The other hosts take > 1 minute just to gather facts.
>> When run with -, it appears to me that every winrm step just takes a
>> long time.
>>
>> Has anyone run into this?  Suggestions?  Adding each windows host to our
>> inventory is causing painful increases in site.yml run time.
>> Note: running ansible 1.9.2, and hoping 2.0 will improve the situation
>> when it's released
>>
>> I wrote a test to gather run times for fact gathering, results for
>> windows hosts below (with hostnames removed)
>>
>> min:sec:hundredths
>> 0:26.66
>> 1:13.46
>> 1:15.47
>> 1:14.77
>> 1:33.89
>> 0:32.68
>> 2:44.04
>> 1:34.65
>> 1:30.29
>> 1:25.71
>> 0:29.66
>> 0:25.86
>> 1:08.95
>> 1:09.38
>> 0:21.88
>> 0:24.47
>>
>> --
> 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/jruWTjOrC5w/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/52345e1c-fe15-477d-9e72-799ec00b5814%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/52345e1c-fe15-477d-9e72-799ec00b5814%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CADgbg8KwH9FjJSTfWkn82Jtg%2BBqtPbeySBYe42EkLZSjdXm7Rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Slow fact gathering or slow winrm on windows hosts

2015-10-09 Thread Michael Baydoun
A few of our windows hosts take 20-30 seconds to gather facts, and that's 
the good news.  The other hosts take > 1 minute just to gather facts.  
When run with -, it appears to me that every winrm step just takes a 
long time.

Has anyone run into this?  Suggestions?  Adding each windows host to our 
inventory is causing painful increases in site.yml run time.
Note: running ansible 1.9.2, and hoping 2.0 will improve the situation when 
it's released

I wrote a test to gather run times for fact gathering, results for windows 
hosts below (with hostnames removed)

min:sec:hundredths 
0:26.66
1:13.46
1:15.47
1:14.77
1:33.89
0:32.68
2:44.04
1:34.65
1:30.29
1:25.71
0:29.66
0:25.86
1:08.95
1:09.38
0:21.88
0:24.47

-- 
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/2ddc37d3-8197-47ed-ab9d-0b1c00331c89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: looking for confirmation of bug

2014-08-13 Thread Michael Baydoun
actually, if I set serial to 1 the first task which has a run_once ends up 
running multiple times, which breaks the playbook

On Wednesday, August 13, 2014 2:43:23 PM UTC-4, Michael Baydoun wrote:
>
> before I file a bug report
> playbook to reproduce is below
> change hosts line to specify three or more individual hosts, or a group 
> containing three or more hosts
> after running playbook /tmp/test.out is expected to contain 1 line for 
> each host
> but it will often be missing one or more lines
> run playbook again and get a different result
>
> ---
>
> - hosts: ds1:ds2:ds3
>
>   remote_user: root
>
>   vars:
>
> outfile: /tmp/test.out
>
>   tasks:
>
>
> - name: test | start with empty local file
>
>   local_action: file path={{ outfile }} state=absent
>
>   run_once: true
>
>
> - name: test | generate output one line per host
>
>   shell: "echo {{ ansible_hostname }} file.sh dbname"
>
>   register: hostout
>
>   
>
> - debug: var=hostout.stdout
>
>
> - name: test | create local file listing all output from above 
>
>   local_action: lineinfile dest={{ outfile }} line="{{ hostout.stdout 
> }}" create=yes
>

-- 
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/0267337b-1501-4f2f-994c-21aa43eecc00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: looking for confirmation of bug

2014-08-13 Thread Michael Baydoun
running with --forks=1 makes problem go away

On Wednesday, August 13, 2014 2:43:23 PM UTC-4, Michael Baydoun wrote:
>
> before I file a bug report
> playbook to reproduce is below
> change hosts line to specify three or more individual hosts, or a group 
> containing three or more hosts
> after running playbook /tmp/test.out is expected to contain 1 line for 
> each host
> but it will often be missing one or more lines
> run playbook again and get a different result
>
> ---
>
> - hosts: ds1:ds2:ds3
>
>   remote_user: root
>
>   vars:
>
> outfile: /tmp/test.out
>
>   tasks:
>
>
> - name: test | start with empty local file
>
>   local_action: file path={{ outfile }} state=absent
>
>   run_once: true
>
>
> - name: test | generate output one line per host
>
>   shell: "echo {{ ansible_hostname }} file.sh dbname"
>
>   register: hostout
>
>   
>
> - debug: var=hostout.stdout
>
>
> - name: test | create local file listing all output from above 
>
>   local_action: lineinfile dest={{ outfile }} line="{{ hostout.stdout 
> }}" create=yes
>

-- 
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/bc06e209-d8e7-4e1d-83df-b7e86843f9df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: looking for confirmation of bug

2014-08-13 Thread Michael Baydoun
forgot to state, this error was produced running ansible 1.7 from linux and 
mac

On Wednesday, August 13, 2014 2:43:23 PM UTC-4, Michael Baydoun wrote:
>
> before I file a bug report
> playbook to reproduce is below
> change hosts line to specify three or more individual hosts, or a group 
> containing three or more hosts
> after running playbook /tmp/test.out is expected to contain 1 line for 
> each host
> but it will often be missing one or more lines
> run playbook again and get a different result
>
> ---
>
> - hosts: ds1:ds2:ds3
>
>   remote_user: root
>
>   vars:
>
> outfile: /tmp/test.out
>
>   tasks:
>
>
> - name: test | start with empty local file
>
>   local_action: file path={{ outfile }} state=absent
>
>   run_once: true
>
>
> - name: test | generate output one line per host
>
>   shell: "echo {{ ansible_hostname }} file.sh dbname"
>
>   register: hostout
>
>   
>
> - debug: var=hostout.stdout
>
>
> - name: test | create local file listing all output from above 
>
>   local_action: lineinfile dest={{ outfile }} line="{{ hostout.stdout 
> }}" create=yes
>

-- 
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/a5d07d52-5e4b-44bd-9533-a3468622c950%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] looking for confirmation of bug

2014-08-13 Thread Michael Baydoun
before I file a bug report
playbook to reproduce is below
change hosts line to specify three or more individual hosts, or a group 
containing three or more hosts
after running playbook /tmp/test.out is expected to contain 1 line for each 
host
but it will often be missing one or more lines
run playbook again and get a different result

---

- hosts: ds1:ds2:ds3

  remote_user: root

  vars:

outfile: /tmp/test.out

  tasks:


- name: test | start with empty local file

  local_action: file path={{ outfile }} state=absent

  run_once: true


- name: test | generate output one line per host

  shell: "echo {{ ansible_hostname }} file.sh dbname"

  register: hostout

  

- debug: var=hostout.stdout


- name: test | create local file listing all output from above 

  local_action: lineinfile dest={{ outfile }} line="{{ hostout.stdout 
}}" create=yes

-- 
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/673651ca-a86e-4938-af82-82500a08b51a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] read multiple variables from dynamically generated file

2014-08-06 Thread Michael Baydoun
I have a playbook that runs on all database servers, gathers information 
about every database found, does error checking and eliminated duplicates 
(same db on mulitple servers).  The result is an output file that contains 
three fields for every database "DBNAME SCRIPTNAME HOSTNAME"

Next I want to read every line in that local file, connect to only those 
hosts specified, and run the script providing the dbname as an argument. 
 How can I read that dynamic local file and populated multiple variables 
for additional use?

Example file
ProdDB script1.sh host1
DevDB script47.sh host4

I want to do something like this

  - name: retrieve tablespace data 
shell: /path/{{ scriptname }} {{ dbname }}
delegate_to: {{ hostname }}
with items from file local.generated where field 1 is dbname, field 2 
is scriptname, and field 3 is hostname
register: tablespace_data

whether or not I use delegate_to, or call another playbook with extra vars, 
I still need to populate variables based on their position in a 1-n row 
text file.  Any ideas how I can pull something like that off?

-- 
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/4d72f74d-b895-4805-9594-b41406c559a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] 10 lines in file

2014-06-19 Thread Michael Baydoun
on second thought, maybe I can do something like this in xml.  I'll take a 
look into that.

On Thursday, June 19, 2014 10:21:18 AM UTC-4, Michael Baydoun wrote:
>
> unfortunately, it's not that kind of file.  It's a xml file for Oracle BI
>
> On Thursday, June 19, 2014 7:41:41 AM UTC-4, Michael Schultz wrote:
>>
>> Depending on the file, sometimes they support an include statement (e.g., 
>> sudoers, apparmor, mysql, apache, ...) that you could assert lineinfile for 
>> then use template or file on the include file as appropriate.
>>
>> --michael
>> On Jun 18, 2014 3:14 PM, "Michael Baydoun"  wrote:
>>
>>>  I need to add 10 lines to the middle of a file where the rest of the 
>>> file is dynamic. Since it’s dynamic I need to use something like 
>>> lineinfile.  I’d rather not invoke lineinfile 10 times as that seems messy.
>>>
>>> Suggestions?
>>>
>>> -- 
>>> 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/a8d32189-7066-493c-a24d-ef7deb85b174%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/ansible-project/a8d32189-7066-493c-a24d-ef7deb85b174%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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/0448c106-eced-40f0-8d7f-65fb2e3e077d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] 10 lines in file

2014-06-19 Thread Michael Baydoun
unfortunately, it's not that kind of file.  It's a xml file for Oracle BI

On Thursday, June 19, 2014 7:41:41 AM UTC-4, Michael Schultz wrote:
>
> Depending on the file, sometimes they support an include statement (e.g., 
> sudoers, apparmor, mysql, apache, ...) that you could assert lineinfile for 
> then use template or file on the include file as appropriate.
>
> --michael
> On Jun 18, 2014 3:14 PM, "Michael Baydoun"  > wrote:
>
>>  I need to add 10 lines to the middle of a file where the rest of the 
>> file is dynamic. Since it’s dynamic I need to use something like 
>> lineinfile.  I’d rather not invoke lineinfile 10 times as that seems messy.
>>
>> Suggestions?
>>
>> -- 
>> 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/a8d32189-7066-493c-a24d-ef7deb85b174%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/a8d32189-7066-493c-a24d-ef7deb85b174%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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/ccfe6542-22eb-429b-9fa1-886bba64590e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] 10 lines in file

2014-06-19 Thread Michael Baydoun
Because an application is making changes to other parts of the file, and 
those changes need to be maintained.  I can't overwrite what the 
application is doing.

On Thursday, June 19, 2014 1:35:38 AM UTC-4, James Cammarata wrote:
>
> Why not use a template, or the assemble module? Both of those would seem 
> to be a better fit.
>
>
> On Wed, Jun 18, 2014 at 3:14 PM, Michael Baydoun  > wrote:
>
>> I need to add 10 lines to the middle of a file where the rest of the file 
>> is dynamic. Since it’s dynamic I need to use something like lineinfile. 
>>  I’d rather not invoke lineinfile 10 times as that seems messy.
>>
>> Suggestions?
>>
>> -- 
>> 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/a8d32189-7066-493c-a24d-ef7deb85b174%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/a8d32189-7066-493c-a24d-ef7deb85b174%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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/87dc76a8-c701-4d6d-b4ed-816bac56f10a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] 10 lines in file

2014-06-18 Thread Michael Baydoun
 

I need to add 10 lines to the middle of a file where the rest of the file 
is dynamic. Since it’s dynamic I need to use something like lineinfile. 
 I’d rather not invoke lineinfile 10 times as that seems messy.

Suggestions?

-- 
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/a8d32189-7066-493c-a24d-ef7deb85b174%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Need to verify this is really a bug

2014-04-24 Thread Michael Baydoun
Thanks all!  I figured it was user error and not a bug :)



On Thu, Apr 24, 2014 at 2:40 PM, Serge van Ginderachter <
se...@vanginderachter.be> wrote:

> My apologies, I was too quick and very mistaken:
>
> change
>>  debug: var=secondvar.stdout_lines
>>  to
>>  ​​
>> debug: var=secondvar.results.stdout_lines
>>
>
> Should be
>
> - name: test | should display directory contents but does not
>   debug: var=item.stdout
>
>
>   with_items: secondvar.results
>
>
> Noting this by heart, so hopefully not mistaken this time :-)
>
>
>
>   Serge
>
>
>  --
> 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/CAEhzMJB_nQJoSfX2V4Oy4TSwSZKSWopzMUatnHSbjAAidATX5A%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/CADgbg8LtCRP6T%3DmWS%2B3udo5csP3U%3D%2B%2BT41aHrf3VbSiw7eMTKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Need to verify this is really a bug

2014-04-24 Thread Michael Baydoun
If I debug all of secondvar I can see the output I want, and it looks like
it should be contained in secondvar.results.stdout, but if I try to debug
seconvar.results.stdout I only get

"secondvar.results.stdout": "{{ secondvar.results.stdout }}"


On Thu, Apr 24, 2014 at 2:12 PM, Michael Baydoun wrote:

> I get the same results after making the suggested change
>
>
> On Thu, Apr 24, 2014 at 2:07 PM, Serge van Ginderachter <
> se...@vanginderachter.be> wrote:
>
>> with fistvar you use that list of lines, so
>> secondvar is the registered output of a loop, which means you have
>> "several sets of results"
>>
>> change
>>  debug: var=secondvar.stdout_lines
>>  to
>>  debug: var=secondvar.results.stdout_lines
>>
>>
>> HTH,
>>
>>
>>  Serge
>>
>>
>> On 24 April 2014 20:03, Michael Baydoun  wrote:
>>
>>> Small playbook that reproduces behavior
>>> https://gist.github.com/IndyMichaelB/11263577
>>> First comment shows the output
>>>
>>> --
>>> 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/CADgbg8JJ0nSut%3DEFiexZWrWC3LvSWY8nWL1HJPKuCerA9GK2_A%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CADgbg8JJ0nSut%3DEFiexZWrWC3LvSWY8nWL1HJPKuCerA9GK2_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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/CAEhzMJDVWTBbTPXGHovu-ZAYz5aAs6geONzu_jfaDpCMDfDYWw%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CAEhzMJDVWTBbTPXGHovu-ZAYz5aAs6geONzu_jfaDpCMDfDYWw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> 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/CADgbg8%2BVb6uTc-cV1s90PUSEwBX%2BTXXCZ%2BbF-z3r3cCTV1GK7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Need to verify this is really a bug

2014-04-24 Thread Michael Baydoun
I get the same results after making the suggested change


On Thu, Apr 24, 2014 at 2:07 PM, Serge van Ginderachter <
se...@vanginderachter.be> wrote:

> with fistvar you use that list of lines, so
> secondvar is the registered output of a loop, which means you have
> "several sets of results"
>
> change
>  debug: var=secondvar.stdout_lines
> to
>  debug: var=secondvar.results.stdout_lines
>
>
> HTH,
>
>
>  Serge
>
>
> On 24 April 2014 20:03, Michael Baydoun  wrote:
>
>> Small playbook that reproduces behavior
>> https://gist.github.com/IndyMichaelB/11263577
>> First comment shows the output
>>
>> --
>> 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/CADgbg8JJ0nSut%3DEFiexZWrWC3LvSWY8nWL1HJPKuCerA9GK2_A%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CADgbg8JJ0nSut%3DEFiexZWrWC3LvSWY8nWL1HJPKuCerA9GK2_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> 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/CAEhzMJDVWTBbTPXGHovu-ZAYz5aAs6geONzu_jfaDpCMDfDYWw%40mail.gmail.com<https://groups.google.com/d/msgid/ansible-project/CAEhzMJDVWTBbTPXGHovu-ZAYz5aAs6geONzu_jfaDpCMDfDYWw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CADgbg8LMnv9cbfW1sCYGaxTZ8LH54oNXwTYJP9y%2BQE%3DpF9%3DHew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Need to verify this is really a bug

2014-04-24 Thread Michael Baydoun
Small playbook that reproduces behavior
https://gist.github.com/IndyMichaelB/11263577
First comment shows the output

-- 
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/CADgbg8JJ0nSut%3DEFiexZWrWC3LvSWY8nWL1HJPKuCerA9GK2_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Inserting an entire block of configuration using lineinfile

2014-04-09 Thread Michael Baydoun
I need to insert many lines of configuration and must use lineinfile or 
something similar.
The particular application in question also writes changes over time to 
other parts of the same file.

What is the best, cleanest way to accomplish this?
Is there a solution other than to string a bunch of lineinfile modules 
together?

-- 
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/80361127-7f35-4b21-8aa3-101efc777e53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] refactor help needed

2013-12-11 Thread Michael Baydoun
I previous tried to define the array at the begining of the playbook in the 
vars section, but it only accepts key/value pairs, not an array.  Maybe my 
syntax was incorrect.  Is there an example of an array being defined in the 
vars section somewhere?

On Wednesday, December 11, 2013 11:53:44 AM UTC-5, David Karban wrote:
>
> Hi, 
>
> either define variable on the beggining of the play like here:
>
> http://www.ansibleworks.com/docs/playbooks_variables.html#variables-defined-in-a-playbook
>
> or, better use group vars, or host vars:
>
> http://www.ansibleworks.com/docs/playbooks_best_practices.html#group-and-host-variables
>
> David
>
>
>
> 2013/12/11 Michael Baydoun >
>
>> Can the following be refactored so the following array only appears once 
>> in the code?
>>
>> - [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
>> '/home/youruser/d' ]
>>
>>
>> ---
>>
>> - hosts: yourhost
>>
>>   user: root
>>
>>   gather_facts: no
>>
>>   tasks:
>>
>> - lineinfile: dest={{ item[0] }}/.gitignore create=yes regexp='{{ 
>> item[1] }}' line='*.{{ item[1] }}'
>>
>>   with_nested:
>>
>> - [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
>> '/home/youruser/d' ]
>>
>> - [ 'lck', 'log', 'Log' ]
>>
>> - shell: /usr/bin/git init chdir={{ item[0] }}
>>
>>   with_items:
>>
>> - [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
>> '/home/youruser/d' ]
>>
>> - shell: /usr/bin/git add -A ; /usr/bin/git commit -m 'auto'; exit 0 
>> chdir={{ item[0] }}
>>
>>   with_items:
>>
>> - [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
>> '/home/youruser/d' ]
>>
>> -- 
>> 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 .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> David Karban
> Specialista na správu linuxových serverů
> www.karban.eu
>  

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ansible-project] shell chdir not working

2013-12-11 Thread Michael Baydoun
Of course, thanks!

On Wednesday, December 11, 2013 11:13:06 AM UTC-5, Scott Sturdivant wrote:
>
> It's iterating over your list of items correctly, but by indexing to [0], 
> it's taking the first char of the item, which happens to be '/'.  Remove 
> the [0] and you should be fine.
>
>
> On Wed, Dec 11, 2013 at 9:10 AM, Michael Baydoun 
> 
> > wrote:
>
>> I expected the following to init a git repository in /home/youruser/a, 
>> but instead it's created created in /
>>
>> what am I doing wrong?
>>
>> ---
>>
>> - hosts: yourhost
>>
>>   user: root
>>
>>   gather_facts: no
>>
>>   tasks:
>>
>> - shell: /usr/bin/git init chdir={{ item[0] }}
>>
>>   with_items:
>>
>> - [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
>> '/home/youruser/d' ]
>>
>> -- 
>> 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 .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[ansible-project] shell chdir not working

2013-12-11 Thread Michael Baydoun


I expected the following to init a git repository in /home/youruser/a, but 
instead it's created created in /

what am I doing wrong?

---

- hosts: yourhost

  user: root

  gather_facts: no

  tasks:

- shell: /usr/bin/git init chdir={{ item[0] }}

  with_items:

- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
'/home/youruser/d' ]

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[ansible-project] refactor help needed

2013-12-11 Thread Michael Baydoun
 

Can the following be refactored so the following array only appears once in 
the code?

- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
'/home/youruser/d' ]


---

- hosts: yourhost

  user: root

  gather_facts: no

  tasks:

- lineinfile: dest={{ item[0] }}/.gitignore create=yes regexp='{{ 
item[1] }}' line='*.{{ item[1] }}'

  with_nested:

- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
'/home/youruser/d' ]

- [ 'lck', 'log', 'Log' ]

- shell: /usr/bin/git init chdir={{ item[0] }}

  with_items:

- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
'/home/youruser/d' ]

- shell: /usr/bin/git add -A ; /usr/bin/git commit -m 'auto'; exit 0 
chdir={{ item[0] }}

  with_items:

- [ '/home/youruser/a', '/home/youruser/b', '/home/youruser/c', 
'/home/youruser/d' ]

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ansible-project] with_nested for across multiple modules

2013-12-10 Thread Michael Baydoun

>
>
>
> Are you looking for a quicker way to reference those items than having 
> to type out the lists over and over again? 
>
>
>
yes, I want to specify the array of directories 1 time in 1 place, and not 
repeat and maintain multiple identical arrays.
after the infile module for example, I want to use the shell module to run 
a git command in each directory 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[ansible-project] with_nested for across multiple modules

2013-12-10 Thread Michael Baydoun
I'm doing something like this

  tasks:

- lineinfile: dest={{ item[0] }}/.gitignore create=yes regexp='{{ 
item[1] }}' line='*.{{ item[1] }}'

  with_nested:

- [ '/tmp/foo', '/tmp/bar' ]

- [ 'lck', 'log', 'Log' ]


but then I want to do other operations on the same list of directories 
(item[0]).  

the vars section will only take key/value pairs, not arrays.

Can I group with_nested so it's specified once but apply to multiple 
modules?

Or pre build an array that will work with_items or with_nested?

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.