[ansible-project] /etc/ansible and ansible.cfg directory and files are missing in macosx (#31907)

2017-10-18 Thread Deniz Rende
Hello ,

I was wondering why in mac osx the directory /etc/ansible and ansible.cfg 
file are not automatically created when it is done through pip install. 

In other OS's such as ubuntu and centos, these directories are created 
through their package management installation automatically.

I would expect installation behaviour to be same accross all platforms.I do 
realize that the config file and the ansible directory can be created 
manually but I think having this in one platform and not having in the 
other may be causing inconsistencies. The ticket was closed as such as it 
was mentioned that this was an expected behaviour. Could someone be kind 
enough to explain why this inconsistency is expected ?

Thank you!

Regards,

Deniz Rende

-- 
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/c3aa3a44-0558-4d3b-8936-f366104809f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-10-18 Thread Toshio Kuratomi
Hi all, we're happy to announce that RC2 for 2.4.1.0 is now available
for testing.

How do you get it?
--

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

https://releases.ansible.com/ansible/ansible-2.4.1.0-0.4.rc2.tar.gz
SHA256: Subject: Ansible 2.4.0 RC1 is ready for testing


Hi all, we're happy to announce that RC1 for 2.4.0 is now available for testing.

How do you get it?
--

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

https://releases.ansible.com/ansible/ansible-2.4.1.0-0.4.rc2.tar.gz
SHA256: 3437c3262a5905e997555acdc2feaa7180b962943a4bee9c85a8c96bd498d9e8

You can also test against the git repository as follows:

$ git clone https://github.com/ansible/ansible.git
$ cd ansible
$ git checkout v2.4.1.0-0.4.rc2

You can then source our testing script:

$ . hacking/env-setup

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

$ make sdist

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

--

We had been hoping that we would release 2.4.1.0 final this week but
unfortunately we discovered one regression in 2.4.1.0 dealing with implicit
localhost [1]_ that we judged to be a release blocker.  So we've merged a fix
for that and released 2.4.1.0-rc2 today.  If no further blockers are
discovered, we'll release 2.4.1 final next week.

.. _[1]: https://github.com/ansible/ansible/issues/31857


Thanks!

Toshio Kuratomi

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


[ansible-project] Viewing mixed encrypted/unencrypted inventory files

2017-10-18 Thread Guy Knights
Hi,

Will it eventually be possible to view the contents of inventory vars files
that have mixed encrypted/unencrypted content? At the moment it doesn't
seem to be possible outside of copying the encrypted content to a new file
and then using 'ansible-vault view '.

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/CANNH9mtSLCv4PUQUqJ1Lx%2BHYVrP4zSR9EOfA%3DmVsMu9pH03W%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Telnet Module inside 2.4

2017-10-18 Thread Peter Sprygada
There are no plans to add prompt introspection and response to the telnet
module.  It could be an opportunity for someone to take on as a project if
so desired.

On Wed, Oct 18, 2017 at 4:20 PM, Rodrigo  wrote:

> Hello Everyone,
>
> Is there any idea for this subject?
>
> Att,
> Rodrigo Rovere
> www.ciscoredes.com.br
> Twitter: @rar_21
>
> 2017-09-27 18:56 GMT-03:00 Rodrigo Rovere :
>
>> Hello Everyone,
>>
>> I am handling new functionality inside module 2.4 version. According
>> documentation we have " prompts " to manage points to execute next command.
>>
>> However, I am thinking some alternatives of customer only has telnet
>> implementation in your environment and work to change to DevOps inside
>> Ansible, however will be good opportunity for the customer take opportunity
>> to migrate for SSH and work correctly.
>>
>> I was trying to manage the action inside " Cisco IOS " to generate
>> "crypto key", however some devices will request action to answer about key
>> generate ( 512, 1024 ). What's the best approach to manage this
>> implementation inside Ansible to accept the key automatically?
>>
>> Kind Regards,
>> Rodrigo
>>
>> --
>> 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/ms
>> gid/ansible-project/29bf6d22-baed-4685-a2df-09e6c6a4aaa8%
>> 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/CAC1_Jao60VDB-D7Rx4N3catO%
> 3DTBG8TWoCgoa7sdgPLPdqqsCww%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/CAKEs6ac_zZvz3Cub7ZvAnVuYXkNaNNrfqr7TGf031eAQWaRsYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Telnet Module inside 2.4

2017-10-18 Thread Rodrigo
Hello Everyone,

Is there any idea for this subject?

Att,
Rodrigo Rovere
www.ciscoredes.com.br
Twitter: @rar_21

2017-09-27 18:56 GMT-03:00 Rodrigo Rovere :

> Hello Everyone,
>
> I am handling new functionality inside module 2.4 version. According
> documentation we have " prompts " to manage points to execute next command.
>
> However, I am thinking some alternatives of customer only has telnet
> implementation in your environment and work to change to DevOps inside
> Ansible, however will be good opportunity for the customer take opportunity
> to migrate for SSH and work correctly.
>
> I was trying to manage the action inside " Cisco IOS " to generate "crypto
> key", however some devices will request action to answer about key generate
> ( 512, 1024 ). What's the best approach to manage this implementation
> inside Ansible to accept the key automatically?
>
> Kind Regards,
> Rodrigo
>
> --
> 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/29bf6d22-baed-4685-a2df-09e6c6a4aaa8%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/CAC1_Jao60VDB-D7Rx4N3catO%3DTBG8TWoCgoa7sdgPLPdqqsCww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] with_items and increment

2017-10-18 Thread Parth Patel
Thanks!

On Wednesday, October 18, 2017 at 8:57:34 AM UTC-4, Kai Stian Olstad wrote:
>
> On 17. okt. 2017 23:15, Parth Patel wrote: 
> > I am trying to run this simple task where I want to increment  counter 
> for 
> > "{{ esb_name }}_ESB_?" like "ABC_ESB_01, ABC_ESB_02 .etc" until the 
> > loop is over.  How do I do that ?  I tried nested and other loops but 
> was 
> > not able to do it.  Any suggestions ? 
> > 
> > --- 
> >   - hosts: fuseesbdomhosts[0] 
> > remote_user: test 
> > become: yes 
> > become_method: sudo 
> > 
> > 
> >   tasks: 
> > 
> >   - debug: 
> >   msg: "./client -a 8101 -h localhost -u admin -p admin 
> 'fabric:container-create-child --profile {{ esb_name }}_CAML_PRFL {{ item 
> }} {{ esb_name }}_ESB_?'" 
> > with_items: 
> >  - "{{ groups['fuseesbdomhosts'] }}" 
> > 
>
> Not pretty, but you could try this 
>
> - debug: 
>  msg: msg: "./client -a 8101 -h localhost -u admin -p admin 
> 'fabric:container-create-child --profile {{ esb_name }}_CAML_PRFL {{ 
> fuseesbdomhosts[item | int] }} {{ esb_name }}_ESB_{% if item | int > 9 
> %}{{ item }}{% else %}0{{ item }}{% endif %}'" 
>with_sequence: start=0 end={{ groups['fuseesbdomhosts'] | length -1 }} 
>
>
> -- 
> 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/037377c2-8227-463c-a604-a9b2e6642ac0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] jinja2 templated variables do not expand

2017-10-18 Thread eray
I am not sure if its my misuse of jinja within ansible, but I am seeing 
strange behavior from what would seem to be a typical use case for managing 
dynamic variables. As you can see from the code below, I am using the 
mysql_os variable to determine the list to select items from.  This may be 
the intended behavior, but I swear I have done this in the past.  I tested 
on 2.3, and 2.2 with the same results.

---
  - hosts: localhost
connection: local
vars:
  mysql_os: "el6"

  mysql_el6_base:
- "MySQL-server-{{ mysql_os }}"

  mysql_el7_base:
- "mysql-community-server-{{ mysql_os }}"
tasks:
  - debug: msg="{{ item }}.x86_64.rpm"
with_items:
  - "{{vars['mysql_' + mysql_os + '_base']}}"

Expected Result
TASK [debug] 
**
**
ok: [localhost] => (item=MySQL-server-el6) => {
"item": "MySQL-server-el6",
"msg": "MySQL-server-el6.x86_64.rpm"
}



Actual Result
TASK [debug] 
**
**
ok: [localhost] => (item=MySQL-server-{{ mysql_os }}) => {
"item": "MySQL-server-{{ mysql_os }}",
"msg": "MySQL-server-{{ mysql_os }}.x86_64.rpm"
}


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/d2a5cb61-66b9-4b91-88aa-6eb378a22c2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] with_items and increment

2017-10-18 Thread Kai Stian Olstad

On 17. okt. 2017 23:15, Parth Patel wrote:

I am trying to run this simple task where I want to increment  counter for
"{{ esb_name }}_ESB_?" like "ABC_ESB_01, ABC_ESB_02 .etc" until the
loop is over.  How do I do that ?  I tried nested and other loops but was
not able to do it.  Any suggestions ?

---
  - hosts: fuseesbdomhosts[0]
remote_user: test
become: yes
become_method: sudo


  tasks:

  - debug:
  msg: "./client -a 8101 -h localhost -u admin -p admin 
'fabric:container-create-child --profile {{ esb_name }}_CAML_PRFL {{ item }} {{ esb_name 
}}_ESB_?'"
with_items:
 - "{{ groups['fuseesbdomhosts'] }}"



Not pretty, but you could try this

- debug:
msg: msg: "./client -a 8101 -h localhost -u admin -p admin 
'fabric:container-create-child --profile {{ esb_name }}_CAML_PRFL {{ 
fuseesbdomhosts[item | int] }} {{ esb_name }}_ESB_{% if item | int > 9 
%}{{ item }}{% else %}0{{ item }}{% endif %}'"

  with_sequence: start=0 end={{ groups['fuseesbdomhosts'] | length -1 }}


--
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/ed621dab-b468-7e95-fc6e-2da6bf6ba75d%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Task execution only for special items within a loop

2017-10-18 Thread 'Tom Bartsch' via Ansible Project
Hi, 

ok now I try to develop a custom filter. Now my problem is that I am not 
very familiar with python.

What I try to do is to handover Python an multimensional array of artifacts 
and a string variable named env which contains for example "at". 
Each element of the array has 3 keys (artifactId, version and extension) 
with respectively 3 values.

Then I like to iterate over this array and find out which of the array 
elements has an artifactId that contains "atmyartifact-properties".
If the artifactId of an element contains "atmyartifact-properties" I like 
to add it to a new array.

That's all. 
I hope someone with Python skills could give me a code snippet to put my 
plan into action?  



Am Donnerstag, 7. September 2017 16:57:10 UTC+2 schrieb James Tanner:
>
> Calling set_fact with an item loop is not going to slice the original 
> list. Your best best is to make a custom filter plugin to handle this.
>
> An example might look like:
>
> - set_fact:
>  newlist: "{{ bundle_artifacts|artifact_reduce(product, env) }}"
>
>
>
> http://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html#filter-plugins
>
>
> On Thu, Sep 7, 2017 at 10:47 AM, 'Tom Bartsch' via Ansible Project <
> ansible...@googlegroups.com > wrote:
>
>> Has anybody an idea or is this impossible?
>>
>> -- 
>> 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/baae668e-5ee9-4a7e-89b3-f6a5ba8da10e%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/cfdc5ddf-50b5-4dfd-8e40-d4ef3792e8ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Problems with VMWARE and In-Memory Inventory

2017-10-18 Thread Mariano Obarrio Miles
Ok now all work fine, I make some mistakes!!! 

Downgrade to stable Ansible version just like suggested Jean solved 
different issues like "wait_for_ip_address: true" in ansible 2.4 work but 
in 2.5 not.

Now I don't use in-memory inventory,  I solve it setting ansible_ssh_host, 
because the server exist in the inventory and I don't need duplicate it.

#!/usr/bin/ansible-playbook
---
- hosts: centos-vms
  gather_facts: false
  connection: local
  user: root
 
  roles:
- vmware


- hosts: centos-vms
  user: root
  connection: ssh


  roles:
- common

---
- name: Create VM from Template
  vmware_guest:
hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_pass }}"
datacenter: "x"
cluster: VMwareAPP
validate_certs: no
resource_pool: "SSOO"
name: "{{ inventory_hostname }}"
state: poweredon
template: "CentOS_7.4_x64_1708-GPT-20GB_HDD"
wait_for_ip_address: true
guest_id: "{{osid}}"
disk:
- size_gb: "{{disk_size}}"
  type: "{{disk_type}}"
  datastore: "{{ds_name}}"
hardware:
  memory_mb: "{{memory_size}}"
  num_cpus: "{{cpucount}}"
networks:
- name: "{{network_name}}"
  delegate_to: localhost
  register: deploy


- name: Set Facts
  set_fact:
uuid: "{{deploy.instance.hw_product_uuid}}"
ansible_ssh_host: "{{deploy.instance.ipv4}}"
ansible_user: root
ansible_password: x
ansible_ssh_private_key_file: /root/.ssh/ansible.pem


Thanks all,

Best Regards,

Mariano


El martes, 17 de octubre de 2017, 15:22:17 (UTC+2), Mariano Obarrio Miles 
escribió:
>
> Hi Sebastien,
>You  have a role to create VMs and other to add_host to inventory? I 
> try it and send you a feedback soon.
>
> Thxs!
>
> M.
>
>
>
> El martes, 17 de octubre de 2017, 14:57:28 (UTC+2), Sebastien Desbois 
> escribió:
>>
>> Hello,
>>
>> For my part, I'm using the way described by JYL.
>>
>>   - include_role:
>>   name: myrolewhoaddsininventory
>> with_items: "{{ mylist }}"
>>
>> the add_host task is included amonfg other things in the role.
>> And at the end, I get the in-memory inventory properly filed.
>>
>>
>>
>> Le mardi 17 octobre 2017 13:25:53 UTC+2, Mariano Obarrio Miles a écrit :
>>>
>>> Hi Sebastien,
>>>I try with a loop but the result it's the same. Only add one of both. 
>>> Learn05 (.232.141)
>>>
>>> The loop:
>>>
>>> - name: DEBUG Show inventory_hostname
>>>   debug: msg="inventory_hostname {{inventory_hostname}}"
>>>
>>>
>>> - name: Add_host with Loop
>>>   add_host:
>>> name: "{{item.value.ipv4}}"
>>> groups: in-memory-vms
>>> ansible_ssh_host: "{{item.value.ipv4}}"
>>> ansible_distribution: "CentOS"
>>> ansible_system: "Linux"
>>> ansible_ssh_private_key_file: /root/.ssh/ansible.pem
>>>   with_dict: "{{ instance_facts }}"
>>>   when: item.key in ['instance']
>>>   changed_when: false
>>>
>>>
>>> When execute the new playbook, only added learn05, but the debug in 
>>> "TASK [vmware : DEBUG Show inventory_hostname]" show two hosts.
>>>
>>> In the common role I added a debug line "TASK [common : debug]" to show 
>>> all groups outside of vmware role. If you can see the in-memory-vms group 
>>>  have only one IP learn05 (.232.141)
>>>
>>>
>>> *[root@learn01 ansible]# ./createvm.yml*
>>>
>>> PLAY [centos-vms] 
>>> ***
>>>
>>>
>>> TASK [vmware : include_tasks] 
>>> ***
>>> included: /var/adm/ssoo/opt/ansible/roles/vmware/tasks/
>>> create_vms_from_template.yml for learn05, learn06
>>>
>>>
>>> TASK [vmware : Create VM from Template] 
>>> *
>>> changed: [learn06 -> localhost]
>>> changed: [learn05 -> localhost]
>>>
>>>
>>> TASK [vmware : Espera asignacion de IP via DHCP] 
>>> 
>>> Pausing for 60 seconds
>>> (ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
>>> ok: [learn05]
>>>
>>>
>>> TASK [vmware : Gather instance facts] 
>>> ***
>>> ok: [learn06]
>>> ok: [learn05]
>>>
>>>
>>> TASK [vmware : DEBUG Show inventory_hostname] 
>>> 

[ansible-project] Re: "here doc" in shell command

2017-10-18 Thread thomas . lehmann
Good point. It's seems not officially documented. In my local Ansible 
installation I've found the relating code part
in playbook/tasks.py

   182  # the command/shell/script modules used to support the 
`cmd` arg,
   183  # which corresponds to what we now call _raw_params, so 
move that
   184  # value over to _raw_params (assuming it is empty)
   185  if action in ('command', 'shell', 'script'):
   186  if 'cmd' in args:
   187  if args.get('_raw_params', '') != '':
   188  raise AnsibleError("The 'cmd' argument cannot 
be used when other raw parameters are specified."
   189 " Please put everything in 
one or the other place.", obj=ds)
   190  args['_raw_params'] = args.pop('cmd')





On Tuesday, October 17, 2017 at 12:22:11 AM UTC+2, ru...@yahoo.com wrote:
>
> Ah, thank you very much!  I actually had seen that SO post before but 
> realize now when I tried it I screwed up (I had left the vertical bar 
> character on the "shell" line, not the command line.)  Now I see it does in 
> fact work.
>
> But one further question...  Where is "cmd" documented? 
>
>

-- 
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/ce8a4a1f-081b-424b-8c87-e5b279a997a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.