Re: [ansible-project] Building an ansible job to run customized CLI configurations

2018-02-23 Thread Kai Stian Olstad
On Friday, 23 February 2018 21.42.00 CET Jonathan Umpleby wrote: > So here's an example: > > enable > ** > config terminal > appliance-name "*proxy1*" > > interface 0:0 ;mode > label "MGMT" > ip-address *10.0.0.100* 255.255.255.0 > exit > > interface 1:0 ;mode > label "unused" > reject-inbound

[ansible-project] win_uri returning "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."

2018-02-23 Thread Dave Olker
In my Ansible playbook I have a task that calls the "uri" module when running on Linux systems and "win_uri" when run on Windows systems. The remainder of the task is identical: - name: init win_uri: url: "https://ucp01/_thereisnosuchpage; headers: Content-Type:

Re: [ansible-project] Re: How to get processeur vendor ?

2018-02-23 Thread Kai Stian Olstad
On Tuesday, 13 February 2018 22.01.30 CET Eric Secrist wrote: > Hi Flow, > Did you ever get an answer to your question. I see a different number of > list values for ansible_processor between two hosts, which makes it > difficult to easily gather the processor vendor across many hosts. > > ok:

Re: [ansible-project] Using new SSH password when running task

2018-02-23 Thread Cody Harlow
So I guess this turns into a question of can I start a new SSH connection with a new password and user when it runs a new play? On Friday, February 23, 2018 at 9:25:59 AM UTC-5, Kai Stian Olstad wrote: > > On Friday, 23 February 2018 00.54.31 CET Cody Harlow wrote: > > So I have a role that

Re: [ansible-project] Using new SSH password when running task

2018-02-23 Thread Cody Harlow
So I guess this turns into a question of can I start a new SSH connection when it runs a new play? On Friday, February 23, 2018 at 9:25:59 AM UTC-5, Kai Stian Olstad wrote: > > On Friday, 23 February 2018 00.54.31 CET Cody Harlow wrote: > > So I have a role that pulls a password from a website

Re: [ansible-project] Building an ansible job to run customized CLI configurations

2018-02-23 Thread Kai Stian Olstad
On Thursday, 22 February 2018 19.44.51 CET Jonathan Umpleby wrote: > So, I'm new to ansible, and I'm hoping to find ways to meet a > customize-able CLI deployment scenario, where 99% of the commands are the > same across devices, but a handful will be unique. > > I was originally thinking about

[ansible-project] HP Procurve switch

2018-02-23 Thread 'Daley Okuwa' via Ansible Project
Does any one knows how to backup the config of HP Procurve using Ansible. Has anyone done this backup I can't see any information on the networking module -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

Re: [ansible-project] backing up a cisco device using telnet

2018-02-23 Thread 'Daley Okuwa' via Ansible Project
Thanks Any examples as there is very scanty information on ansible website for this Daley On Friday, February 23, 2018 at 2:27:35 PM UTC, Kai Stian Olstad wrote: > On Thursday, 22 February 2018 15.08.11 CET 'Daley Okuwa' via Ansible > Project wrote: > > Is there any information that allows me

[ansible-project] help getting selected facts

2018-02-23 Thread 'ac427' via Ansible Project
Hello , I am trying to get facts ansible_fqdn,ansible_domain,ansible_distribution,ansible_distribution_major_version,ansible_kernel from my all hosts, but having trouble. I tried to follow http://docs.ansible.com/ansible/latest/setup_module.html , but I must be doing something wrong. I

Re: [ansible-project] Building an ansible job to run customized CLI configurations

2018-02-23 Thread Jonathan Umpleby
So here's an example: enable ** config terminal appliance-name "*proxy1*" interface 0:0 ;mode label "MGMT" ip-address *10.0.0.100* 255.255.255.0 exit interface 1:0 ;mode label "unused" reject-inbound enable disable exit interface 1:1 ;mode label "VLAN TAG#" ip-address *10.0.0.10*

Re: [ansible-project] Building an ansible job to run customized CLI configurations

2018-02-23 Thread Andrew Latham
One of the many methods is to scp or sftp the full config as a template to the device and save as startup or running config and reload it. Then you don't need to muck around with as much expect logic. On Fri, Feb 23, 2018 at 2:42 PM, Jonathan Umpleby wrote: > So here's an

Re: [ansible-project] backing up a cisco device using telnet

2018-02-23 Thread Kai Stian Olstad
On Friday, 23 February 2018 17.43.17 CET 'Daley Okuwa' via Ansible Project wrote: > Thanks > Any examples as there is very scanty information on ansible website for this There are some in the list if you search the archive, one thread is this one

Re: [ansible-project] Building an ansible job to run customized CLI configurations

2018-02-23 Thread Jonathan Umpleby
I mean I guess I can build them all out and may be easier, however I was hoping to figure out this iterative process mostly because I'm looking at rolling out somewhere around 100 appliances across the globe (not just proxySG), that will all need similar interface tweaks. On Friday, February

Re: [ansible-project] Ansible playbook --extra-var with dot in json key

2018-02-23 Thread Kai Stian Olstad
On 23.02.2018 12:22, Foss Geek wrote: # cat /tmp/test.json | jq { "VMware.Hardware.Version": " vmx-10", "toolname": "tomcat" } Playbook: # cat test.yml --- host: myhost vars: hdversion: "{{ VMware.Hardware.Version }}" # not works due to dot(.), getting VARIABLE NOT DEFINED when

Re: [ansible-project] Ansible playbook --extra-var with dot in json key

2018-02-23 Thread Foss Geek
On Friday, February 23, 2018 at 5:06:39 PM UTC+5:30, Kai Stian Olstad wrote: > > On 23.02.2018 12:22, Foss Geek wrote: > > # cat /tmp/test.json | jq > > { > > "VMware.Hardware.Version": " vmx-10", > > > > "toolname": "tomcat" > > > > } > > > > > > Playbook: > > > > > > # cat

[ansible-project] Ansible playbook --extra-var with dot in json key

2018-02-23 Thread Foss Geek
Hi All, I need to pass a json file to ansible-palybook command using --extra-var (like --extra-var @/tmp/test.json). I am able to reference the variable inside playbook if the json key don't have dot character in it. But I am not able reference the key which contain dot(.) in it. This is

Re: [ansible-project] for loop in jinja2

2018-02-23 Thread Kai Stian Olstad
On Friday, 23 February 2018 13.28.32 CET David Fazeli wrote: > Please explain to me how can I fix this problem? i have this file > defaults/main.yml > > --- > node1: > ip: 1.1.1.1 > > node2: > ip: 2.2.2.2 > > node3: > ip: 3.3.3.3 > > > Now, I want in template file ip.j2 by for loop

[ansible-project] for loop in jinja2

2018-02-23 Thread David Fazeli
Please explain to me how can I fix this problem? i have this file defaults/main.yml --- node1: ip: 1.1.1.1 node2: ip: 2.2.2.2 node3: ip: 3.3.3.3 Now, I want in template file ip.j2 by for loop access the IPs of each server and save in address variable Like this: address=

Re: [ansible-project] Using new SSH password when running task

2018-02-23 Thread Kai Stian Olstad
On Friday, 23 February 2018 00.54.31 CET Cody Harlow wrote: > So I have a role that pulls a password from a website using the uri method > and I store it in a variable. I call the variable like this: > varname.json.password. How can I use this password when Ansible jumps to > the next play? I

Re: [ansible-project] backing up a cisco device using telnet

2018-02-23 Thread Kai Stian Olstad
On Thursday, 22 February 2018 15.08.11 CET 'Daley Okuwa' via Ansible Project wrote: > Is there any information that allows me to backup a cisco device using > telnet rather than ssh as the device do not support SSH You need to use the expect module for this. -- Kai Stian Olstad -- You

Re: [ansible-project] Security acess to a machine via Ansible

2018-02-23 Thread Kai Stian Olstad
On Thursday, 22 February 2018 13.12.24 CET Oscar Pinto wrote: > > How can I ensure that a user that is used to play the playbooks does not have > ssh access in any other way I don't understand what you mean, since you have no answers other might have the same problem. Could you please

Re: [ansible-project] passing command line arguments

2018-02-23 Thread Kai Stian Olstad
On Monday, 19 February 2018 20.36.02 CET sureshmadapat...@gmail.com wrote: > > --- > - hosts: all > become: yes > tasks: > - name: create an empty folders > import_tasks: /etc/ansible/foldercreation.yml > > - name: Copy rpm file to server > copy: > src: "{{ item

Re: [ansible-project] passing values while installing packages

2018-02-23 Thread Kai Stian Olstad
On Monday, 19 February 2018 21.25.36 CET sureshmadapat...@gmail.com wrote: > while in stalling packages there are values we need to pass, how to pass > those on commandline/runtime . > > ex: [y/n] > [db name]: > [option 3?]: Strange question when you already have posted a post with

Re: [ansible-project] for loop in jinja2

2018-02-23 Thread Nigel Metheringham
Personally I would have done this like this (but you may have reasons for arranging it differently)... defaults/main.yml:- --- nodes: - name: node1 ip: 1.1.1.1 - name: node2 ip: 2.2.2.2 - name: node3 ip: 3.3.3.3 Then the template something like address={% for node