Re: [ansible-project] Re: EC2 dynamic inventory: SSH rules

2016-08-31 Thread Hagai Kariti
You can try setting it to public_dns_name. It should resolve to the private
IP when you're inside the vpc, and to the public IP when your outside.

On Wed, Aug 31, 2016, 23:22 Soren Olegnowicz 
wrote:

> Sure!
>
> Currently I run: " ansible all -m ping -i ec2.py "
>
> With:
>
> destination_variable = public_dns_name
>
> vpc_destination_variable = private_ip_address
>
> The return values for the ping will only return positive on the private
> vpc instances because the ping happens via the private IP's
>
> If I change it to:
>
> vpc_destination_variable = public_ip_address
>
> then the return values for the ping will only return positive for the
> public non-vpc instances because the ping happens via the public IP's
>
> I would like to be able to successfully ping all instances with the above
> command.
>
> Hope that helps.
>
> On Monday, August 29, 2016 at 9:04:47 PM UTC-4, Soren Olegnowicz wrote:
>>
>> Hey guys I need to connect to my ec2 instances in various ways using the
>> ec2.ini provided. Right now my I can only get my ec2.ini to connect to my
>> instances via their private or public IP alone, but I need to connect to
>> some instances via their private IP and some via their public. Any
>> suggestions for introducing logic to accomplish this?
>>
> --
> 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/jfEO2I9pStM/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/fbdc0064-709e-405f-8f32-5685a5dd6d52%40googlegroups.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/CAO0%3DbmH2gGc2JRyoCUt_NfdMHyiFZyzuCBBLoDVwDB9ku5Jgjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Iterating through a list of names to create EC2 instances

2016-08-31 Thread gabriel . laden
Thank you very much for answering the question.

Gabriel



On Wednesday, October 29, 2014 at 2:02:19 AM UTC-7, Sankalp Khare wrote:
>
> Hi Renaud,
>
> I totally get what you are looking to achieve. Perhaps you've achieved it 
> already in the past year. Assuming that you are happy with specifying a start 
> index = x and a count = N to produce machines with names containing x, 
> x+1, x+2, ... x+N, I think the following playbook example will be 
> instructive. I had the same requirement and this is what I was able to 
> produce:
>
> # ansible-playbook create-web.yml --extra-vars "count=n startindex=x 
> env=production"
> # provisions n web servers in prod env with indices x, x+1, x+2, ... x+n
>
> ---
>   - name: "create and provision web servers in {{ env }} environment"
> hosts: localhost
> gather_facts: False
> tasks: 
>   - name: launch instances
> local_action:
>   module: ec2
>   key_name: "{{ launch_key.ec2_classic }}"
>   instance_type: "{{ instance.web[env] }}"
>   volumes:
>   - device_name: /dev/sda1
> volume_size: 512
> delete_on_termination: true
>   - device_name: "{{ ephemeral[0] }}"
> ephemeral: ephemeral0 
>   - device_name: "{{ ephemeral[1] }}"
> ephemeral: ephemeral1
> # ephemerals are deleted by default on termination
>   region: "{{ region }}"
>   image: "{{ os.amazon.ami_id }}"
>   wait: yes
>   group: "web-{{ env }}"
>   count: "{{ count }}"
>   wait_timeout: 1000
> register: created
> tags:
>   - create
>
>   - name: write instance ids and public dns of the instances to local 
> hosts file
> local_action:
>   module: lineinfile
>   dest: ./hosts
>   line: "{{ item.id }} {{ item.public_dns_name }}"
>   create: yes
> with_items: created.instances
> tags:
>   - create
>
>   - name: create identifier sequence for tagging
> debug: msg="{{ item }}"
> with_sequence: start="{{ startindex }}" count="{{ count }}" 
> format=%02d
> no_log: true # mute output
> register: sequence
> tags:
>   - tag
>
>   - name: tag instances
> no_log: true
> local_action: >-
>   ec2_tag
>   resource={{ item.0.id }}
>   region={{ region }}
> args:
>   tags:
> Name: "Web {{ env|title }} {{ item.1.msg }}"
> Env: "{{ env }}"
> Type: server
> Function: web
> OS: "{{ os.amazon.name }}"
> Region: "{{ region }}"
> ID: "{{ item.1.msg }}"
> with_together:
>   - created.instances
>   - sequence.results
> tags:
>   - tag
>   
>   - name: update dns records
> route53: >-
>   command=create
>   zone=yoursite.com
>   record=web.{{ item.1.msg }}.{{ env }}.server.yoursite.com
>   type=CNAME
>   ttl=300
>   value={{ item.0.public_dns_name }}
>   overwrite=true
> with_together:
>   - created.instances
>   - sequence.results
> tags:
>   - deploy
>
>   - name: register instances with load balancers
> local_action: ec2_elb
> args:
>   instance_id: "{{ item.id }}"
>   ec2_elbs: "{{ elb_names.web[env] }}"
>   region: "{{ region }}"
>   state: present
>   wait: no
> with_items: created.instances
> tags:
>   - deploy
>
>   - name: add instances to an in-memory group
> no_log: true
> local_action: add_host hostname="{{ item.public_dns_name }}" 
> groupname=fresh
> with_items: created.instances
> tags:
>   - create
>   
>   - name: wait for ssh to come up
> local_action: wait_for host="{{ item.public_dns_name }}" port=22 
> delay=60 timeout=320 state=started
> with_items: created.instances
> tags:
>   - create
>   
>   - name: provision the instances
> hosts: fresh
> user: "{{ os.amazon.user }}"
> vars:
>   user: "{{ os.amazon.user }}"
> roles:
>   - common
>   - swap
>   - python
> tags:
>   - configure
>
>   - name: summary of created instances
> hosts: fresh
> gather_facts: false
> sudo: no
> tasks:
>   - name: Get instance ec2 facts
> action: ec2_facts
> no_log: true # mute output
> register: ec2_facts
>   - name: Get resource tags from ec2 facts
> sudo: false
> no_log: true # mute output
> local_action: >-
>   ec2_tag
>   resource={{ ec2_facts.ansible_facts.ansible_ec2_instance_id }}
>   region={{ region }}
>   state=list
> register: ec2_tags
>   - debug: msg="{{ ec2_facts.ansible_facts.an

Re: [ansible-project] Missing something with host directory/file paths

2016-08-31 Thread Jon Langemak
Thank you!  Is there a better means to recursively copy then?  Or do I need 
to copy each file separately?

On Wednesday, August 31, 2016 at 5:19:57 PM UTC-5, Brian Coca wrote:
>
> by default ansible looks in the local 'controller' for the `src=` 
> parameter, you need to use `remote_src=yes` for it to look for it on the 
> target machine.
>
> Also note that `remote_src=yes` does not support recursive copying.
>
>
> --
> 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/c6bfeeb5-f49c-409e-9b1c-09d2c495c85e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: How do I pass a password as an argument?

2016-08-31 Thread Jacob brown
That's awesome Chris, thank you very much!

I'm still learning Ansible so that's a huge help. Thanks again!

On Wed, Aug 31, 2016 at 10:31 PM, Chris Helming 
wrote:

> - name: Check if machine is bound
>   shell: /bin/bash -c "realm list | grep sssd"
>   register: realmd_bound
>   changed_when: false
>   ignore_errors: true
>
> - name: Join using realmd
>   expect:
> command: "/bin/bash -c '/usr/sbin/realm join -U {{ bind_user }} {{
> bind_domain }}'"
> responses:
>   Password for.*: "{{ bind_password }}"
>   when: realmd_bound|failed
>
>
> I'm planning on getting away from realmd but that's one way to do it with
> realm.
>
>
> On Tuesday, August 30, 2016 at 4:28:22 PM UTC-4, Jacob brown wrote:
>>
>> Hi guys,
>>
>> Do you do anything for "pre flight checks"? Or is this a one-off playbook
>> your run on newly provisioned servers?
>>
>> Wouldn't mind something that goes "am I joined? notify: join ad"
>>
>> Cheers
>> Jacob
>>
>> On Saturday, 6 August 2016 03:11:29 UTC+10, Cyriel R wrote:
>>>
>>> Ohh thank you for this tips ;)
>>>
>>> Le lundi 29 février 2016 22:43:08 UTC-5, Gilberto Valentin a écrit :

 I have a playbook that installs the appropriate packages for Active
 Directory Authentication. When it gets to the "join" portion, Ansible just
 sits there because the join process is asking the user for the password of
 the account that has access to join the system to Active Directory. How can
 I pass my password from vars_prompt? I have highlighted where I call the
 variable but I know that is the wrong place since it's going to try to pass
 it to my "realm join" command, which isn't supported. I only added it there
 to show I want to call it after the "realm join" portion is called.

 Here is my playbook:

 ---
 ## This playbook installs and configures AD authentication

 - name: Install and configure AD authentication
   hosts: linux
   remote_user: root

   vars_prompt:
 - name: "ad_password"
   prompt: "Enter AD Domain User Password"
   private: yes

   tasks:
 - name: install ad_auth required tools
   yum: pkg={{ item }} state=installed
   with_items:
 - realmd
 - sssd
 - oddjob-mkhomedir
 - adcli
 - samba-common-tools

 - name: discover and join domain
   shell: realm discover AD.DOMAIN.TLD && realm join AD.DOMAIN.TLD
 --computer-ou=OU=LINUX,DC=DOMAIN,DC=TLD
 --user=user_name {{ ad_password }}

 - name: modify /etc/sssd/sssd.conf
   template: src=/home/user_name/git/system
 _configs/ansible/templates/sssd.j2 dest=/etc/sssd/sssd.conf
   notify:
 - restart sssd

   handlers:
 - name: restart sssd
   service: name=sssd state=restarted

 This is the error I get after running it:

 [user_name@server_name playbooks]$ ansible-playbook adAuth_asRoot.yaml
 --user=root --ask-pass
 SSH password:
 Enter AD Domain User Password:

 PLAY [Install and configure AD authentication]
 

 GATHERING FACTS **
 *
 ok: [ansible]

 TASK: [install ad_auth required tools] **
 **
 ok: [ansible] => (item=realmd,sssd,oddjob-mkhom
 edir,adcli,samba-common-tools)

 TASK: [discover and join domain] **
 
 failed: [ansible] => {"changed": true, "cmd": "realm discover
 AD.DOMAIN.TLD && realm join AD.DOMAIN.TLD 
 --computer-ou=OU=LINUX,DC=DOMAIN,DC=TLD
 --user=user_name ad_password", "delta": "0:00:00.053695", "end":
 "2016-02-29 20:39:40.764101", "rc": 2, "start": "2016-02-29
 20:39:40.710406", "warnings": []}
 stderr: realm: Specify one realm to join
 stdout: domain.tld
   type: kerberos
   realm-name: DOMAIN.TLD
   domain-name: domain.tld
   configured: no
   server-software: active-directory
   client-software: sssd
   required-package: oddjob
   required-package: oddjob-mkhomedir
   required-package: sssd
   required-package: adcli
   required-package: samba-common

 FATAL: all hosts have already failed -- aborting

 PLAY RECAP 
 
to retry, use: --limit @/home/user_name/adAuth_asRoot
 .yaml.retry

 ansible: ok=2changed=0unreachable=0
  failed=1

 Is there a better way to provide passwords when certain tasks call for
 it?

 --
> 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-proj

Re: [ansible-project] Missing something with host directory/file paths

2016-08-31 Thread Brian Coca
by default ansible looks in the local 'controller' for the `src=`
parameter, you need to use `remote_src=yes` for it to look for it on the
target machine.

Also note that `remote_src=yes` does not support recursive copying.


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


[ansible-project] Missing something with host directory/file paths

2016-08-31 Thread Jon Langemak
It's been awhile since I played with Ansible and right now Im tearing my 
hair out on this copy problem.  Im trying to copy a directory on a Linux 
host to a new location.  In ad-hoc ansible, it looks like this...

ansible -m copy -a "src=/usr/share/folder1 dest=/config/folder2" servers

When I run this command, Ansible tells me it can't find the directory...

10.10.10.107 | FAILED! => {
"changed": false,
"failed": true,
"msg": "Unable to find '/usr/share/folder1' in expected paths."
}

Yet, when I go on the host, I can clearly see that the source directory 
exists.  Im thinking this is something terribly obvious since I've now 
tried this on multiple hosts and get the same error each time.  I know 
Ansible is working because I can run adhoc shell commands and touch files, 
see the pwd, etc.  

Any ideas at all?  What am I missing?

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/b9069a8e-20b6-4648-8836-7e5be4adfd56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: yum module not updating package when installing from local file

2016-08-31 Thread Andrea C
Hmm, that's too bad. So you're just using the command module to do it 
manually?

It seems strange that it doesn't even say "package is already present." 
When I use the zypper module on SLES on the same RPM file, it at least 
gives me that feedback in the results.

On Tuesday, August 30, 2016 at 7:14:55 AM UTC-7, Shay Rybak wrote:
>
> Hi,
>
> I ended UP abandoning this because as far as I could see the rpm from file 
> is only supported with state exists. you can't upgrade with it.
>
> I remember I saw the feature request in Ansible forum somewhere but I 
> can't find where.
>
>
> On Tuesday, August 30, 2016 at 4:04:31 AM UTC+3, Andrea C wrote:
>>
>> I'm having this same problem...
>>
>> What is your output? What's wierd is that in the output it doesn't even 
>> tell me that my RPM is already installed. It has blank results:
>> ok: [10.0.201.83] => {"changed": false, "msg": "", "rc": 0, "results": []}
>>
>> Anyone have an idea how to fix this??
>>
>> On Friday, June 10, 2016 at 8:03:47 AM UTC-7, Dick Davies wrote:
>>>
>>> It's probably time to show us the playbooks in question. This does 
>>> work for most people, it's 
>>> possible you have made some error. 
>>>
>>> On 8 June 2016 at 08:09, Shay Rybak  wrote: 
>>> > My issue is that even when stating full package name with version it 
>>> does 
>>> > not update the package. 
>>> > 
>>> > On Tuesday, June 7, 2016 at 9:02:14 PM UTC+3, Adam Morris wrote: 
>>> >> 
>>> >> If you are just giving the package name (without a version) then the 
>>> yum 
>>> >> module will check if that is installed.  It is so no task needs to be 
>>> >> performed.  If you were using a repository you would find no 
>>> difference.  If 
>>> >> you were using a repository and set the state to latest it would 
>>> update but 
>>> >> that is not valid for a local package.  Your best bet is to specify 
>>> the full 
>>> >> package name, with version (or use a repository) 
>>> > 
>>> > -- 
>>> > 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/36d5a57e-2721-4f88-9bc3-b44b0c4f2a26%40googlegroups.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/8b66f8cf-6958-41ce-b2e9-a70af7c7ced4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible "MODULE FAILURE" on AIX node

2016-08-31 Thread Kai Stian Olstad

On 31. aug. 2016 22:03, Michelle Moreno Gutiérrez wrote:

Hi

I have been traing to execute a "ls -l" command with ansible on an AIX
group nodes but I get the next message error.


Do the nodes have Python installed? If not you need to use the raw module.



[root@machine1 ~]# ansible pdn-aix  -a "ls -l"


The default module is command, you can change that with -m 



mdebddp03 | FAILED | rc=0 >>
MODULE FAILURE

epsmdebddp03 | FAILED | rc=0 >>
MODULE FAILURE

mdebddp02 | FAILED | rc=0 >>
MODULE FAILURE

Do you know what is the correct module  for this execution?


command is the correct module, but require that Python is installed on 
the nodes. To run with the raw module that do not require Python on the 
node run this


ansible pdn-aix -m raw -a "ls -l"

--
Kai Stian Olstad

--
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/fe7ff2f5-e603-c630-bd0b-a08c77c7b75a%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible "MODULE FAILURE" on AIX node

2016-08-31 Thread Michelle Moreno Gutiérrez
Hi

I have been traing to execute a "ls -l" command with ansible on an AIX 
group nodes but I get the next message error.

[root@machine1 ~]# ansible pdn-aix  -a "ls -l" 
mdebddp03 | FAILED | rc=0 >>
MODULE FAILURE

epsmdebddp03 | FAILED | rc=0 >>
MODULE FAILURE

mdebddp02 | FAILED | rc=0 >>
MODULE FAILURE

Do you know what is the correct module  for this execution?

Thanks for your help,


Regards,

-- 
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/f3c4b220-db9f-464b-b941-2ddafd3b6051%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: EC2 dynamic inventory: SSH rules

2016-08-31 Thread Soren Olegnowicz
Sure!

Currently I run: " ansible all -m ping -i ec2.py "

With:

destination_variable = public_dns_name

vpc_destination_variable = private_ip_address

The return values for the ping will only return positive on the private vpc 
instances because the ping happens via the private IP's

If I change it to:

vpc_destination_variable = public_ip_address

then the return values for the ping will only return positive for the 
public non-vpc instances because the ping happens via the public IP's

I would like to be able to successfully ping all instances with the above 
command.

Hope that helps.

On Monday, August 29, 2016 at 9:04:47 PM UTC-4, Soren Olegnowicz wrote:
>
> Hey guys I need to connect to my ec2 instances in various ways using the 
> ec2.ini provided. Right now my I can only get my ec2.ini to connect to my 
> instances via their private or public IP alone, but I need to connect to 
> some instances via their private IP and some via their public. Any 
> suggestions for introducing logic to accomplish 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.
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/fbdc0064-709e-405f-8f32-5685a5dd6d52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] become:yes for local connection: when and how often is sudo called?

2016-08-31 Thread David Resnick
Hi,

I'm trying to understand when ansible uses sudo in a scenario where a 
playbook with become:yes is running with a local connection.

I have a playbook where I need to change the default execution PATH in 
sudoers for a following step to succeed. In order to run the playbook 
remotely, I need the tasks to run under "become:yes"

Something like this:

- hosts: all
  become: yes
  tasks:
- name: Add npm executable to sudo secure_path
  lineinfile:
dest: /etc/sudoers
regexp: '^(Defaultssecure_path = 
/sbin:/bin:/usr/sbin:/usr/bin)$'
line: '\1:/usr/local/lib/npm/bin'
backrefs: yes
state: present
- name: Add service to run PM2
  shell: /usr/local/lib/npm/bin/pm2 startup systemd --user nodejs --hp 
/home/nodejs
  args:
creates: /etc/systemd/system/pm2.service

Running each of the above tasks in separate sessions sets things up 
properly. But when I run this locally in the same play, the change to the 
sudoers file has no effect on the "pm2 startup" task.

When does ansible call sudo? Just at the start of the block? Is there any 
way to force ansible to leave a sudo session and to start a new one?

Thanks,
David

-- 
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/f6f5deff-2fd0-47f7-8c7a-19d309d5131f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Can I define my inventory in my playbook directory?

2016-08-31 Thread skinnedknuckles
Thanks Kai for pointing out my mistake!!

On Wednesday, August 24, 2016 at 10:02:37 AM UTC-5, skinnedknuckles wrote:
>
> Management Node:
>
>- CentOs 6
>- Ansible 2.1
>
> Remote Node:
>
>- Windows 7
>- Powershell 3.0
>
>
> My playbooks are all saved in /home/username/playbooks.
>
> My inventory file is saved as /etc/ansible/hosts.
>
> And I also use the file etc/ansible/group_vars/windows.yml
>
> I find it a hassle to go back and forth between these 2 locations.  Why 
> can't I define my inventory and group vars in my playbooks directory?  What 
> is the best way to do that?
>

-- 
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/771bffb5-ed26-4823-be87-7f481af4d160%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible 2.1.2 RC2 is ready for testing

2016-08-31 Thread nusenu
Hi,

are there any plans to fix regression [1] with ansible version 2.1.2?


[1] https://github.com/ansible/ansible/issues/14829

thanks,
nusenu

-- 
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/625a78f1-20d1-0816-c97d-eb14a9211a9d%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


[ansible-project] Ansible 2.1.2 RC2 is ready for testing

2016-08-31 Thread James Cammarata
Hi all, we're happy to announce that RC2 for 2.1.2 is now available for
testing.

This release candidate also adds the following fixes for bugs:

* Fixed a bug in which INI files incorrectly treated a hosts range as a
section header (#15331)
* Fixed a bug in which the max_fail_percentage calculation erroneously
caused a series of plays to stop executing (#15954)
* Fixed a bug in fetch actions which were not idempotent when the target
file was a symlink (#17255)
* Fixed a bug in which the task names were not properly templated (#16295)
* Fixed a bug causing "squashed" loops (ie. yum, apt) to incorrectly report
results (ansible-modules-core#4214)
* Fixed several bugs related to includes:
  - when including statically, make sure that all parents were also
included statically (issue #16990)
  - properly resolve nested static include paths
  - print a message when a file is statically included
* Fixed a bug in which module params expected to be float types were not
converted from integers (only strings) (#17325)


How do you get it?
--

The tar.gz of the release can be found here:

http://releases.ansible.com/ansible/ansible-2.1.2.0-0.2.rc2.tar.gz
SHA256: 98237d2fc64f5d8af8cb9b123c040ec46093e75ec1c8804095de230580104aad

You can also test against the git repository as follows:

$ git clone https://github.com/ansible/ansible.git
$ cd ansible
$ git checkout v2.1.2.0-0.2.rc2
$ git submodule update --init

You can then source our testing script:

$ . hacking/env-setup

or you can build your own .tar.gz (output will be
dist/ansible-2.1.2.0.tar.gz):

$ make sdist

If you discover any errors, or if you see any regressions from playbooks
which work on 1.9.x and prior, please open a Github issue and be sure to
mention you're testing against this release candidate.

Thanks!

James Cammarata

Ansible Lead/Sr. Principal Software Engineer
Ansible by Red Hat
twitter: @thejimic, github: jimi-c

-- 
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/CAMFyvFiW8XxQ0prXwK_g%3DX1-oQtmowgiZ%2BG-A6hFqeQZ4n6Zvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Can I define my inventory in my playbook directory?

2016-08-31 Thread Kai Stian Olstad

On 31. aug. 2016 19:13, skinnedknuckles wrote:

I must be missing something.  I created a ansible.cfg file with this...

[default]
hostfile = /fs01/home/janderson/hosts

and one with this...

[default]
inventory = /fs01/home/janderson/hosts


This last one is almost correct, but you are missing an s it's [defaults]

--
Kai Stian Olstad

--
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/7312e299-a450-01fd-80cb-86606829276a%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] openstack restful api

2016-08-31 Thread nandareddy578
Hello All,

Is there any way we can use restful api's instead of connecting using ssh 
to target machine? I've seen we can connect to local machine using local 
connection(connection: local). In the same way is there any mechanism in 
ansible through which we can connect to remote machine using restful api's 
and perform action.

Thanks,
Nanda B.

-- 
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/e26a7899-a31b-440e-bf9a-7223375b41f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Using lookup with log_path in ansible.cfg

2016-08-31 Thread Kevin Ying
I've seen some examples referring to the use of lookup with log_path to log 
output to datestamped logfiles:

e.g.

log_path = ~/.ansible/logs/ansible.{{ lookup('pipe', 'date +%Y%m%d') }}.log

I've been trying various permutations of this pattern but nothing seems to 
work.  File permissions are correct as the logfile that is written to is 
quite literally the label from above including the curly braces and parens.

Is this use of lookup with log_path in ansible.cfg no longer supported?

-- 
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/3426d897-c6a5-45c5-ac21-b9ad2e900072%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] UFW module issues

2016-08-31 Thread Guy Knights
I'm running into a confusing issue with the UFW module. I've been using the
same role to configure my rules for a while without any problems, but
recently I pulled the latest updates for stable-2.1 and now I'm getting the
following error for the task below:

- name: enable firewall policy if specified
  ufw:
policy: reject
state: enabled
  when: "{{ firewall.enabled }} == True"

FAILED! => {"changed": false, "failed": true, "msg": "Direction must be
specified when creating a rule on an interface"}

I haven't specified an interface so the error doesn't really make sense to
me, but all the same I tried adding a direction parameter to the above
task, and after doing so it gives me the following different error:

FAILED! => {"changed": false, "failed": true, "msg": "ERROR: Invalid
syntax\n"}

In the docs for the UFW module it has the following example which is, for
all intents and purposes, the same as my original task:

# Allow everything and enable UFW
ufw: state=enabled policy=allow

Any help would be appreciated!

Thanks,
Guy

-- 
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/CANNH9mtE%2BJPEEjq%2B%2BA59EsnVUoXMKrAbOfi6EBxZ37J7rfKEUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Can I define my inventory in my playbook directory?

2016-08-31 Thread Dick Davies
We lay ours out in the playbook directory like this

site.yml
prod/
- group_vars/
- all
- hosts
staging/
   - group_vars/
  - all
   - hosts

and then run with

ansible-playbook -i $environment site.yml


On 24 August 2016 at 16:02, skinnedknuckles
 wrote:
> Management Node:
>
> CentOs 6
> Ansible 2.1
>
> Remote Node:
>
> Windows 7
> Powershell 3.0
>
>
> My playbooks are all saved in /home/username/playbooks.
>
> My inventory file is saved as /etc/ansible/hosts.
>
> And I also use the file etc/ansible/group_vars/windows.yml
>
> I find it a hassle to go back and forth between these 2 locations.  Why
> can't I define my inventory and group vars in my playbooks directory?  What
> is the best way to do that?
>
> --
> 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/60334eae-42fb-4154-b65f-a5090313c8f7%40googlegroups.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/CAK5eLPQZOWCMKSwqYpq9fEMkdHfOoKemjjEQ449msfX510ftAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Unable to install Ansible on Redhat 6.6 (RHEL) - missing dependency python-six

2016-08-31 Thread Dick Davies
It's in the 'extras' centos-6 repo, I don't have a RHEL VM to hand to
check but I'd expect
it to be in the RHN repos - from memory maybe the 'optional' one?

On 31 August 2016 at 13:37,   wrote:
>
> I am unable to install Ansible on Redhat 6.6 (RHEL) due to a missing
> dependency for python-six.  When I try to install python-six, I get this
> response. "No package python-six available."  These are the steps I use to
> replicate the problem.
>
> -Download the x86_64 rpm for the EPEL repository
> wget
> http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
>
> -Install the EPEL rpm to add the repository to my system
> yum install epel-release-6-8.noarch.rpm
>
> -Install ansible
> yum update && yum install ansible
>
> -I get this error
> Error: Package: ansible-2.1.1.0-1.el6.noarch (epel)
>Requires: python-six
>
> -Install python-six
> yum install python-six
>
> -I get this error
> No package python-six available.
>
> Thanks in advance for any help you can provide.
>
>
>
> --
> 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/07406f0a-e63a-4925-a492-8a726a77a4f3%40googlegroups.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/CAK5eLPTD%2B8DizYkCe9Vff3%3D4FkPKn3Wdx94UMTOhrEbgKY43AA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Can I define my inventory in my playbook directory?

2016-08-31 Thread skinnedknuckles
I must be missing something.  I created a ansible.cfg file with this...

[default]
hostfile = /fs01/home/janderson/hosts 

and one with this...

[default]
inventory = /fs01/home/janderson/hosts 

and neither one worked. 

Where can I get a default or sample ansible.cfg file to modify?



On Wednesday, August 24, 2016 at 10:02:37 AM UTC-5, skinnedknuckles wrote:
>
> Management Node:
>
>- CentOs 6
>- Ansible 2.1
>
> Remote Node:
>
>- Windows 7
>- Powershell 3.0
>
>
> My playbooks are all saved in /home/username/playbooks.
>
> My inventory file is saved as /etc/ansible/hosts.
>
> And I also use the file etc/ansible/group_vars/windows.yml
>
> I find it a hassle to go back and forth between these 2 locations.  Why 
> can't I define my inventory and group vars in my playbooks directory?  What 
> is the best way to do that?
>

-- 
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/1a17d6e4-4132-47fb-bde9-38662011529d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Only execute task then certain URL is NOT reachable

2016-08-31 Thread guenther . grill
Hi, 

I have a setup with Apache Mesos and Marathon. 
I also deploy a Elasticsearch with JSON to the Mesos Cluster via Ansible.
But this should only be done, when a certain endpont 
http://mesos...:8080/v2/apps/elasticserach
is NOT reachable. That indicates, that the module is already (or isn't) 
installed.

How can I do that in my main.yml?

regards
guenther

-- 
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/b44d6c57-3953-4710-bc22-f7efae80df54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Unable to install Ansible on Redhat 6.6 (RHEL) - missing dependency python-six

2016-08-31 Thread rbooth

I am unable to install Ansible on Redhat 6.6 (RHEL) due to a missing 
dependency for python-six.  When I try to install python-six, I get this 
response. "No package python-six available."  These are the steps I use to 
replicate the problem.

-Download the x86_64 rpm for the EPEL repository
wget 
http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

-Install the EPEL rpm to add the repository to my system
yum install epel-release-6-8.noarch.rpm

-Install ansible
yum update && yum install ansible

-I get this error
Error: Package: ansible-2.1.1.0-1.el6.noarch (epel)
   Requires: python-six

-Install python-six
yum install python-six

-I get this error
No package python-six available.

Thanks in advance for any help you can provide.



-- 
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/07406f0a-e63a-4925-a492-8a726a77a4f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: EC2 dynamic inventory: SSH rules

2016-08-31 Thread Hagai Kariti
Can you elaborate on what doesn't work vs what you want?

On Wed, Aug 31, 2016 at 5:09 PM Soren Olegnowicz 
wrote:

> Unfortunately, this setting does not help. Perhaps I need to run Ansible
> from within Amazon instead of locally?
>
>
> On Tuesday, August 30, 2016 at 5:21:06 AM UTC-4, Hagai Kariti wrote:
>>
>> You can set destination_variable to public_dns_name in ec2.ini (I think
>> this is the default). Amazon's DNS servers resolve the public DNS name to
>> the private IP when you're inside AWS and to the public IP when you're
>> outside.
>>
>> Does that help?
>>
>> On Tuesday, August 30, 2016 at 4:04:47 AM UTC+3, Soren Olegnowicz wrote:
>>>
>>> Hey guys I need to connect to my ec2 instances in various ways using the
>>> ec2.ini provided. Right now my I can only get my ec2.ini to connect to my
>>> instances via their private or public IP alone, but I need to connect to
>>> some instances via their private IP and some via their public. Any
>>> suggestions for introducing logic to accomplish this?
>>>
>> --
> 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/jfEO2I9pStM/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/41a14cc3-d025-4465-9e30-6a36257a1587%40googlegroups.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/CAO0%3DbmEiEtb06%2BGNM_1FxO%3D_hMkFXeToY8xaeOUZFfgJjitrnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Work with Jinja/template issue

2016-08-31 Thread Kai Stian Olstad

On 27. aug. 2016 05:20, Lupin Deterd wrote:

Hi,

I want to gather all the NICs and its IP address from facts. So I tried
iterating to all interfaces, i.e

{% for nic in ansible_interfaces %}
  {% set present_nic = 'facter_ipaddress_%s' | format( nic ) %}
| {{ nic }} | {{ present_nic }} |
{% endfor %}

The present_nic variable turn into some form of string and won't evaluate
object anymore. :(

I wanted to grab the value of 'facter_ipaddress_{{ nic }} key, but instead
got a literal string.

| *NIC* | *IP* | *Netmask* |
  | lo | facter_ipaddress_lo |
  | enp0s3 | facter_ipaddress_enp0s3 |
  | enp0s8 | facter_ipaddress_enp0s8 |

Is there a way to get around with this, without resorting to writing a
custom facts/module?


{% for nic in ansible_interfaces %}
| {{ nic }} | {{ hostvars[inventory_hostname]['facter_ipaddress_' + nic] 
}} |

{% endfor %}

--
Kai Stian Olstad

--
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/1e715278-620b-9f25-408b-b91fc9c2dfe0%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Need help with deprecation warnings

2016-08-31 Thread Kai Stian Olstad

On 30. aug. 2016 21:36, ayush.ku...@similarweb.com wrote:

Hey all,

Just trying to figure out how to fix the deprecation warnings (recently
updated to 2.1.1.0 from 1.7). I used to have the 4 individual tasks in the
block below (I left the commented out when statements from the original 1.7
tasks). I tried refactoring a couple of times, but with the current setup,
I still get "Skipping task due to undefined Error, in the future this will
be a fatal error.: 'project_config' is undefined." on all 4 tasks when
project_config is undefined. Shouldn't the block just skip the tasks?


You would think so, since the documentation says
"...tasks will be executed after appending the when condition from the 
block and evaluating it in the task’s context."




Is
there something I'm missing about how blocks are executed? Is there a
better way to rewrite this set of tasks?

- block:
- name: Install system dependencies for project
  become: True
  apt: pkg={{ item }} state=installed
  with_items: " {{ project_config.apt|default([]) }}"
  # when: project_config is defined and 'apt' in project_config


If project_config is not defined this will work
  with_items: "{{ project_config | default([]) }}"

but thees two will give a deprecation warning
  with_items: "{{ project_config.apt | default([]) }}"
  with_items: "{{ project_config['apt'] | default([]) }}"

To me this looks like a bug.




- name: Install pip dependencies for project from files
  pip: requirements={{ full_project_root }}/project_config/{{ item }}
   virtualenv_command=virtualenv
   virtualenv={{ venvdir }}
   virtualenv_python={{ venv_python }}
   virtualenv_site_packages=no
   state=present
  with_items: "{{ project_config.pip_files|default([]) }}"
  # when: project_config is defined and 'pip_files' in project_config
  environment: "{{ pip_internal }}"

- name: Install npm dependencies
  npm: path="{{ full_project_root }}/project_config/{{ item }}"
   state=latest
   production={{ npm_production }}
  with_items: "{{ project_config.npm_package_json_path|default([]) }}"
  # when: project_config is defined and 'npm_package_json_path' in
project_config

- name: Run Django server setup commands
  django_manage: command={{ item }}
 app_path={{ django_manage_path }}
 virtualenv={{ venvdir }}
 settings={{ app_module }}.settings.{{ env }}
  with_items: "{{ project_config.django_commands|default([]) }}"
  # when: project_config is defined and 'django_commands' in
project_config
  when: project_config is defined


--
Kai Stian Olstad

--
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/864bc7be-cbe8-8358-292e-2e3ca7114147%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_copy failing (timeout)

2016-08-31 Thread Justin Dugan
I have also tried unarchive which fails with the same error.

-- 
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/c0ddb353-821b-4097-9b6a-3189890d8c0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] win_copy failing (timeout)

2016-08-31 Thread Justin Dugan
I am using this in the playbook:

- name: copy {{eap_dir}}.0.zip
  win_copy: src="{{eap_dir}}.0.zip" dest="c:/temp/{{eap_dir}}.0.zip"


And it's failing with:

TASK [win_JBoss : copy jboss-eap-6.4.0.zip] 

 [WARNING]: FATAL ERROR DURING FILE TRANSFER: Traceback (most recent call 
last):   File
"/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", 
line 204, in _winrm_exec
self._winrm_send_input(self.protocol, self.shell_id, command_id, data, 
eof=is_last)   File
"/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py", 
line 185, in
_winrm_send_input rs = protocol.send_message(xmltodict.unparse(rq))   
File "/usr/lib/python2.7
/site-packages/winrm/protocol.py", line 207, in send_message return
self.transport.send_message(message)   File 
"/usr/lib/python2.7/site-packages/winrm/transport.py",
line 173, in send_message response = self.session.send(prepared_request,
timeout=self.read_timeout_sec)   File 
"/usr/lib/python2.7/site-packages/requests/sessions.py", line
596, in send r = adapter.send(request, **kwargs)   File 
"/usr/lib/python2.7/site-
packages/requests/adapters.py", line 499, in send raise ReadTimeout(e, 
request=request)
ReadTimeout: HTTPSConnectionPool(host='host', port=5986): Read timed
out. (read timeout=30)

fatal: [jcinstalltest]: FAILED! => {"failed": true, "msg": "winrm 
send_input failed"}

Is there any way to adjust the timeout? This file is ~200Mb. I also have a 
patch to copy which is ~400Mb so 30 seconds is probably too short.

Thanks,

Justin

-- 
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/9c5d027f-edc2-4356-9d34-7a4b13c81957%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: EC2 dynamic inventory: SSH rules

2016-08-31 Thread Soren Olegnowicz
Unfortunately, this setting does not help. Perhaps I need to run Ansible 
from within Amazon instead of locally?

On Tuesday, August 30, 2016 at 5:21:06 AM UTC-4, Hagai Kariti wrote:
>
> You can set destination_variable to public_dns_name in ec2.ini (I think 
> this is the default). Amazon's DNS servers resolve the public DNS name to 
> the private IP when you're inside AWS and to the public IP when you're 
> outside.
>
> Does that help?
>
> On Tuesday, August 30, 2016 at 4:04:47 AM UTC+3, Soren Olegnowicz wrote:
>>
>> Hey guys I need to connect to my ec2 instances in various ways using the 
>> ec2.ini provided. Right now my I can only get my ec2.ini to connect to my 
>> instances via their private or public IP alone, but I need to connect to 
>> some instances via their private IP and some via their public. Any 
>> suggestions for introducing logic to accomplish 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.
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/41a14cc3-d025-4465-9e30-6a36257a1587%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] win_service play fails when run without an optional parameter

2016-08-31 Thread Dimitri Yioulos
All,

I'm running version 2.1.1, and have a very simple play to restart a service 
on my Win2k8 and Win2k12 servers:

---

- hosts: all
  gather_facts: false

  tasks:
- name: restart ListManagerWeb
  win_service:
name: ListManagerWeb
state: restarted
start_mode: auto

The start_mode parameter is optional and, until a few days ago, the play 
would run without it.  However, if I run the play without it, I get the 
following:


 ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5986 TO talk
 EXEC Set-StrictMode -Version Latest
(New-Item -Type Directory -Path $env:temp -Name 
"ansible-tmp-1472648842.63-190726517193215").FullName | Write-Host 
-Separator '';
 PUT "/tmp/tmp7PEdUH" TO 
"C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1472648842.63-190726517193215\win_service.ps1"
 EXEC Set-StrictMode -Version Latest
Try
{
& 
'C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1472648842.63-190726517193215\win_service.ps1'
}
Catch
{
$_obj = @{ failed = $true }
If ($_.Exception.GetType)
{
$_obj.Add('msg', $_.Exception.Message)
}
Else
{
$_obj.Add('msg', $_.ToString())
}
If ($_.InvocationInfo.PositionMessage)
{
$_obj.Add('exception', $_.InvocationInfo.PositionMessage)
}
ElseIf ($_.ScriptStackTrace)
{
$_obj.Add('exception', $_.ScriptStackTrace)
}
Try
{
$_obj.Add('error_record', ($_ | ConvertTo-Json | ConvertFrom-Json))
}
Catch
{
}
Echo $_obj | ConvertTo-Json -Compress -Depth 99
Exit 1
}
An exception occurred during task execution. The full traceback is:
At 
C:\Users\ansible\AppData\Local\Temp\ansible-tmp-1472648842.63-190726517193215\win_service.ps1:265
 
char:5
+ If ($params.start_mode) {
+ ~~
*fatal: [talk]: FAILED! => {"changed": false, "failed": true, "invocation": 
{"module_name": "win_service"}, "msg": "The property 'start_mode' cannot be 
found on this object. Verify that the property exists."}*


Why, all of a sudden, am I seeing this behavior, and how do I fix it?

With 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/16f8944f-a0d0-4c3f-8cb1-113f5bddb6fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How do I pass a password as an argument?

2016-08-31 Thread Chris Helming
- name: Check if machine is bound
  shell: /bin/bash -c "realm list | grep sssd"
  register: realmd_bound
  changed_when: false
  ignore_errors: true

- name: Join using realmd
  expect:
command: "/bin/bash -c '/usr/sbin/realm join -U {{ bind_user }} {{ 
bind_domain }}'"
responses: 
  Password for.*: "{{ bind_password }}" 
  when: realmd_bound|failed


I'm planning on getting away from realmd but that's one way to do it with 
realm.

On Tuesday, August 30, 2016 at 4:28:22 PM UTC-4, Jacob brown wrote:
>
> Hi guys,
>
> Do you do anything for "pre flight checks"? Or is this a one-off playbook 
> your run on newly provisioned servers?
>
> Wouldn't mind something that goes "am I joined? notify: join ad"
>
> Cheers
> Jacob
>
> On Saturday, 6 August 2016 03:11:29 UTC+10, Cyriel R wrote:
>>
>> Ohh thank you for this tips ;)
>>
>> Le lundi 29 février 2016 22:43:08 UTC-5, Gilberto Valentin a écrit :
>>>
>>> I have a playbook that installs the appropriate packages for Active 
>>> Directory Authentication. When it gets to the "join" portion, Ansible just 
>>> sits there because the join process is asking the user for the password of 
>>> the account that has access to join the system to Active Directory. How can 
>>> I pass my password from vars_prompt? I have highlighted where I call the 
>>> variable but I know that is the wrong place since it's going to try to pass 
>>> it to my "realm join" command, which isn't supported. I only added it there 
>>> to show I want to call it after the "realm join" portion is called.
>>>
>>> Here is my playbook:
>>>
>>> ---
>>> ## This playbook installs and configures AD authentication
>>>
>>> - name: Install and configure AD authentication
>>>   hosts: linux
>>>   remote_user: root
>>>
>>>   vars_prompt:
>>> - name: "ad_password"
>>>   prompt: "Enter AD Domain User Password"
>>>   private: yes
>>>
>>>   tasks:
>>> - name: install ad_auth required tools
>>>   yum: pkg={{ item }} state=installed
>>>   with_items:
>>> - realmd
>>> - sssd
>>> - oddjob-mkhomedir
>>> - adcli
>>> - samba-common-tools
>>>
>>> - name: discover and join domain
>>>   shell: realm discover AD.DOMAIN.TLD && realm join AD.DOMAIN.TLD
>>> --computer-ou=OU=LINUX,DC=DOMAIN,DC=TLD --user=user_name {{ 
>>> ad_password }}
>>>
>>> - name: modify /etc/sssd/sssd.conf
>>>   template: 
>>> src=/home/user_name/git/system_configs/ansible/templates/sssd.j2 
>>> dest=/etc/sssd/sssd.conf
>>>   notify:
>>> - restart sssd
>>>
>>>   handlers:
>>> - name: restart sssd
>>>   service: name=sssd state=restarted
>>>
>>> This is the error I get after running it:
>>>
>>> [user_name@server_name playbooks]$ ansible-playbook adAuth_asRoot.yaml 
>>> --user=root --ask-pass
>>> SSH password:
>>> Enter AD Domain User Password:
>>>
>>> PLAY [Install and configure AD authentication] 
>>> 
>>>
>>> GATHERING FACTS 
>>> ***
>>> ok: [ansible]
>>>
>>> TASK: [install ad_auth required tools] 
>>> 
>>> ok: [ansible] => 
>>> (item=realmd,sssd,oddjob-mkhomedir,adcli,samba-common-tools)
>>>
>>> TASK: [discover and join domain] 
>>> **
>>> failed: [ansible] => {"changed": true, "cmd": "realm discover 
>>> AD.DOMAIN.TLD && realm join AD.DOMAIN.TLD 
>>> --computer-ou=OU=LINUX,DC=DOMAIN,DC=TLD --user=user_name ad_password", 
>>> "delta": "0:00:00.053695", "end": "2016-02-29 20:39:40.764101", "rc": 2, 
>>> "start": "2016-02-29 20:39:40.710406", "warnings": []}
>>> stderr: realm: Specify one realm to join
>>> stdout: domain.tld
>>>   type: kerberos
>>>   realm-name: DOMAIN.TLD
>>>   domain-name: domain.tld
>>>   configured: no
>>>   server-software: active-directory
>>>   client-software: sssd
>>>   required-package: oddjob
>>>   required-package: oddjob-mkhomedir
>>>   required-package: sssd
>>>   required-package: adcli
>>>   required-package: samba-common
>>>
>>> FATAL: all hosts have already failed -- aborting
>>>
>>> PLAY RECAP 
>>> 
>>>to retry, use: --limit 
>>> @/home/user_name/adAuth_asRoot.yaml.retry
>>>
>>> ansible: ok=2changed=0unreachable=0   
>>>  failed=1
>>>
>>> Is there a better way to provide passwords when certain tasks call for 
>>> 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/84fe76c3-78da-4817-9ef6-4711fa82cb9e%40googlegroups.com.
For more options, visit https://groups.google.com/

[ansible-project] Re: unable to evaluate conditional

2016-08-31 Thread fanvalt
I finally found out how to solve this but I don't understand why.
I had to use the following syntax to use the register variable, even if the 
register variable was not containing an "_" in its name:

- debug: msg="previous {{previous}}"
- debug: msg="previous isdir {{previous.results[0].stat.isdir}}"
- debug: msg="previous path {{previous.results[0].stat.path}}"

Le mercredi 31 août 2016 11:43:51 UTC+2, fanvalt a écrit :
>
> Hello,
>
> I don't understand where I am doing wrong in this simple tasks:
>
> - name: Search for bin directory
>   stat:
> path: /{{ Directoryname }}/{{ item }}/bin
>   register: previous
>   with_items: "{{ shr4you_inst.stdout_lines }}"
>   when: shr4you_inst|success
>
> - debug: msg="previous {{previous}}"
>
> - name: stop karaf
>   shell: chdir={{ previous.stat.path }} ./stop
>   async: 5
>   poll: 5
>   ignore_errors: True
>   when: previous.stat.isdir
>
> The last When: condition is ALWAYS running with this error: "The error 
> was: unable to evaluate conditional: previous.stat.isdir"
>
> Here is the logfile:
> TASK [4YOU : Search for bin directory] 
> **
> ok: [integuno] => (item=SHR_4YOU-hra-1.1.0-SNAPSHOT)
>
> TASK [4YOU : debug] 
> 
> ok: [integuno] => {
> "msg": "previous {'msg': u'All items completed', 'changed': False, 
> 'results': [{u'stat': {u'uid': 54322, u'exists': True, u'woth': False, 
> u'mtime': 1472557536, u'inode': 21695026, u'isgid': False, u'size': 4096, 
> u'wgrp': False, u'isuid': False, u'isreg': False, u'pw_name': u'integuno', 
> u'gid': 54323, u'ischr': False, u'wusr': True, u'xoth': True, u'rusr': 
> True, u'nlink': 2, u'issock': False, u'rgrp': True, u'gr_name': u'hr', 
> u'path': u'/integuno/DV70_EX/SHR_4YOU-hra-1.1.0-SNAPSHOT/bin', u'xusr': 
> True, u'atime': 1472557622, u'isdir': True, u'ctime': 1472634055, u'isblk': 
> False, u'xgrp': True, u'dev': 64768, u'roth': True, u'isfifo': False, 
> u'mode': u'0755', u'islnk': False}, u'changed': False, '_ansible_no_log': 
> False, '_ansible_item_result': True, 'item': 
> u'SHR_4YOU-hra-1.1.0-SNAPSHOT', 'invocation': {'module_name': u'stat', 
> u'module_args': {u'checksum_algorithm': u'sha1', u'mime': False, 
> u'get_checksum': True, u'follow': False, u'path': 
> u'/integuno/DV70_EX/SHR_4YOU-hra-1.1.0-SNAPSHOT/bin', u'get_md5': True}}}]}"
> }
>
> TASK [4YOU : stop karaf] 
> ***
> fatal: [integuno]: FAILED! => {"failed": true, "msg": "The conditional 
> check 'previous.stat.isdir' failed. The error was: unable to evaluate 
> conditional: previous.stat.isdir\n\nThe error appears to have been in 
> '/home/fvaltat/4YOU/roles/4YOU/tasks/sauvegarde.yml': line 18, 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: stop karaf\n  ^ 
> here\n"}
> ...ignoring
>
> Thanks for your help,
> Regards
>
>

-- 
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/dceaa9ea-bb3f-499a-b766-eef5128e8c69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] unable to evaluate conditional

2016-08-31 Thread Kai Stian Olstad

On 31. aug. 2016 11:43, fanvalt wrote:

Hello,

I don't understand where I am doing wrong in this simple tasks:

- name: Search for bin directory
  stat:
path: /{{ Directoryname }}/{{ item }}/bin
  register: previous
  with_items: "{{ shr4you_inst.stdout_lines }}"
  when: shr4you_inst|success

- debug: msg="previous {{previous}}"


It very hard to read the output using debug this way, please use this 
instead

- debug: var=previous

If you do you probably will see what's happening a lot easier.

When you use register with with_items the result back is a list.

https://docs.ansible.com/ansible/playbooks_loops.html#using-register-with-a-loop

--
Kai Stian Olstad

--
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/e163e692-faf6-eadd-79be-423c3aedb197%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: unable to evaluate conditional

2016-08-31 Thread fanvalt
if I add 2 debug tasks this way , it seems the previous.stat is not defined 
anymore.

- debug: msg="previous {{previous}}"
- debug: msg="previous isdir {{previous.stat.isdir}}"
- debug: msg="previous path {{previous.stat.path}}"

TASK [4YOU : debug] 

ok: [integuno] => {
"msg": "previous {'msg': u'All items completed', 'changed': False, 
'results': [{u'stat': {u'uid': 54322, u'exists': True, u'woth': False, 
u'mtime': 1472557536, u'inode': 21695026, u'isgid': False, u'size': 4096, 
u'wgrp': False, u'isuid': False, u'isreg': False, u'pw_name': u'integuno', 
u'gid': 54323, u'ischr': False, u'wusr': True, u'xoth': True, u'rusr': 
True, u'nlink': 2, u'issock': False, u'rgrp': True, u'gr_name': u'hr', 
u'path': u'/integuno/DV70_EX/SHR_4YOU-hra-1.1.0-SNAPSHOT/bin', u'xusr': 
True, u'atime': 1472557622, u'isdir': True, u'ctime': 1472634055, u'isblk': 
False, u'xgrp': True, u'dev': 64768, u'roth': True, u'isfifo': False, 
u'mode': u'0755', u'islnk': False}, u'changed': False, '_ansible_no_log': 
False, '_ansible_item_result': True, 'item': 
u'SHR_4YOU-hra-1.1.0-SNAPSHOT', 'invocation': {'module_name': u'stat', 
u'module_args': {u'checksum_algorithm': u'sha1', u'mime': False, 
u'get_checksum': True, u'follow': False, u'path': 
u'/integuno/DV70_EX/SHR_4YOU-hra-1.1.0-SNAPSHOT/bin', u'get_md5': True}}}]}"
}

TASK [4YOU : debug] 

ok: [integuno] => {
"msg": "previous isdir {{previous.stat.isdir}}"
}

TASK [4YOU : debug] 

ok: [integuno] => {
"msg": "previous path {{previous.stat.path}}"



Any idea ?

Le mercredi 31 août 2016 11:43:51 UTC+2, fanvalt a écrit :
>
> Hello,
>
> I don't understand where I am doing wrong in this simple tasks:
>
> - name: Search for bin directory
>   stat:
> path: /{{ Directoryname }}/{{ item }}/bin
>   register: previous
>   with_items: "{{ shr4you_inst.stdout_lines }}"
>   when: shr4you_inst|success
>
> - debug: msg="previous {{previous}}"
>
> - name: stop karaf
>   shell: chdir={{ previous.stat.path }} ./stop
>   async: 5
>   poll: 5
>   ignore_errors: True
>   when: previous.stat.isdir
>
> The last When: condition is ALWAYS running with this error: "The error 
> was: unable to evaluate conditional: previous.stat.isdir"
>
> Here is the logfile:
> TASK [4YOU : Search for bin directory] 
> **
> ok: [integuno] => (item=SHR_4YOU-hra-1.1.0-SNAPSHOT)
>
> TASK [4YOU : debug] 
> 
> ok: [integuno] => {
> "msg": "previous {'msg': u'All items completed', 'changed': False, 
> 'results': [{u'stat': {u'uid': 54322, u'exists': True, u'woth': False, 
> u'mtime': 1472557536, u'inode': 21695026, u'isgid': False, u'size': 4096, 
> u'wgrp': False, u'isuid': False, u'isreg': False, u'pw_name': u'integuno', 
> u'gid': 54323, u'ischr': False, u'wusr': True, u'xoth': True, u'rusr': 
> True, u'nlink': 2, u'issock': False, u'rgrp': True, u'gr_name': u'hr', 
> u'path': u'/integuno/DV70_EX/SHR_4YOU-hra-1.1.0-SNAPSHOT/bin', u'xusr': 
> True, u'atime': 1472557622, u'isdir': True, u'ctime': 1472634055, u'isblk': 
> False, u'xgrp': True, u'dev': 64768, u'roth': True, u'isfifo': False, 
> u'mode': u'0755', u'islnk': False}, u'changed': False, '_ansible_no_log': 
> False, '_ansible_item_result': True, 'item': 
> u'SHR_4YOU-hra-1.1.0-SNAPSHOT', 'invocation': {'module_name': u'stat', 
> u'module_args': {u'checksum_algorithm': u'sha1', u'mime': False, 
> u'get_checksum': True, u'follow': False, u'path': 
> u'/integuno/DV70_EX/SHR_4YOU-hra-1.1.0-SNAPSHOT/bin', u'get_md5': True}}}]}"
> }
>
> TASK [4YOU : stop karaf] 
> ***
> fatal: [integuno]: FAILED! => {"failed": true, "msg": "The conditional 
> check 'previous.stat.isdir' failed. The error was: unable to evaluate 
> conditional: previous.stat.isdir\n\nThe error appears to have been in 
> '/home/fvaltat/4YOU/roles/4YOU/tasks/sauvegarde.yml': line 18, 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: stop karaf\n  ^ 
> here\n"}
> ...ignoring
>
> Thanks for your help,
> Regards
>
>

-- 
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/678a96b7-377a-4c40-9b5e-1cea45da44b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: display a message at the end of a ansible playbook

2016-08-31 Thread pixel fairy
this as a task

  - debug: msg="you can now connect to http://xyz.com/setup.php to finish 
installation"

you can also use variables in the message

On Tuesday, August 30, 2016 at 1:27:45 PM UTC-7, synova.m...@gmail.com 
wrote:
>
> Hi,
>
> Is there a way to display a message on the screen at the end of the script 
> (for example: you can now connect to http://xyz.com/setup.php to finish 
> installation)
>
> Best regards
>

-- 
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/c4baff98-7b83-4bf8-bb90-db064422ff07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] unable to evaluate conditional

2016-08-31 Thread fanvalt
Hello,

I don't understand where I am doing wrong in this simple tasks:

- name: Search for bin directory
  stat:
path: /{{ Directoryname }}/{{ item }}/bin
  register: previous
  with_items: "{{ shr4you_inst.stdout_lines }}"
  when: shr4you_inst|success

- debug: msg="previous {{previous}}"

- name: stop karaf
  shell: chdir={{ previous.stat.path }} ./stop
  async: 5
  poll: 5
  ignore_errors: True
  when: previous.stat.isdir

The last When: condition is ALWAYS running with this error: "The error was: 
unable to evaluate conditional: previous.stat.isdir"

Here is the logfile:
TASK [4YOU : Search for bin directory] 
**
ok: [integuno] => (item=SHR_4YOU-hra-1.1.0-SNAPSHOT)

TASK [4YOU : debug] 

ok: [integuno] => {
"msg": "previous {'msg': u'All items completed', 'changed': False, 
'results': [{u'stat': {u'uid': 54322, u'exists': True, u'woth': False, 
u'mtime': 1472557536, u'inode': 21695026, u'isgid': False, u'size': 4096, 
u'wgrp': False, u'isuid': False, u'isreg': False, u'pw_name': u'integuno', 
u'gid': 54323, u'ischr': False, u'wusr': True, u'xoth': True, u'rusr': 
True, u'nlink': 2, u'issock': False, u'rgrp': True, u'gr_name': u'hr', 
u'path': u'/integuno/DV70_EX/SHR_4YOU-hra-1.1.0-SNAPSHOT/bin', u'xusr': 
True, u'atime': 1472557622, u'isdir': True, u'ctime': 1472634055, u'isblk': 
False, u'xgrp': True, u'dev': 64768, u'roth': True, u'isfifo': False, 
u'mode': u'0755', u'islnk': False}, u'changed': False, '_ansible_no_log': 
False, '_ansible_item_result': True, 'item': 
u'SHR_4YOU-hra-1.1.0-SNAPSHOT', 'invocation': {'module_name': u'stat', 
u'module_args': {u'checksum_algorithm': u'sha1', u'mime': False, 
u'get_checksum': True, u'follow': False, u'path': 
u'/integuno/DV70_EX/SHR_4YOU-hra-1.1.0-SNAPSHOT/bin', u'get_md5': True}}}]}"
}

TASK [4YOU : stop karaf] 
***
fatal: [integuno]: FAILED! => {"failed": true, "msg": "The conditional 
check 'previous.stat.isdir' failed. The error was: unable to evaluate 
conditional: previous.stat.isdir\n\nThe error appears to have been in 
'/home/fvaltat/4YOU/roles/4YOU/tasks/sauvegarde.yml': line 18, 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: stop karaf\n  ^ 
here\n"}
...ignoring

Thanks for your help,
Regards

-- 
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/1b7a398e-eae6-48c8-ba22-70625e013ff2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: HowTo: combine two lists in vars section/file

2016-08-31 Thread Jard Leex
Hi,

to calrify the question here comes a shorten code block

---
- hosts: localhost
  gather_facts: no
  vars:
- simple:
  - right
  - middle
  - top
- nested:
  - hostname: foo
path:
  - left
  - hostname: bar
path:
  - blue
  - green
  - yellow
  - "{{ simple }}"

  tasks:
- name: content of nested
  debug:
msg: "{{ nested }}"

This is the current output:
PLAY [localhost] 
***

TASK [content of nested] 
***
Wednesday 31 August 2016  08:55:13 +0200 (0:00:00.025)   0:00:00.025 
** 
ok: [localhost] => {
"msg": [
{
"hostname": "foo", 
"path": [
"left"
]
}, 
{
"hostname": "bar", 
"path": [
"blue", 
"green", 
"yellow", 
[
"right", 
"middle", 
"top"
]
]
}
]
}

PLAY RECAP 
*
localhost  : ok=1changed=0unreachable=0failed=0 


What I'd like to have is (manipulated output)

PLAY [localhost] 
***

TASK [content of nested] 
***
Wednesday 31 August 2016  08:55:13 +0200 (0:00:00.025)   0:00:00.025 
** 
ok: [localhost] => {
"msg": [
{
"hostname": "foo", 
"path": [
"left"
]
}, 
{
"hostname": "bar", 
"path": [
"blue",
"green",
"yellow",
"right",
"middle",
"top",
]
}
]
}

PLAY RECAP 
*
localhost  : ok=1changed=0unreachable=0failed=0 


Ideas?

-- 
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/041cfb91-646f-44da-8509-1b948939e603%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.