[ansible-project] for loop sorted output in a template

2017-03-12 Thread Spike
Hi, I've had this problem came up a few times and hope someone here has a solution for it. I have a basic for loop in a template where multiple lines are printed per loop. The problem is that I'd like similar lines to be grouped. Example: *myvar:* * - {name: one, value: 1} * * - {name: two, v

Re: [ansible-project] Re: junos_template in Ansible 2.1

2017-03-12 Thread Dat Dao
Dear Peter, Thanks for your response, but can you explain about the argument src in the junos_template. I don't know what do we fill after src's colon? the path or the file name? In my ansible, I creat config.j2 at /etc/ansible folder. So Can I fill: src: /etc/ansible/config.j2 Or: src: c

Re: [ansible-project] How to get the --limit command line option

2017-03-12 Thread Brian Coca
That is info is not available direclty in play, but you could check ansible_play_hosts vs the hosts pattern to see what the difference is. If you supply multiple options for --limit, only the last one is heeded. -- Brian Coca -- You received this message because you are subscribed to t

Re: [ansible-project] Put anisble up and running example in a role with add_host

2017-03-12 Thread Dick Davies
You could use delegation to run some of the tasks on another machine (in this case localhost). But to be honest I wouldn't, personally I'd split this into 2 plays. On 12 March 2017 at 04:33, Zhu Wayne wrote: > Is it possible to pack the following into a single role? My understanding > that a rol

Re: [ansible-project] Network Modules - dealing with Interactive prompts

2017-03-12 Thread Peter Sprygada
which version of ansible are you running? On Fri, Mar 10, 2017 at 9:29 AM, wrote: > Hello, > > What is the best approach to dealing with interactive commands. I am > attempting to use ansible to download a software file to a switch using a > "copy > scp://admin@1.1.1.1/sw/software_file flash:so

Re: [ansible-project] Re: junos_template in Ansible 2.1

2017-03-12 Thread Peter Sprygada
only include configuration statements in your file (config.j2), not cli commands. remove the configure and commit statements On Sun, Mar 12, 2017 at 11:39 AM, Dat Dao wrote: > Hi IAN, > I am a newbie in ansible sector, I wrote the playbook in which I used > junos_template module, but when I

[ansible-project] Re: Need help with a jinja2 filter

2017-03-12 Thread Kenton Brede
Actually "sg_facts | json_query('instances[*].groups[*])" spits out: TASK [debug] *** ok: [localhost] => (item={u'id': u'sg-828889fe', u'name': u'Default / EC2 / Linux Ansible Clients'}) => { "": "VARIABLE IS NOT DEFINED!", "i

[ansible-project] Need help with a jinja2 filter

2017-03-12 Thread Kenton Brede
I'm trying to get the id of the security group that doesn't have 'Default' in the name. In other words grab "sg-0a2fea74." This is what "sg_facts | json_query('instances[*].groups[*])" spits out: "groups": [ { "id": "sg-828889fe", "name": "Default /

Re: [ansible-project] Ansible Tower 3.1.1 fails to pull down roles using galaxy on project updates

2017-03-12 Thread Brian Coca
For tower issues please file a ticket at https://support.ansible.com -- 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+u

Re: [ansible-project] Re: IP address to hexadecimal conversion

2017-03-12 Thread Madhu
I looked at it. How do you use it in the tasks or variable file? On Sat, Mar 11, 2017 at 10:51 AM, Mischa ter Smitten wrote: > You might want to have a look at the netaddr package: > > http://netaddr.readthedocs.io/en/latest/tutorial_01.html > > > On Saturday, March 11, 2017 at 5:07:04 PM UTC+1,

[ansible-project] Re: junos_template in Ansible 2.1

2017-03-12 Thread Dat Dao
Hi IAN, I am a newbie in ansible sector, I wrote the playbook in which I used junos_template module, but when I run playbook, I got this error: he error is "msg": "Unable to load config: ConfigLoadError(severity: error, bad_element: junos.set, message: error: unknown command)" which is odd s

[ansible-project] How to run commands on a host created by add_host in a role run on localhost

2017-03-12 Thread Zhu Wayne
Here is my ansible playbook. I want to use role ec2_jumphost to create an EC2 instance and format / mount attached EBS volumes. I used add_host in the role to add the new EC2 instance as a host. How can I run commands in the role on the new EC2 instance? Here is my ansible playbook - aws.yml. -

[ansible-project] Need help on SSL connection with SSL cert validation

2017-03-12 Thread Paresh Pendharkar
Hi All, I would like to have SSL connection with my windows machine using SSL cert validation. Currently I am able to connect to Windows machine using winrm_server_cert_validation variable as ignore. Below is the configuration - Ansible node on Ubuntu 64 bit , version: 2.1.1.0 Python version

[ansible-project] Re: Ansible-OpenStack:cannot ssh into the containers

2017-03-12 Thread Dimitris Theoharis
hello have you solved this issue ? i have the same problem thanks On Wednesday, November 25, 2015 at 8:38:13 PM UTC+2, kaki...@gmail.com wrote: > > Hi, > > I am trying to deploy openstack using openstack-ansible project. I am > using Liberty release (tag 12.0.0). > The problem i have is that An

[ansible-project] How to make SSL connection with windows node using certificate validation

2017-03-12 Thread Paresh Pendharkar
Hi All, I have below configuration - Ansible - version -> 2.1.1.0 on Ubuntu 64 bit Python version -> 2.7.12+ I am able to connect with my windows machine with winrm_server_cert_validation=ignore variable set in hosts file. Please note , my HTTPS port is listening on 5896 port and it also show

[ansible-project] Put anisble up and running example in a role with add_host

2017-03-12 Thread Zhu Wayne
Is it possible to pack the following into a single role? My understanding that a role ONLY can be run on a defined set of hosts. - name: Provision a vagrant machine hosts: localhost vars: box: trusty64 tasks: - name: create a Vagrantfile command: