Re: [ansible-project] Need help in exploring how to use regular expression to find the correct file name in a play book

2017-04-25 Thread Kai Stian Olstad
On 25.04.2017 15:35, vinod kumar wrote: I am writing a play book to add below two lines to a service config file under /etc/xinetd.d/. The filename generally starts with oscssd*. As i have multiple servers, this file name is getting changed and playbook is not working as expected as the filenam

[ansible-project] Ansible loop variable

2017-04-25 Thread Kiran Kumar
Hello friends, Am having a challenge finding a solution to below issue. I need to generate multiple network files based on single template and the value of template should change based on the item like IP/NM/GW . Example vars: docker1ip: 1.2.3.4 docker1nm: 255.255.255.1 docker1gw: 1.2.

Re: [ansible-project] junos_command

2017-04-25 Thread Peter Sprygada
HI Asif, junos_command requires netconf to be enabled on the remote device. On Tue, Apr 25, 2017 at 3:31 PM, Asif Iqbal wrote: > I am failing to make junos_command work > > 2017-04-25 15:28:49,152 p=4058 u=user | PLAY [sdwan-routers] > ***

[ansible-project] junos_command

2017-04-25 Thread Asif Iqbal
I am failing to make junos_command work 2017-04-25 15:28:49,152 p=4058 u=user | PLAY [sdwan-routers] 2017-04-25 15:28:49,171 p=4058 u=user | TASK [junos_command] ***

Re: [ansible-project] Example for running a playbook using Python API

2017-04-25 Thread balubhai555
> > Hello Dao, > > I did the same in ansible. - I created one *pb.sh* within the file i wrote below ansible-playbook playbook1.yml and saved. - then i change the permission *chmod +x pb.sh *and run those as * [root@localhost]# ./pb.sh * i think i

[ansible-project] can we use loop modules twice in ansible playbook.

2017-04-25 Thread balubhai555
Hello team, I want to 1. Create AWS ec2 instance using one "*with_items: ec2"* 2. After that I want to insert the IP address of those instances into */etc/ansible/hosts* file. For that I am using *local_action: lineinfile . *But after that I want to use again with_items: "{{ec

Re: [ansible-project] Example for running a playbook using Python API

2017-04-25 Thread Dat Dao
Hi all, I have a Playbook which is used to push template configuration to the router, It work fine if I run command ansible-playbook playbook_name.yml But now I don't want call Playbook manually, I want to creat a file (such as pb.run) and then use it to call playbook. How I can do it? Please

Re: [ansible-project] Need help in exploring how to use regular expression to find the correct file name in a play book

2017-04-25 Thread Dick Davies
Might be better to list the files you want to edit as vars on each of the hosts in your inventory. On 25 April 2017 at 14:35, vinod kumar wrote: > Hi All, > > I am writing a play book to add below two lines to a service config file > under /etc/xinetd.d/. The filename generally starts with oscssd

Re: [ansible-project] Re: getting error while trying to create my own role

2017-04-25 Thread Dick Davies
It is, or the task wouldn't have run. OP: Your role looks broken, but you haven't show that. Probably /usr/bin/lsb_release doesn't exist on localhost. On 25 April 2017 at 12:30, wrote: > > > your file role must be in the path ansible/roles/own_test/tasks/main.yml > > > El martes, 25 de abril d

[ansible-project] Is possible define a var at run-time and use it to access another var ??

2017-04-25 Thread nabila . arias . linacero
https://github.com/ansible/ansible/issues/23961 -- 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

[ansible-project] Is possible define a var at run-time and use it to access another var ??

2017-04-25 Thread nabila . arias . linacero
https://github.com/ansible/ansible/issues/23961 -- 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 t

[ansible-project] How to apply a file operations play book on a file which is varying in different servers - file names are like /etc/xinetd.d/oscssd*

2017-04-25 Thread vinodkumar . redhat
Hi All, I am very new to Ansible. I am stuck at a regular expression syntax for specifying a file name. I am actually updating a file under /etc/xinetd.d/ with some log parameters. I am updating the below two lines to the file /etc/xinetd.d/oscssd3001. The challenge i am facing is that the fil

[ansible-project] Re: getting error while trying to create my own role

2017-04-25 Thread nabila . arias . linacero
your file role must be in the path ansible/roles/own_test/tasks/main.yml El martes, 25 de abril de 2017, 11:49:28 (UTC+2), acharya tejaswi indurthi escribió: > > Hi, > > I am trying to create a new role from my playbook. I had created a file > with the created role > > --- > - hosts: localhos

[ansible-project] Need help in exploring how to use regular expression to find the correct file name in a play book

2017-04-25 Thread vinod kumar
Hi All, I am writing a play book to add below two lines to a service config file under /etc/xinetd.d/. The filename generally starts with oscssd*. As i have multiple servers, this file name is getting changed and playbook is not working as expected as the filename is getting change. Please le

[ansible-project] Re: How to perform recursive vars[varname] expansion in template?

2017-04-25 Thread Long Vu
Re-reading my own post, the vars declaration should have been like this, which will trigger the "no recursive vars[varname] expansion in template" problem which will need the work-around. vars: host1_ro_token: "blah" host1_ro_tokensecret: "blah" host1: { readonly_token: "{{ host1_ro_token

[ansible-project] Re: Creating n AWS ec2 instances with n different names to each ec2 instance

2017-04-25 Thread balubhai555
Yes, Thanks for quick answer. But for ec2_tag requires "*resource: vol-xxx"*. But when the resource created at the time only resource id generated. As i am creating different instances at a time, how can i use the ec2_tag module with *"resource: " * Please suggest me. Thank you in advance. -

[ansible-project] Re: Trouble with Dynamic Inventory (gce.py), please help

2017-04-25 Thread Ned Studious
Thank you Tom. I'll give this a try later today. I had to step away from this for a minute to work on an issue that pays. I'll have some cycles later today to give this a spin. On Saturday, April 22, 2017 at 1:29:14 PM UTC-4, Tom Melendez wrote: > > Hi Ned, > > For clarity and posterity, this

Re: [ansible-project] setup module and ldb_release command

2017-04-25 Thread jean-yves
redhat-lsb Be careful that only version =< ansible 2.3 is able to adress CentOS / RHEL 5.x servers Regards, 25 avril 2017 15:37 "Z-obaze" a écrit: Hello, In order to use the setup module launched by default we have to have on the remote server the lsb_release command which is given by the red

[ansible-project] setup module and ldb_release command

2017-04-25 Thread Z-obaze
Hello, In order to use the setup module launched by default we have to have on the remote server the lsb_release command which is given by the redhat-lsb-core package. Unfortunately I found that package only from el6 and I have el5 too. Do you know how can I do if I want to use the ansible setup

[ansible-project] Can Ansible authenticate to VMware with a Kerberos ticket

2017-04-25 Thread MKPhil
I'm looking at then VMWare modules for Ansible and they all seem to require the vCenter username and password in the playbook. For security reasons, I'd prefer to use a Kerberos ticket (as the vCenter is domain-joined) - is this possible? Otherwise, how do we avoid plain-text passwords floatin

[ansible-project] getting error while trying to create my own role

2017-04-25 Thread acharya tejaswi indurthi
Hi, I am trying to create a new role from my playbook. I had created a file with the created role --- - hosts: localhost connection: local gather_facts: yes roles: - own_test when i am trying with ansible-playbook own_role.yml getting an error PLAY [localhost] ***

[ansible-project] Delete specific routes from AWS route table using ec2_vpc_route_table

2017-04-25 Thread Shmulik Alfandari
Hi, I need to delete all routes which starts with 1.1.* from AWS route table. How can I do that using the ec2_vpc_route_table module? Thanks, Shmulik. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop r

[ansible-project] Re: ec2 ami : "msg": "AMI not updated" while retrieving new ami id

2017-04-25 Thread Shmulik Alfandari
Hi, Please do as follows: # Create AMI - name: Create AMI local_action: module: ec2_ami instance_id: "{{ item.id }}" wait: yes wait_timeout: 3600 aws_access_key: "{{ AWSAccessKey }}" aws_secret_key: "{{ AWSSecretKey }}" region: "{

[ansible-project] Re: Ansible Problems with vmware pysphere and some general issues

2017-04-25 Thread 'J Hawkesworth' via Ansible Project
Hi, I don't have a straightforward answer for you, but I have some suggestions. Firstly I think the vmware_... modules are the ones getting the most attention, so if you can use the vmware_... ones, instead of vsphere_guest you are less likely to have to change things in future. I haven't us

[ansible-project] Re: using files folder for storing files

2017-04-25 Thread Suporter
thanks for the reply On Monday, April 24, 2017 at 9:07:33 PM UTC+5:30, Suporter wrote: > > when we create a roles folder, there is a folder called files in it, can i > use it for storing zip files or whatever i would like to store ..if yes how > can i reference that in playbook, should i mention

[ansible-project] Re: using files folder for storing files

2017-04-25 Thread 'J Hawkesworth' via Ansible Project
I probably wouldn't do that as I want to keep my ansible roles and playbooks in source control. So I would probably create a downloads folder on my ansible controller in some known location that I could either hard code into my playbooks - something like /usr/share/downloads perhaps or alterna